Package gw.fs
Class DelegateDirectory
java.lang.Object
gw.fs.DelegateDirectory
- All Implemented Interfaces:
IDirectory
,IResource
- Direct Known Subclasses:
AdditionalDirectory
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
boolean
create()
boolean
delete()
boolean
exists()
Indicates whether this resource exists.Constucts a file given the path.getName()
Gets this file's or directory's name.Gets this file's our directory's parent directory.getPath()
boolean
hasChildFile
(String path) Returns true if the given path represents a child of this directory that exists.boolean
isChildOf
(IDirectory dir) Indicates whether this resource is a direct child of the given directory.boolean
isDescendantOf
(IDirectory dir) Indicates whether this resource is a descendant of the given directory.boolean
isInJar()
boolean
List<? extends IDirectory>
listDirs()
boolean
mkdir()
relativePath
(IResource resource) toURI()
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface gw.fs.IDirectory
isAdditional
-
Field Details
-
_delegate
-
-
Constructor Details
-
DelegateDirectory
-
-
Method Details
-
getDelegate
-
dir
- Specified by:
dir
in interfaceIDirectory
-
file
Description copied from interface:IDirectory
Constucts a file given the path. If the path is relative path, it will be constructed based on the current directory- Specified by:
file
in interfaceIDirectory
- Parameters:
path
- the path of the file- Returns:
- The file that is under the directory with the name
-
mkdir
- Specified by:
mkdir
in interfaceIDirectory
- Throws:
IOException
-
listDirs
- Specified by:
listDirs
in interfaceIDirectory
-
listFiles
- Specified by:
listFiles
in interfaceIDirectory
-
relativePath
- Specified by:
relativePath
in interfaceIDirectory
-
clearCaches
public void clearCaches()- Specified by:
clearCaches
in interfaceIDirectory
-
getParent
Description copied from interface:IResource
Gets this file's our directory's parent directory. -
getName
Description copied from interface:IResource
Gets this file's or directory's name. -
exists
public boolean exists()Description copied from interface:IResource
Indicates whether this resource exists. -
delete
- Specified by:
delete
in interfaceIResource
- Throws:
IOException
-
toURI
-
getPath
-
isChildOf
Description copied from interface:IResource
Indicates whether this resource is a direct child of the given directory. -
isDescendantOf
Description copied from interface:IResource
Indicates whether this resource is a descendant of the given directory.- Specified by:
isDescendantOf
in interfaceIResource
- Parameters:
dir
- the directory which would be the ancestor- Returns:
- true if this is a descendant of the given directory
-
toJavaFile
- Specified by:
toJavaFile
in interfaceIResource
-
isJavaFile
public boolean isJavaFile()- Specified by:
isJavaFile
in interfaceIResource
-
isInJar
public boolean isInJar() -
create
public boolean create() -
hasChildFile
Description copied from interface:IDirectory
Returns true if the given path represents a child of this directory that exists. It's essentially equivalent to calling file(path).exists(), but in cases where this directory caches its list of children and the path represents a direct child of this directory, this method can be optimized to avoid file system access by looking in the list of cached children.- Specified by:
hasChildFile
in interfaceIDirectory
- Parameters:
path
- the path of the file- Returns:
- true if the path represents a file that exists as a child of this directory
-