Package arc.files

Class ZipFi


public class ZipFi extends Fi
A FileHandle meant for easily representing and reading the contents of a zip/jar file.
  • Constructor Details

    • ZipFi

      public ZipFi(Fi zipFileLoc)
  • Method Details

    • delete

      public boolean delete()
      Description copied from class: Fi
      Deletes this file or empty directory and returns success. Will not delete a directory that has children.
      Overrides:
      delete in class Fi
    • exists

      public boolean exists()
      Description copied from class: Fi
      Returns true if the file exists. On Android, a Files.classpath(java.lang.String) or Files.internal(java.lang.String) handle to a directory will always return false. Note that this can be very slow for internal files on Android!
      Overrides:
      exists in class Fi
    • child

      public Fi child(String name)
      Description copied from class: Fi
      Returns a handle to the child with the specified name.
      Overrides:
      child in class Fi
    • name

      public String name()
      Overrides:
      name in class Fi
      Returns:
      the name of the file, without any parent paths.
    • path

      public String path()
      Overrides:
      path in class Fi
      Returns:
      the path of the file as specified on construction. Backward slashes will be replaced by forward slashes.
    • parent

      public Fi parent()
      Overrides:
      parent in class Fi
    • list

      public Fi[] list()
      Description copied from class: Fi
      Returns the paths to the children of this directory. Returns an empty list if this file handle represents a file and not a directory. On the desktop, an Files.internal(java.lang.String) handle to a directory on the classpath will return a zero length array.
      Overrides:
      list in class Fi
    • isDirectory

      public boolean isDirectory()
      Description copied from class: Fi
      Returns true if this file is a directory. Always returns false for classpath files. On Android, an Files.internal(java.lang.String) handle to an empty directory will return false. On the desktop, an Files.internal(java.lang.String) handle to a directory on the classpath will return false.
      Overrides:
      isDirectory in class Fi
    • read

      public InputStream read()
      Description copied from class: Fi
      Returns a stream for reading this file as bytes.
      Overrides:
      read in class Fi
    • length

      public long length()
      Description copied from class: Fi
      Returns the length in bytes of this file, or 0 if this file is a directory, does not exist, or the size cannot otherwise be determined.
      Overrides:
      length in class Fi
    • toString

      public String toString()
      Overrides:
      toString in class Fi