Class GridFile

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Comparable<java.io.File>

    public class GridFile
    extends java.io.File
    Subclass of File to iterate through directories and files in a grid
    Author:
    Bela Ban
    See Also:
    Serialized Form
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      static class  GridFile.Metadata  
    • Field Summary

      • Fields inherited from class java.io.File

        pathSeparator, pathSeparatorChar, separator, separatorChar
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected java.lang.String[] _list​(java.lang.Object filter)  
      protected java.io.File[] _listFiles​(java.lang.Object filter)  
      protected boolean checkParentDirs​(java.lang.String path, boolean create_if_absent)
      Checks whether the parent directories are present (and are directories).
      boolean createNewFile()  
      boolean delete()  
      boolean delete​(boolean synchronous)  
      boolean exists()  
      protected static java.lang.String filename​(java.lang.String full_path)  
      int getChunkSize()  
      java.lang.String getName()  
      java.lang.String getPath()  
      protected void initMetadata()  
      protected static boolean isChildOf​(java.lang.String parent, java.lang.String child)
      Verifies whether child is a child (dir or file) of parent
      boolean isDirectory()  
      boolean isFile()  
      long length()  
      java.lang.String[] list()  
      java.lang.String[] list​(java.io.FilenameFilter filter)  
      java.io.File[] listFiles()  
      java.io.File[] listFiles​(java.io.FileFilter filter)  
      java.io.File[] listFiles​(java.io.FilenameFilter filter)  
      boolean mkdir()  
      boolean mkdirs()  
      protected static java.lang.String trim​(java.lang.String str)  
      • Methods inherited from class java.io.File

        canExecute, canRead, canWrite, compareTo, createTempFile, createTempFile, deleteOnExit, equals, getAbsoluteFile, getAbsolutePath, getCanonicalFile, getCanonicalPath, getFreeSpace, getParent, getParentFile, getTotalSpace, getUsableSpace, hashCode, isAbsolute, isHidden, lastModified, listRoots, renameTo, setExecutable, setExecutable, setLastModified, setReadable, setReadable, setReadOnly, setWritable, setWritable, toPath, toString, toURI, toURL
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, wait, wait, wait
    • Method Detail

      • getName

        public java.lang.String getName()
        Overrides:
        getName in class java.io.File
      • getPath

        public java.lang.String getPath()
        Overrides:
        getPath in class java.io.File
      • length

        public long length()
        Overrides:
        length in class java.io.File
      • getChunkSize

        public int getChunkSize()
      • createNewFile

        public boolean createNewFile()
                              throws java.io.IOException
        Overrides:
        createNewFile in class java.io.File
        Throws:
        java.io.IOException
      • delete

        public boolean delete()
        Overrides:
        delete in class java.io.File
      • delete

        public boolean delete​(boolean synchronous)
      • mkdir

        public boolean mkdir()
        Overrides:
        mkdir in class java.io.File
      • mkdirs

        public boolean mkdirs()
        Overrides:
        mkdirs in class java.io.File
      • exists

        public boolean exists()
        Overrides:
        exists in class java.io.File
      • list

        public java.lang.String[] list()
        Overrides:
        list in class java.io.File
      • list

        public java.lang.String[] list​(java.io.FilenameFilter filter)
        Overrides:
        list in class java.io.File
      • listFiles

        public java.io.File[] listFiles()
        Overrides:
        listFiles in class java.io.File
      • listFiles

        public java.io.File[] listFiles​(java.io.FilenameFilter filter)
        Overrides:
        listFiles in class java.io.File
      • listFiles

        public java.io.File[] listFiles​(java.io.FileFilter filter)
        Overrides:
        listFiles in class java.io.File
      • isDirectory

        public boolean isDirectory()
        Overrides:
        isDirectory in class java.io.File
      • isFile

        public boolean isFile()
        Overrides:
        isFile in class java.io.File
      • initMetadata

        protected void initMetadata()
      • _listFiles

        protected java.io.File[] _listFiles​(java.lang.Object filter)
      • _list

        protected java.lang.String[] _list​(java.lang.Object filter)
      • isChildOf

        protected static boolean isChildOf​(java.lang.String parent,
                                           java.lang.String child)
        Verifies whether child is a child (dir or file) of parent
        Parameters:
        parent -
        child -
        Returns:
        True if child is a child, false otherwise
      • filename

        protected static java.lang.String filename​(java.lang.String full_path)
      • checkParentDirs

        protected boolean checkParentDirs​(java.lang.String path,
                                          boolean create_if_absent)
                                   throws java.io.IOException
        Checks whether the parent directories are present (and are directories). If create_if_absent is true, creates missing dirs
        Parameters:
        path -
        create_if_absent -
        Returns:
        Throws:
        java.io.IOException
      • trim

        protected static java.lang.String trim​(java.lang.String str)