public interface FileObject
| Modifier and Type | Method and Description |
|---|---|
boolean |
delete()
Deletes this file object.
|
java.lang.CharSequence |
getCharContent(boolean ignoreEncodingErrors)
Returns the character content of the file, if available.
|
long |
getLastModified()
Returns the time when the file was last modified.
|
java.lang.String |
getName()
Returns a name for this file object.
|
java.io.InputStream |
openInputStream()
Opens this file for reading and returns an input stream.
|
java.io.OutputStream |
openOutputStream()
Opens this file for writing and returns an output stream.
|
java.io.Reader |
openReader(boolean ignoreEncodingErrors)
Opens this file for reading and returns a reader.
|
java.io.Writer |
openWriter()
Opens this file for writer and returns a writer.
|
java.net.URI |
toUri()
Returns a URI that represents this file object.
|
java.net.URI toUri()
java.lang.String getName()
java.io.InputStream openInputStream() throws java.io.IOException
java.io.IOException - if an I/O error occuredjava.lang.IllegalStateException - if this file was opened for writing and
does not support readingjava.lang.UnsupportedOperationException - if this kind of file does not allow
byte readingjava.io.OutputStream openOutputStream() throws java.io.IOException
java.io.IOException - if an I/O error occursjava.lang.IllegalStateException - if this file was opened for reading and
does not support writingjava.lang.UnsupportedOperationException - if this kind of file does not allow
byte writingjava.io.Reader openReader(boolean ignoreEncodingErrors) throws java.io.IOException
ignoreEncodingErrors - true when encoding errors should be ignored
false otherwisejava.io.IOException - if an I/O error occursjava.lang.IllegalStateException - if this file was opened for writing and
does not support readingjava.lang.UnsupportedOperationException - if this kind of file does not allow
character readingjava.lang.CharSequence getCharContent(boolean ignoreEncodingErrors) throws java.io.IOException
ignoreEncodingErrors is true.ignoreEncodingErrors - true when encoding errors should be ignored
false otherwisenull if not availablejava.io.IOException - if an I/O error occursjava.io.Writer openWriter() throws java.io.IOException
java.io.IOException - if an I/O error occursjava.lang.IllegalStateException - if this file was opened for reading and
does not support writingjava.lang.UnsupportedOperationException - if this kind of file does not allow
character writinglong getLastModified()
System.currentTimeMillis().boolean delete()
false.true when the file deletion was successful,
false otherwise