|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
public interface FileObject
File abstraction for tools. In this context, file means an abstraction of regular files and other sources of data. For example, a file object can be used to represent regular files, memory cache, or data in databases.
All methods in this interface might throw a SecurityException if a security exception occurs.
Unless explicitly allowed, all methods in this interface might
throw a NullPointerException if given a null argument.
| Method Summary | |
|---|---|
boolean |
delete()
Deletes this file object. |
java.lang.CharSequence |
getCharContent(boolean ignoreEncodingErrors)
Gets the character content of this file object, if available. |
long |
getLastModified()
Gets the time this file object was last modified. |
java.lang.String |
getName()
Gets a user-friendly name for this file object. |
java.io.InputStream |
openInputStream()
Gets an InputStream for this file object. |
java.io.OutputStream |
openOutputStream()
Gets an OutputStream for this file object. |
java.io.Reader |
openReader(boolean ignoreEncodingErrors)
Gets a reader for this object. |
java.io.Writer |
openWriter()
Gets a Writer for this file object. |
java.net.URI |
toUri()
Returns a URI identifying this file object. |
| Method Detail |
|---|
java.net.URI toUri()
java.lang.String getName()
"BobsApp\Test.java" on
the command line, this method should return "BobsApp\Test.java" whereas the toUri
method might return file:///C:/Documents%20and%20Settings/UncleBob/BobsApp/Test.java.
java.io.InputStream openInputStream()
throws java.io.IOException
java.lang.IllegalStateException - if this file object was
opened for writing and does not support reading
java.lang.UnsupportedOperationException - if this kind of file
object does not support byte access
java.io.IOException - if an I/O error occurred
java.io.OutputStream openOutputStream()
throws java.io.IOException
java.lang.IllegalStateException - if this file object was
opened for reading and does not support writing
java.lang.UnsupportedOperationException - if this kind of
file object does not support byte access
java.io.IOException - if an I/O error occurred
java.io.Reader openReader(boolean ignoreEncodingErrors)
throws java.io.IOException
ignoreEncodingErrors is true.
ignoreEncodingErrors - ignore encoding errors if true
java.lang.IllegalStateException - if this file object was
opened for writing and does not support reading
java.lang.UnsupportedOperationException - if this kind of
file object does not support character access
java.io.IOException - if an I/O error occurred
java.lang.CharSequence getCharContent(boolean ignoreEncodingErrors)
throws java.io.IOException
ignoreEncodingErrors is true.
ignoreEncodingErrors - ignore encoding errors if true
null otherwise
java.lang.IllegalStateException - if this file object was
opened for writing and does not support reading
java.lang.UnsupportedOperationException - if this kind of
file object does not support character access
java.io.IOException - if an I/O error occurred
java.io.Writer openWriter()
throws java.io.IOException
java.lang.IllegalStateException - if this file object was
opened for reading and does not support writing
java.lang.UnsupportedOperationException - if this kind of
file object does not support character access
java.io.IOException - if an I/O error occurredlong getLastModified()
boolean delete()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||