public interface FileObject
| Modifier and Type | Method and Description |
|---|---|
boolean |
delete()
Deletes this file object.
|
CharSequence |
getCharContent(boolean ignoreEncodingErrors)
Returns the character content of the file, if available.
|
long |
getLastModified()
Returns the time when the file was last modified.
|
String |
getName()
Returns a name for this file object.
|
InputStream |
openInputStream()
Opens this file for reading and returns an input stream.
|
OutputStream |
openOutputStream()
Opens this file for writing and returns an output stream.
|
Reader |
openReader(boolean ignoreEncodingErrors)
Opens this file for reading and returns a reader.
|
Writer |
openWriter()
Opens this file for writer and returns a writer.
|
URI |
toUri()
Returns a URI that represents this file object.
|
URI toUri()
String getName()
InputStream openInputStream() throws IOException
IOException - if an I/O error occuredIllegalStateException - if this file was opened for writing and
does not support readingUnsupportedOperationException - if this kind of file does not allow
byte readingOutputStream openOutputStream() throws IOException
IOException - if an I/O error occursIllegalStateException - if this file was opened for reading and
does not support writingUnsupportedOperationException - if this kind of file does not allow
byte writingReader openReader(boolean ignoreEncodingErrors) throws IOException
ignoreEncodingErrors - true when encoding errors should be ignored
false otherwiseIOException - if an I/O error occursIllegalStateException - if this file was opened for writing and
does not support readingUnsupportedOperationException - if this kind of file does not allow
character readingCharSequence getCharContent(boolean ignoreEncodingErrors) throws IOException
ignoreEncodingErrors is true.ignoreEncodingErrors - true when encoding errors should be ignored
false otherwisenull if not availableIOException - if an I/O error occursWriter openWriter() throws IOException
IOException - if an I/O error occursIllegalStateException - if this file was opened for reading and
does not support writingUnsupportedOperationException - 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