Class PathDirectoryImpl

java.lang.Object
gw.internal.gosu.module.fs.PathResourceImpl
gw.internal.gosu.module.fs.PathDirectoryImpl
All Implemented Interfaces:
IDirectory, IResource, Serializable

public class PathDirectoryImpl extends PathResourceImpl implements IDirectory
See Also:
  • Constructor Details

    • PathDirectoryImpl

      PathDirectoryImpl(Path path)
  • Method Details

    • dir

      public IDirectory dir(String relativePath)
      Specified by:
      dir in interface IDirectory
    • 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 interface IDirectory
      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 interface IDirectory
      Throws:
      IOException
    • listDirs

      public List<? extends IDirectory> listDirs()
      Specified by:
      listDirs in interface IDirectory
    • listFiles

      public List<? extends IFile> listFiles()
      Specified by:
      listFiles in interface IDirectory
    • list

      private <E extends PathResourceImpl> List<E> list(DirectoryStream.Filter<Path> filter, Function<Path,E> creator)
    • relativePath

      public String relativePath(IResource resource)
      Specified by:
      relativePath in interface IDirectory
    • clearCaches

      public void clearCaches()
      Specified by:
      clearCaches in interface IDirectory
    • 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 interface IDirectory
      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 interface IDirectory
      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.
      Specified by:
      exists in interface IResource
      Returns:
      true if the resource exists