Class AbstractArchiveFileTreeElement

java.lang.Object
org.gradle.api.internal.file.AbstractFileTreeElement
io.freefair.gradle.plugins.compress.tree.AbstractArchiveFileTreeElement
All Implemented Interfaces:
FileTreeElement, FileVisitDetails
Direct Known Subclasses:
ArFileTree.ArArchiveEntryFileTreeElement, ArjFileTree.ArjArchiveEntryFileTreeElement, DumpFileTree.DumpArchiveEntryFileTreeElement, SevenZipFileTree.SevenZArchiveEntryFileTreeElement

public abstract class AbstractArchiveFileTreeElement extends org.gradle.api.internal.file.AbstractFileTreeElement implements FileVisitDetails
An implementation of FileTreeElement meant for use with archive files when subclassing AbstractFileTree.

This implementation extracts the files from the archive to the supplied expansion directory.

See Also:
  • AbstractArchiveFileTreeElement
  • Constructor Details

    • AbstractArchiveFileTreeElement

      protected AbstractArchiveFileTreeElement(org.gradle.internal.file.Chmod chmod, File expandedDir, AtomicBoolean stopFlag)
      Creates a new instance.
      Parameters:
      chmod - the chmod instance to use
      expandedDir - the directory to extract the archived file to
      stopFlag - the stop flag to use
  • Method Details

    • getArchiveEntry

      protected abstract ArchiveEntry getArchiveEntry()
      Returns the archive entry for this element.
      Returns:
      the archive entry
    • safeEntryName

      protected String safeEntryName()
      Returns a safe name for the name of a file contained in the archive.
      See Also:
      • PathTraversalChecker.safePathName(String)
    • getEntryName

      protected abstract String getEntryName()
      Returns unsafe name for the name of a file contained in the archive.
      See Also:
      • AbstractArchiveFileTreeElement.safeEntryName()
    • getFile

      public File getFile()
      Specified by:
      getFile in interface FileTreeElement
    • getRelativePath

      public RelativePath getRelativePath()
      Specified by:
      getRelativePath in interface FileTreeElement
    • getLastModified

      public long getLastModified()
      Specified by:
      getLastModified in interface FileTreeElement
    • isDirectory

      public boolean isDirectory()
      Specified by:
      isDirectory in interface FileTreeElement
    • getSize

      public long getSize()
      Specified by:
      getSize in interface FileTreeElement
    • stopVisiting

      public void stopVisiting()
      Specified by:
      stopVisiting in interface FileVisitDetails