DevFaqFileObject

What is a FileObject?

FileObjects are virtual files which live inside a FileSystem . They may represent a file on disk - or anything else walks and talks like a file, or can be made to - such as a file on a remote FTP server, a file entry in a JAR file, an entry in an XML file, etc.

FileObjects differ from java.io.File in certain ways:

  • You don't generally ever have a FileObject representing a file that doesn't really exist (if you think a FileObject may have been deleted, check isValid())
  • You can listen for changes on FileObjects
  • FileObjects can have key-value pairs of ad-hoc attributes associated with them

They are part of the Filesystems API; the javadoc for FileObject can be found here.

Not logged in. Log in, Register

By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2012, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo