Package com.android.io
Class FileWrapper
- java.lang.Object
-
- java.io.File
-
- com.android.io.FileWrapper
-
- All Implemented Interfaces:
IAbstractFile,IAbstractResource,java.io.Serializable,java.lang.Comparable<java.io.File>
public class FileWrapper extends java.io.File implements IAbstractFile
An implementation ofIAbstractFileextendingFile.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description FileWrapper(java.io.File file)Creates a new File instance matching a givenFileobject.FileWrapper(java.io.File parent, java.lang.String child)Creates a new File instance from a parent abstract pathname and a child pathname string.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanexists()Returns whether the resource actually exists.java.io.InputStreamgetContents()Returns anInputStreamobject on the file content.java.lang.StringgetOsLocation()Returns the OS path of the folder location (may be absolute).java.io.OutputStreamgetOutputStream()Returns anOutputStreamto write into the file.voidsetContents(java.io.InputStream source)Sets the content of the file.-
Methods inherited from class java.io.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
-
-
-
-
Constructor Detail
-
FileWrapper
public FileWrapper(java.io.File file)
Creates a new File instance matching a givenFileobject.- Parameters:
file- the file to match
-
FileWrapper
public FileWrapper(java.io.File parent, java.lang.String child)Creates a new File instance from a parent abstract pathname and a child pathname string.- Parameters:
parent- the parent pathnamechild- the child name- See Also:
File(File, String)
-
-
Method Detail
-
getContents
public java.io.InputStream getContents() throws StreamExceptionDescription copied from interface:IAbstractFileReturns anInputStreamobject on the file content. The stream must be closed by the caller.- Specified by:
getContentsin interfaceIAbstractFile- Throws:
StreamException
-
setContents
public void setContents(java.io.InputStream source) throws StreamExceptionDescription copied from interface:IAbstractFileSets the content of the file.- Specified by:
setContentsin interfaceIAbstractFile- Parameters:
source- the content- Throws:
StreamException
-
getOutputStream
public java.io.OutputStream getOutputStream() throws StreamExceptionDescription copied from interface:IAbstractFileReturns anOutputStreamto write into the file.- Specified by:
getOutputStreamin interfaceIAbstractFile- Throws:
StreamException
-
getOsLocation
public java.lang.String getOsLocation()
Description copied from interface:IAbstractResourceReturns the OS path of the folder location (may be absolute).- Specified by:
getOsLocationin interfaceIAbstractResource
-
exists
public boolean exists()
Description copied from interface:IAbstractResourceReturns whether the resource actually exists.- Specified by:
existsin interfaceIAbstractResource- Overrides:
existsin classjava.io.File
-
-