Package gw.internal.gosu.module.fs
Class PathDirectoryImpl
java.lang.Object
gw.internal.gosu.module.fs.PathResourceImpl
gw.internal.gosu.module.fs.PathDirectoryImpl
- All Implemented Interfaces:
IDirectory
,IResource
,Serializable
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
boolean
exists()
Indicates whether this resource exists.Constucts a file given the path.boolean
hasChildFile
(String path) Returns true if the given path represents a child of this directory that exists.boolean
private <E extends PathResourceImpl>
List<E>list
(DirectoryStream.Filter<Path> filter, Function<Path, E> creator) List<? extends IDirectory>
listDirs()
boolean
mkdir()
relativePath
(IResource resource) Methods inherited from class gw.internal.gosu.module.fs.PathResourceImpl
create, delete, equals, get_Path, getName, getParent, getPath, hashCode, isChildOf, isDescendantOf, isInJar, isJavaFile, toJavaFile, toString, toURI
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface gw.fs.IResource
create, delete, getName, getParent, getPath, isChildOf, isDescendantOf, isInJar, isJavaFile, toJavaFile, toURI
-
Constructor Details
-
PathDirectoryImpl
PathDirectoryImpl(Path path)
-
-
Method Details
-
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
-
list
private <E extends PathResourceImpl> List<E> list(DirectoryStream.Filter<Path> filter, Function<Path, E> creator) -
relativePath
- Specified by:
relativePath
in interfaceIDirectory
-
clearCaches
public void clearCaches()- Specified by:
clearCaches
in interfaceIDirectory
-
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
-
isAdditional
public boolean isAdditional()- Specified by:
isAdditional
in interfaceIDirectory
- Returns:
- true if this is an "additional" path for resources not copied to the target classpath e.g., config bullshit.
-
exists
public boolean exists()Description copied from interface:IResource
Indicates whether this resource exists.
-