Package org.eclipse.tycho.plugins.tar
Class TarGzArchiver
- java.lang.Object
-
- org.eclipse.tycho.plugins.tar.TarGzArchiver
-
public class TarGzArchiver extends java.lang.ObjectGzipped Tar archiver which preserves- POSIX file permissions
- Symbolic links (if the link target points inside the archive)
- Last modification timestamp
-
-
Field Summary
Fields Modifier and Type Field Description private java.io.FiledestFileprivate org.apache.maven.plugin.logging.Loglogprivate java.util.List<java.io.File>sourceDirs
-
Constructor Summary
Constructors Constructor Description TarGzArchiver()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddDirectory(java.io.File directory)private voidaddToTarRecursively(java.io.File tarRootDir, java.io.File source, org.apache.commons.compress.archivers.tar.TarArchiveOutputStream tarStream)private static voidcopyFileContentToTarStream(java.io.File source, org.apache.commons.compress.archivers.tar.TarArchiveOutputStream tarStream)voidcreateArchive()private org.apache.commons.compress.archivers.tar.TarArchiveEntrycreateTarEntry(java.io.File tarRootDir, java.io.File source)private java.nio.file.attribute.PosixFileAttributesgetAttributes(java.io.File source)private java.nio.file.PathgetRelativeSymLinkTarget(java.io.File source, java.io.File baseDir)private static booleanisSymbolicLink(java.io.File file)private booleanresolvesBelow(java.io.File source, java.io.File baseDir)voidsetDestFile(java.io.File destFile)voidsetLog(org.apache.maven.plugin.logging.Log log)private static java.lang.Stringslashify(java.nio.file.Path path)private voidvalidate()
-
-
-
Method Detail
-
setLog
public void setLog(org.apache.maven.plugin.logging.Log log)
-
setDestFile
public void setDestFile(java.io.File destFile)
-
addDirectory
public void addDirectory(java.io.File directory)
-
createArchive
public void createArchive() throws java.io.IOException- Throws:
java.io.IOException
-
validate
private void validate() throws java.io.IOException- Throws:
java.io.IOException
-
addToTarRecursively
private void addToTarRecursively(java.io.File tarRootDir, java.io.File source, org.apache.commons.compress.archivers.tar.TarArchiveOutputStream tarStream) throws java.io.IOException- Throws:
java.io.IOException
-
createTarEntry
private org.apache.commons.compress.archivers.tar.TarArchiveEntry createTarEntry(java.io.File tarRootDir, java.io.File source) throws java.io.IOException- Throws:
java.io.IOException
-
slashify
private static java.lang.String slashify(java.nio.file.Path path)
-
getAttributes
private java.nio.file.attribute.PosixFileAttributes getAttributes(java.io.File source)
-
copyFileContentToTarStream
private static void copyFileContentToTarStream(java.io.File source, org.apache.commons.compress.archivers.tar.TarArchiveOutputStream tarStream) throws java.io.IOException- Throws:
java.io.IOException
-
resolvesBelow
private boolean resolvesBelow(java.io.File source, java.io.File baseDir) throws java.io.IOException- Throws:
java.io.IOException
-
getRelativeSymLinkTarget
private java.nio.file.Path getRelativeSymLinkTarget(java.io.File source, java.io.File baseDir) throws java.io.IOException- Throws:
java.io.IOException
-
isSymbolicLink
private static boolean isSymbolicLink(java.io.File file)
-
-