com.android.io
Class FolderWrapper

java.lang.Object
  extended by java.io.File
      extended by 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 of IAbstractFolder extending File.

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from interface com.android.io.IAbstractFolder
IAbstractFolder.FilenameFilter
 
Field Summary
 
Fields inherited from class java.io.File
pathSeparator, pathSeparatorChar, separator, separatorChar
 
Constructor Summary
FolderWrapper(java.io.File file)
          Creates a new File instance matching a give File object.
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 given file: URI into an abstract pathname.
 
Method Summary
 boolean exists()
          Returns whether the resource actually exists.
 IAbstractFile getFile(java.lang.String name)
          Returns an IAbstractFile representing a child of the current folder with the given name.
 IAbstractFolder getFolder(java.lang.String name)
          Returns an IAbstractFolder representing a child of the current folder with the given name.
 java.lang.String getOsLocation()
          Returns the OS path of the folder location.
 IAbstractFolder getParentFolder()
          Returns the parent folder or null if there is no parent.
 boolean hasFile(java.lang.String name)
          Returns true if the receiver contains a file with a given name
 java.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, 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
 

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 pathname
child - the child name
See Also:
File.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.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 pathname
child - the child name
See Also:
File.File(String, String)

FolderWrapper

public FolderWrapper(java.net.URI uri)
Creates a new File instance by converting the given file: 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.File(URI)

FolderWrapper

public FolderWrapper(java.io.File file)
Creates a new File instance matching a give File object.

Parameters:
file - the file to match
Method Detail

listMembers

public IAbstractResource[] listMembers()
Description copied from interface: IAbstractFolder
Returns a list of all existing file and directory members in this folder. The returned array can be empty but is never null.

Specified by:
listMembers in interface IAbstractFolder

hasFile

public boolean hasFile(java.lang.String name)
Description copied from interface: IAbstractFolder
Returns true if the receiver contains a file with a given name

Specified by:
hasFile in interface IAbstractFolder
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: IAbstractFolder
Returns an IAbstractFile representing a child of the current folder with the given name. The file may not actually exist.

Specified by:
getFile in interface IAbstractFolder
Parameters:
name - the name of the file.

getFolder

public IAbstractFolder getFolder(java.lang.String name)
Description copied from interface: IAbstractFolder
Returns an IAbstractFolder representing a child of the current folder with the given name. The folder may not actually exist.

Specified by:
getFolder in interface IAbstractFolder
Parameters:
name - the name of the folder.

getParentFolder

public IAbstractFolder getParentFolder()
Description copied from interface: IAbstractResource
Returns the parent folder or null if there is no parent.

Specified by:
getParentFolder in interface IAbstractResource

getOsLocation

public java.lang.String getOsLocation()
Description copied from interface: IAbstractResource
Returns the OS path of the folder location.

Specified by:
getOsLocation in interface IAbstractResource

exists

public boolean exists()
Description copied from interface: IAbstractResource
Returns whether the resource actually exists.

Specified by:
exists in interface IAbstractResource
Overrides:
exists in class java.io.File

list

public java.lang.String[] list(IAbstractFolder.FilenameFilter filter)
Description copied from interface: IAbstractFolder
Returns a list of all existing file and directory members in this folder that satisfy the specified filter.

Specified by:
list in interface IAbstractFolder
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.