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 Summary
ModifierConstructorDescriptionprotected
AbstractArchiveFileTreeElement
(org.gradle.internal.file.Chmod chmod, File expandedDir, AtomicBoolean stopFlag) Creates a new instance. -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract ArchiveEntry
Returns the archive entry for this element.protected abstract String
Returns unsafe name for the name of a file contained in the archive.getFile()
long
long
getSize()
boolean
protected String
Returns a safe name for the name of a file contained in the archive.void
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 Details
-
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 Details
-
getArchiveEntry
Returns the archive entry for this element.- Returns:
- the archive entry
-
safeEntryName
Returns a safe name for the name of a file contained in the archive.- See Also:
-
PathTraversalChecker.safePathName(String)
-
getEntryName
Returns unsafe name for the name of a file contained in the archive.- See Also:
-
AbstractArchiveFileTreeElement.safeEntryName()
-
getFile
- Specified by:
getFile
in interfaceFileTreeElement
-
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
-