F - the kind of file object forwarded to by this objectpublic class ForwardingFileObject<F extends FileObject> extends java.lang.Object implements FileObject
| Modifier and Type | Field and Description |
|---|---|
protected F |
fileObject
The file object which all methods are delegated to.
|
| Modifier | Constructor and Description |
|---|---|
protected |
ForwardingFileObject(F fileObject)
Creates a new instance of ForwardingFileObject.
|
| Modifier and Type | Method and Description |
|---|---|
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.
|
protected final F extends FileObject fileObject
protected ForwardingFileObject(F fileObject)
fileObject - delegate to this file objectpublic java.net.URI toUri()
FileObjecttoUri in interface FileObjectpublic java.lang.String getName()
FileObject"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.getName in interface FileObjectpublic java.io.InputStream openInputStream()
throws java.io.IOException
FileObjectopenInputStream in interface FileObjectjava.lang.IllegalStateException - if this file object was
opened for writing and does not support readingjava.lang.UnsupportedOperationException - if this kind of file
object does not support byte accessjava.io.IOException - if an I/O error occurredpublic java.io.OutputStream openOutputStream()
throws java.io.IOException
FileObjectopenOutputStream in interface FileObjectjava.lang.IllegalStateException - if this file object was
opened for reading and does not support writingjava.lang.UnsupportedOperationException - if this kind of
file object does not support byte accessjava.io.IOException - if an I/O error occurredpublic java.io.Reader openReader(boolean ignoreEncodingErrors)
throws java.io.IOException
FileObjectignoreEncodingErrors is true.openReader in interface FileObjectignoreEncodingErrors - ignore encoding errors if truejava.lang.IllegalStateException - if this file object was
opened for writing and does not support readingjava.lang.UnsupportedOperationException - if this kind of
file object does not support character accessjava.io.IOException - if an I/O error occurredpublic java.lang.CharSequence getCharContent(boolean ignoreEncodingErrors)
throws java.io.IOException
FileObjectignoreEncodingErrors is true.getCharContent in interface FileObjectignoreEncodingErrors - ignore encoding errors if truenull otherwisejava.lang.IllegalStateException - if this file object was
opened for writing and does not support readingjava.lang.UnsupportedOperationException - if this kind of
file object does not support character accessjava.io.IOException - if an I/O error occurredpublic java.io.Writer openWriter()
throws java.io.IOException
FileObjectopenWriter in interface FileObjectjava.lang.IllegalStateException - if this file object was
opened for reading and does not support writingjava.lang.UnsupportedOperationException - if this kind of
file object does not support character accessjava.io.IOException - if an I/O error occurredpublic long getLastModified()
FileObjectgetLastModified in interface FileObjectpublic boolean delete()
FileObjectdelete in interface FileObject