Package gw.fs.physical
Class PhysicalDirectoryImpl
- java.lang.Object
-
- gw.fs.physical.PhysicalResourceImpl
-
- gw.fs.physical.PhysicalDirectoryImpl
-
- All Implemented Interfaces:
IDirectory
,IResource
public class PhysicalDirectoryImpl extends PhysicalResourceImpl implements IDirectory
-
-
Field Summary
-
Fields inherited from class gw.fs.physical.PhysicalResourceImpl
_backingFileSystem, _path
-
-
Constructor Summary
Constructors Constructor Description PhysicalDirectoryImpl(ResourcePath path, IPhysicalFileSystem backingFileSystem)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
clearCaches()
IDirectory
dir(String relativePath)
IFile
file(String path)
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
isAdditional()
List<? extends IDirectory>
listDirs()
List<? extends IFile>
listFiles()
boolean
mkdir()
String
relativePath(IResource resource)
-
Methods inherited from class gw.fs.physical.PhysicalResourceImpl
create, delete, equals, exists, getIFileMetadata, getName, getParent, getPath, isChildOf, isDescendantOf, isInJar, isJavaFile, toJavaFile, toString, toURI
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface gw.fs.IResource
create, delete, exists, getName, getParent, getPath, isChildOf, isDescendantOf, isInJar, isJavaFile, toJavaFile, toURI
-
-
-
-
Constructor Detail
-
PhysicalDirectoryImpl
public PhysicalDirectoryImpl(ResourcePath path, IPhysicalFileSystem backingFileSystem)
-
-
Method Detail
-
clearCaches
public void clearCaches()
- Specified by:
clearCaches
in interfaceIDirectory
-
dir
public IDirectory dir(String relativePath)
- Specified by:
dir
in interfaceIDirectory
-
file
public IFile file(String path)
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
public boolean mkdir() throws IOException
- Specified by:
mkdir
in interfaceIDirectory
- Throws:
IOException
-
listDirs
public List<? extends IDirectory> listDirs()
- Specified by:
listDirs
in interfaceIDirectory
-
listFiles
public List<? extends IFile> listFiles()
- Specified by:
listFiles
in interfaceIDirectory
-
relativePath
public String relativePath(IResource resource)
- Specified by:
relativePath
in interfaceIDirectory
-
hasChildFile
public boolean hasChildFile(String path)
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.
-
-