|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface FileObject
Abstraction for all kinds of file objects used by tools, e.g. regular files, memory cache, or database data.
Method Summary | |
---|---|
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. |
Method Detail |
---|
URI toUri()
String getName()
InputStream openInputStream() throws IOException
IOException
- if an I/O error occured
IllegalStateException
- if this file was opened for writing and
does not support reading
UnsupportedOperationException
- if this kind of file does not allow
byte readingOutputStream openOutputStream() throws IOException
IOException
- if an I/O error occurs
IllegalStateException
- if this file was opened for reading and
does not support writing
UnsupportedOperationException
- if this kind of file does not allow
byte writingReader openReader(boolean ignoreEncodingErrors) throws IOException
ignoreEncodingErrors
- true
when encoding errors should be ignored
false
otherwise
IOException
- if an I/O error occurs
IllegalStateException
- if this file was opened for writing and
does not support reading
UnsupportedOperationException
- 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
otherwise
null
if not available
IOException
- if an I/O error occursWriter openWriter() throws IOException
IOException
- if an I/O error occurs
IllegalStateException
- if this file was opened for reading and
does not support writing
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
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |