public class FileWrapper extends java.io.File implements IAbstractFile
IAbstractFile
extending File
.IAbstractFile.PreferredWriteMode
Constructor and Description |
---|
FileWrapper(java.io.File file)
Creates a new File instance matching a given
File object. |
FileWrapper(java.io.File parent,
java.lang.String child)
Creates a new File instance from a parent abstract pathname and a child pathname string.
|
FileWrapper(java.lang.String osPathname)
Creates a new File instance by converting the given pathname string into an abstract
pathname.
|
FileWrapper(java.lang.String parent,
java.lang.String child)
Creates a new File instance from a parent abstract pathname and a child pathname string.
|
FileWrapper(java.net.URI uri)
Creates a new File instance by converting the given
file: URI into an
abstract pathname. |
Modifier and Type | Method and Description |
---|---|
boolean |
exists()
Returns whether the resource actually exists.
|
java.io.InputStream |
getContents()
Returns an
InputStream object on the file content. |
long |
getModificationStamp()
Returns the last modification timestamp
|
java.lang.String |
getOsLocation()
Returns the OS path of the folder location (may be absolute).
|
java.io.OutputStream |
getOutputStream()
Returns an
OutputStream to write into the file. |
IAbstractFolder |
getParentFolder()
Returns the parent folder or null if there is no parent.
|
IAbstractFile.PreferredWriteMode |
getPreferredWriteMode()
Returns the preferred mode to write into the file.
|
void |
setContents(java.io.InputStream source)
Sets the content of the file.
|
canExecute, canRead, canWrite, compareTo, createNewFile, createTempFile, createTempFile, delete, deleteOnExit, equals, getAbsoluteFile, getAbsolutePath, getCanonicalFile, getCanonicalPath, getFreeSpace, getName, getParent, getParentFile, getPath, getTotalSpace, getUsableSpace, hashCode, isAbsolute, isDirectory, isFile, isHidden, lastModified, length, list, list, listFiles, listFiles, listFiles, listRoots, mkdir, mkdirs, renameTo, setExecutable, setExecutable, setLastModified, setReadable, setReadable, setReadOnly, setWritable, setWritable, toPath, toString, toURI, toURL
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
delete, getName, getPath
public FileWrapper(java.io.File file)
File
object.file
- the file to matchpublic FileWrapper(java.io.File parent, java.lang.String child)
parent
- the parent pathnamechild
- the child nameFile.File(File, String)
public FileWrapper(java.lang.String osPathname)
osPathname
- the OS pathnameFile.File(String)
public FileWrapper(java.lang.String parent, java.lang.String child)
parent
- the parent pathnamechild
- the child nameFile.File(String, String)
public FileWrapper(java.net.URI uri)
file:
URI into an
abstract pathname.uri
- An absolute, hierarchical URI with a scheme equal to "file", a non-empty path
component, and undefined authority, query, and fragment componentsFile.File(URI)
public java.io.InputStream getContents() throws StreamException
IAbstractFile
InputStream
object on the file content.
The stream must be closed by the caller.getContents
in interface IAbstractFile
StreamException
public void setContents(java.io.InputStream source) throws StreamException
IAbstractFile
setContents
in interface IAbstractFile
source
- the contentStreamException
public java.io.OutputStream getOutputStream() throws StreamException
IAbstractFile
OutputStream
to write into the file.getOutputStream
in interface IAbstractFile
StreamException
public IAbstractFile.PreferredWriteMode getPreferredWriteMode()
IAbstractFile
getPreferredWriteMode
in interface IAbstractFile
public java.lang.String getOsLocation()
IAbstractResource
getOsLocation
in interface IAbstractResource
public boolean exists()
IAbstractResource
exists
in interface IAbstractResource
exists
in class java.io.File
public long getModificationStamp()
IAbstractFile
getModificationStamp
in interface IAbstractFile
public IAbstractFolder getParentFolder()
IAbstractResource
getParentFolder
in interface IAbstractResource