Package gw.internal.gosu.module.fs
Class JavaDirectoryImpl
- java.lang.Object
-
- gw.internal.gosu.module.fs.JavaResourceImpl
-
- gw.internal.gosu.module.fs.JavaDirectoryImpl
-
- All Implemented Interfaces:
IDirectory,IResource,java.io.Serializable
public class JavaDirectoryImpl extends JavaResourceImpl implements IDirectory
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private classJavaDirectoryImpl.CachingFileRetrievalStrategyprivate static interfaceJavaDirectoryImpl.FileRetrievalStrategyprivate classJavaDirectoryImpl.FullyCachedFileRetrievalStrategyprivate classJavaDirectoryImpl.FuzzyTimestampCachingFileRetrievalStrategyprivate classJavaDirectoryImpl.TimestampBasedCachingFileRetrievalStrategyprivate classJavaDirectoryImpl.UncachedFileRetrievalStrategy
-
Field Summary
Fields Modifier and Type Field Description private JavaDirectoryImpl.FileRetrievalStrategy_fileRetrievalStrategy-
Fields inherited from class gw.internal.gosu.module.fs.JavaResourceImpl
_file
-
-
Constructor Summary
Constructors Constructor Description JavaDirectoryImpl(java.io.File file, IFileSystem.CachingMode cachingMode)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclearCaches()IDirectorydir(java.lang.String relativePath)booleanexists()Indicates whether this resource exists.IFilefile(java.lang.String path)Constucts a file given the path.booleanhasChildFile(java.lang.String path)Returns true if the given path represents a child of this directory that exists.booleanisAdditional()java.util.List<? extends IDirectory>listDirs()java.util.List<? extends IFile>listFiles()booleanmkdir()java.lang.StringrelativePath(IResource resource)voidsetCachingMode(IFileSystem.CachingMode cachingMode)-
Methods inherited from class gw.internal.gosu.module.fs.JavaResourceImpl
create, delete, equals, 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
-
-
-
-
Field Detail
-
_fileRetrievalStrategy
private JavaDirectoryImpl.FileRetrievalStrategy _fileRetrievalStrategy
-
-
Constructor Detail
-
JavaDirectoryImpl
public JavaDirectoryImpl(java.io.File file, IFileSystem.CachingMode cachingMode)
-
-
Method Detail
-
setCachingMode
public void setCachingMode(IFileSystem.CachingMode cachingMode)
-
clearCaches
public void clearCaches()
- Specified by:
clearCachesin interfaceIDirectory
-
dir
public IDirectory dir(java.lang.String relativePath)
- Specified by:
dirin interfaceIDirectory
-
file
public IFile file(java.lang.String path)
Description copied from interface:IDirectoryConstucts a file given the path. If the path is relative path, it will be constructed based on the current directory- Specified by:
filein interfaceIDirectory- Parameters:
path- the path of the file- Returns:
- The file that is under the directory with the name
-
mkdir
public boolean mkdir()
- Specified by:
mkdirin interfaceIDirectory
-
listDirs
public java.util.List<? extends IDirectory> listDirs()
- Specified by:
listDirsin interfaceIDirectory
-
listFiles
public java.util.List<? extends IFile> listFiles()
- Specified by:
listFilesin interfaceIDirectory
-
relativePath
public java.lang.String relativePath(IResource resource)
- Specified by:
relativePathin interfaceIDirectory
-
exists
public boolean exists()
Description copied from interface:IResourceIndicates whether this resource exists.
-
hasChildFile
public boolean hasChildFile(java.lang.String path)
Description copied from interface:IDirectoryReturns 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:
hasChildFilein 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:
isAdditionalin interfaceIDirectory- Returns:
- true if this is an "additional" path for resources not copied to the target classpath e.g., config bullshit.
-
-