Class ZipFile

java.lang.Object
spoon.support.compiler.ZipFile
All Implemented Interfaces:
SpoonFile, SpoonResource

public class ZipFile extends Object implements SpoonFile
  • Constructor Details

    • ZipFile

      @Deprecated public ZipFile(ZipFolder parent, String name, byte[] content)
      Creates a new zip file. Should never be called manually.
      Parameters:
      parent - the parent folder
      name - the name of the file
      content - the content of the file
    • ZipFile

      public ZipFile(ZipFolder parent, String name, Path tempFile)
      Creates a new zip file. Should never be called manually.
      Parameters:
      parent - the parent folder
      name - the name of the file
      tempFile - the temporary file it was cached to
  • Method Details

    • getContent

      public InputStream getContent()
      Description copied from interface: SpoonFile
      Gets the file content as a stream.
      Specified by:
      getContent in interface SpoonFile
    • getName

      public String getName()
      Description copied from interface: SpoonResource
      Gets the name of this resource.
      Specified by:
      getName in interface SpoonResource
    • getParent

      public SpoonFolder getParent()
      Description copied from interface: SpoonResource
      Gets the folder that contains this resource.
      Specified by:
      getParent in interface SpoonResource
    • getFileSystemParent

      public File getFileSystemParent()
      Description copied from interface: SpoonResource
      Gets the parent of this resource on the file system.
      Specified by:
      getFileSystemParent in interface SpoonResource
    • isFile

      public boolean isFile()
      Description copied from interface: SpoonResource
      Tells if this resource is a file.
      Specified by:
      isFile in interface SpoonResource
    • isJava

      public boolean isJava()
      Description copied from interface: SpoonFile
      True if a Java source code file.
      Specified by:
      isJava in interface SpoonFile
    • getPath

      public String getPath()
      Description copied from interface: SpoonResource
      Gets this resource path.
      Specified by:
      getPath in interface SpoonResource
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • isArchive

      public boolean isArchive()
      Description copied from interface: SpoonResource
      Tells if this resource is an archive.
      Specified by:
      isArchive in interface SpoonResource
    • toFile

      public File toFile()
      Description copied from interface: SpoonResource
      Gets the corresponding file if possible (returns null if this resource does not correspond to any file on the filesystem).
      Specified by:
      toFile in interface SpoonResource
    • isActualFile

      public boolean isActualFile()
      Description copied from interface: SpoonFile
      Tells if this file is an actual file (not a virtual file that holds in-memory contents).
      Specified by:
      isActualFile in interface SpoonFile
      Returns:
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object