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 ofFileTreeElement
meant 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 protected
AbstractArchiveFileTreeElement(org.gradle.internal.file.Chmod chmod, File expandedDir, AtomicBoolean stopFlag)
Creates a new instance.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract ArchiveEntry
getArchiveEntry()
Returns the archive entry for this element.protected abstract String
getEntryName()
Returns unsafe name for the name of a file contained in the archive.File
getFile()
long
getLastModified()
RelativePath
getRelativePath()
long
getSize()
boolean
isDirectory()
protected String
safeEntryName()
Returns a safe name for the name of a file contained in the archive.void
stopVisiting()
-
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, File expandedDir, 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 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 interfaceFileTreeElement
-
getRelativePath
public RelativePath getRelativePath()
- Specified by:
getRelativePath
in interfaceFileTreeElement
-
getLastModified
public long getLastModified()
- Specified by:
getLastModified
in interfaceFileTreeElement
-
isDirectory
public boolean isDirectory()
- Specified by:
isDirectory
in interfaceFileTreeElement
-
getSize
public long getSize()
- Specified by:
getSize
in interfaceFileTreeElement
-
stopVisiting
public void stopVisiting()
- Specified by:
stopVisiting
in interfaceFileVisitDetails
-
-