Package com.android.io
Class FolderWrapper
- java.lang.Object
-
- java.io.File
-
- com.android.io.FolderWrapper
-
- All Implemented Interfaces:
IAbstractFolder,IAbstractResource,java.io.Serializable,java.lang.Comparable<java.io.File>
public class FolderWrapper extends java.io.File implements IAbstractFolder
An implementation ofIAbstractFolderextendingFile.- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface com.android.io.IAbstractFolder
IAbstractFolder.FilenameFilter
-
-
Constructor Summary
Constructors Constructor Description FolderWrapper(java.io.File file)Creates a new File instance matching a giveFileobject.FolderWrapper(java.io.File parent, java.lang.String child)Creates a new File instance from a parent abstract pathname and a child pathname string.FolderWrapper(java.lang.String pathname)Creates a new File instance by converting the given pathname string into an abstract pathname.FolderWrapper(java.lang.String parent, java.lang.String child)Creates a new File instance from a parent abstract pathname and a child pathname string.FolderWrapper(java.net.URI uri)Creates a new File instance by converting the givenfile:URI into an abstract pathname.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanexists()Returns whether the resource actually exists.IAbstractFilegetFile(java.lang.String name)Returns anIAbstractFilerepresenting a child of the current folder with the given name.IAbstractFoldergetFolder(java.lang.String name)Returns anIAbstractFolderrepresenting a child of the current folder with the given name.java.lang.StringgetOsLocation()Returns the OS path of the folder location (may be absolute).IAbstractFoldergetParentFolder()Returns the parent folder or null if there is no parent.booleanhasFile(java.lang.String name)Returns true if the receiver contains a file with a given namejava.lang.String[]list(IAbstractFolder.FilenameFilter filter)Returns a list of all existing file and directory members in this folder that satisfy the specified filter.IAbstractResource[]listMembers()Returns a list of all existing file and directory members in this folder.-
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
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface com.android.io.IAbstractResource
delete, getName, getPath
-
-
-
-
Constructor Detail
-
FolderWrapper
public FolderWrapper(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)
-
FolderWrapper
public FolderWrapper(java.lang.String pathname)
Creates a new File instance by converting the given pathname string into an abstract pathname.- Parameters:
pathname- the pathname- See Also:
File(String)
-
FolderWrapper
public FolderWrapper(java.lang.String 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(String, String)
-
FolderWrapper
public FolderWrapper(java.net.URI uri)
Creates a new File instance by converting the givenfile:URI into an abstract pathname.- Parameters:
uri- An absolute, hierarchical URI with a scheme equal to "file", a non-empty path component, and undefined authority, query, and fragment components- See Also:
File(URI)
-
FolderWrapper
public FolderWrapper(java.io.File file)
Creates a new File instance matching a giveFileobject.- Parameters:
file- the file to match
-
-
Method Detail
-
listMembers
public IAbstractResource[] listMembers()
Description copied from interface:IAbstractFolderReturns a list of all existing file and directory members in this folder. The returned array can be empty but is never null.- Specified by:
listMembersin interfaceIAbstractFolder
-
hasFile
public boolean hasFile(java.lang.String name)
Description copied from interface:IAbstractFolderReturns true if the receiver contains a file with a given name- Specified by:
hasFilein interfaceIAbstractFolder- Parameters:
name- the name of the file. This is the name without the path leading to the parent folder.
-
getFile
public IAbstractFile getFile(java.lang.String name)
Description copied from interface:IAbstractFolderReturns anIAbstractFilerepresenting a child of the current folder with the given name. The file may not actually exist.- Specified by:
getFilein interfaceIAbstractFolder- Parameters:
name- the name of the file.
-
getFolder
public IAbstractFolder getFolder(java.lang.String name)
Description copied from interface:IAbstractFolderReturns anIAbstractFolderrepresenting a child of the current folder with the given name. The folder may not actually exist.- Specified by:
getFolderin interfaceIAbstractFolder- Parameters:
name- the name of the folder.
-
getParentFolder
public IAbstractFolder getParentFolder()
Description copied from interface:IAbstractResourceReturns the parent folder or null if there is no parent.- Specified by:
getParentFolderin interfaceIAbstractResource
-
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
-
list
public java.lang.String[] list(IAbstractFolder.FilenameFilter filter)
Description copied from interface:IAbstractFolderReturns a list of all existing file and directory members in this folder that satisfy the specified filter.- Specified by:
listin interfaceIAbstractFolder- Parameters:
filter- A filename filter instance. Must not be null.- Returns:
- An array of file names (generated using
File.getName()). The array can be empty but is never null.
-
-