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 ofFileTreeElementmeant for use with archive files when subclassingAbstractFileTree.This implementation extracts the files from the archive to the supplied expansion directory.
- See Also:
AbstractArchiveFileTreeElement
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedAbstractArchiveFileTreeElement(org.gradle.internal.file.Chmod chmod, java.io.File expandedDir, java.util.concurrent.atomic.AtomicBoolean stopFlag)Creates a new instance.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract org.apache.commons.compress.archivers.ArchiveEntrygetArchiveEntry()Returns the archive entry for this element.protected abstract java.lang.StringgetEntryName()Returns unsafe name for the name of a file contained in the archive.java.io.FilegetFile()longgetLastModified()RelativePathgetRelativePath()longgetSize()booleanisDirectory()protected java.lang.StringsafeEntryName()Returns a safe name for the name of a file contained in the archive.voidstopVisiting()-
Methods inherited from class org.gradle.api.internal.file.AbstractFileTreeElement
copyTo, copyTo, getChmod, getDisplayName, getMode, getName, getPath, getPermissions, toString
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.gradle.api.file.FileTreeElement
copyTo, copyTo, getMode, getName, getPath, getPermissions, open
-
-
-
-
Constructor Detail
-
AbstractArchiveFileTreeElement
protected AbstractArchiveFileTreeElement(org.gradle.internal.file.Chmod chmod, java.io.File expandedDir, java.util.concurrent.atomic.AtomicBoolean stopFlag)Creates a new instance.- Parameters:
chmod- the chmod instance to useexpandedDir- the directory to extract the archived file tostopFlag- the stop flag to use
-
-
Method Detail
-
getArchiveEntry
protected abstract org.apache.commons.compress.archivers.ArchiveEntry getArchiveEntry()
Returns the archive entry for this element.- Returns:
- the archive entry
-
safeEntryName
protected java.lang.String safeEntryName()
Returns a safe name for the name of a file contained in the archive.- See Also:
PathTraversalChecker.safePathName(String)
-
getEntryName
protected abstract java.lang.String getEntryName()
Returns unsafe name for the name of a file contained in the archive.- See Also:
AbstractArchiveFileTreeElement.safeEntryName()
-
getFile
public java.io.File getFile()
- Specified by:
getFilein interfaceFileTreeElement
-
getRelativePath
public RelativePath getRelativePath()
- Specified by:
getRelativePathin interfaceFileTreeElement
-
getLastModified
public long getLastModified()
- Specified by:
getLastModifiedin interfaceFileTreeElement
-
isDirectory
public boolean isDirectory()
- Specified by:
isDirectoryin interfaceFileTreeElement
-
getSize
public long getSize()
- Specified by:
getSizein interfaceFileTreeElement
-
stopVisiting
public void stopVisiting()
- Specified by:
stopVisitingin interfaceFileVisitDetails
-
-