Package globus.glmap

Class GLMapFileStorage


public class GLMapFileStorage extends GLMapStorage
The GLMapFileStorage class provides an implementation of GLMapStorage that uses the file system for storage.
  • Field Details

    • file

      @NonNull public final File file
      The file used for storage.
  • Constructor Details

    • GLMapFileStorage

      public GLMapFileStorage(@NonNull File file)
      Constructs a GLMapFileStorage object for the specified file.
      Parameters:
      file - the file to be used for storage
  • Method Details

    • equals

      public boolean equals(@Nullable Object obj)
      Overrides:
      equals in class Object
    • getParent

      public GLMapStorage getParent()
      Description copied from class: GLMapStorage
      Gets name of storage
      Specified by:
      getParent in class GLMapStorage
      Returns:
      name of storage
    • getPath

      @Nullable public String getPath()
      Description copied from class: GLMapStorage
      Gets the full path of this storage.
      Specified by:
      getPath in class GLMapStorage
      Returns:
      the full path of this storage
    • getName

      public String getName()
      Description copied from class: GLMapStorage
      Gets name of storage
      Specified by:
      getName in class GLMapStorage
      Returns:
      name of storage
    • listFiles

      @Nullable public GLMapStorageFile[] listFiles()
      Description copied from class: GLMapStorage
      List files in storage
      Specified by:
      listFiles in class GLMapStorage
      Returns:
      files in storage
    • findFile

      @Nullable public GLMapStorageFile findFile(String name, boolean create)
      Description copied from class: GLMapStorage
      Searches file with given name
      Specified by:
      findFile in class GLMapStorage
      Parameters:
      name - name of file
      create - create if missing
      Returns:
      file object or null if failed
    • findStorage

      @Nullable public GLMapStorage findStorage(String name, boolean create)
      Description copied from class: GLMapStorage
      Opens new storage inside this storage (folder)
      Specified by:
      findStorage in class GLMapStorage
      Parameters:
      name - name of storage
      create - create if missing
      Returns:
      new storage
    • getFreeSpace

      public Long getFreeSpace()
      Description copied from class: GLMapStorage
      Returns free space in storage
      Specified by:
      getFreeSpace in class GLMapStorage
      Returns:
      free space in storage or -1 if storage is unavailable.