Class AbstractUnArchiver

    • Field Summary

      • Fields inherited from interface org.codehaus.plexus.archiver.UnArchiver

        ROLE
    • Method Summary

      All Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      void addArchiveFinalizer​(ArchiveFinalizer finalizer)  
      protected abstract void execute()  
      protected abstract void execute​(java.lang.String path, java.io.File outputDirectory)  
      void extract()
      Extract the archive.
      void extract​(java.lang.String path, java.io.File outputDirectory)
      Take a path into the archive and extract it to the specified directory.
      protected void extractFile​(java.io.File srcF, java.io.File dir, java.io.InputStream compressedInputStream, java.lang.String entryName, java.util.Date entryDate, boolean isDirectory, java.lang.Integer mode, java.lang.String symlinkDestination, org.codehaus.plexus.components.io.filemappers.FileMapper[] fileMappers)  
      java.io.File getDestDirectory()  
      java.io.File getDestFile()  
      org.codehaus.plexus.components.io.filemappers.FileMapper[] getFileMappers()
      Get chain of components which rewrite the target path of each unpacked file.
      org.codehaus.plexus.components.io.fileselectors.FileSelector[] getFileSelectors()
      Returns a set of FileSelector instances, which may be used to select the files to extract from the archive.
      java.io.File getSourceFile()  
      boolean isIgnorePermissions()  
      boolean isOverwrite()
      Gets a flag indicating destination files are always overwritten.
      protected boolean isSelected​(java.lang.String fileName, org.codehaus.plexus.components.io.resources.PlexusIoResource fileInfo)  
      boolean isUseJvmChmod()  
      void setArchiveFinalizers​(java.util.List archiveFinalizers)  
      void setDestDirectory​(java.io.File destDirectory)  
      void setDestFile​(java.io.File destFile)  
      void setFileMappers​(org.codehaus.plexus.components.io.filemappers.FileMapper[] fileMappers)
      Sets chain of components to be used for rewriting target path of each unpacked file.
      void setFileSelectors​(org.codehaus.plexus.components.io.fileselectors.FileSelector[] fileSelectors)
      Sets a set of FileSelector instances, which may be used to select the files to extract from the archive.
      void setIgnorePermissions​(boolean ignorePermissions)  
      void setOverwrite​(boolean b)
      Should we overwrite files in dest, even if they are newer than the corresponding entries in the archive?
      void setSourceFile​(java.io.File sourceFile)  
      void setUseJvmChmod​(boolean useJvmChmod)
      jvm chmod won't set group level permissions !
      protected void validate()  
      protected void validate​(java.lang.String path, java.io.File outputDirectory)  
      • Methods inherited from class org.codehaus.plexus.logging.AbstractLogEnabled

        enableLogging, getLogger, setupLogger, setupLogger, setupLogger
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • AbstractUnArchiver

        public AbstractUnArchiver()
      • AbstractUnArchiver

        public AbstractUnArchiver​(java.io.File sourceFile)
    • Method Detail

      • setDestDirectory

        public void setDestDirectory​(java.io.File destDirectory)
        Specified by:
        setDestDirectory in interface UnArchiver
      • setDestFile

        public void setDestFile​(java.io.File destFile)
        Specified by:
        setDestFile in interface UnArchiver
      • setSourceFile

        public void setSourceFile​(java.io.File sourceFile)
        Specified by:
        setSourceFile in interface UnArchiver
      • isOverwrite

        public boolean isOverwrite()
        Description copied from interface: UnArchiver
        Gets a flag indicating destination files are always overwritten.
        Specified by:
        isOverwrite in interface UnArchiver
        Returns:
        true, if destination files are overwritten, even if they are newer than the corresponding entry in the archive.
      • setOverwrite

        public void setOverwrite​(boolean b)
        Description copied from interface: UnArchiver
        Should we overwrite files in dest, even if they are newer than the corresponding entries in the archive?
        Specified by:
        setOverwrite in interface UnArchiver
      • getFileMappers

        public org.codehaus.plexus.components.io.filemappers.FileMapper[] getFileMappers()
        Description copied from interface: UnArchiver
        Get chain of components which rewrite the target path of each unpacked file.
        Specified by:
        getFileMappers in interface UnArchiver
        Returns:
        FileMappers to be used for rewriting each target path, or null if no rewriting shall happen.
      • setFileMappers

        public void setFileMappers​(org.codehaus.plexus.components.io.filemappers.FileMapper[] fileMappers)
        Description copied from interface: UnArchiver
        Sets chain of components to be used for rewriting target path of each unpacked file.
        Specified by:
        setFileMappers in interface UnArchiver
        Parameters:
        fileMappers - FileMapper to be used for rewriting each target path, or null if no rewriting shall happen.
      • extract

        public final void extract​(java.lang.String path,
                                  java.io.File outputDirectory)
                           throws ArchiverException
        Description copied from interface: UnArchiver
        Take a path into the archive and extract it to the specified directory.
        Specified by:
        extract in interface UnArchiver
        Parameters:
        path - Path inside the archive to be extracted.
        outputDirectory - Directory to extract to.
        Throws:
        ArchiverException
      • validate

        protected void validate​(java.lang.String path,
                                java.io.File outputDirectory)
      • setFileSelectors

        public void setFileSelectors​(org.codehaus.plexus.components.io.fileselectors.FileSelector[] fileSelectors)
        Description copied from interface: UnArchiver
        Sets a set of FileSelector instances, which may be used to select the files to extract from the archive. If file selectors are present, then a file is only extracted, if it is confirmed by all file selectors.
        Specified by:
        setFileSelectors in interface UnArchiver
      • getFileSelectors

        public org.codehaus.plexus.components.io.fileselectors.FileSelector[] getFileSelectors()
        Description copied from interface: UnArchiver
        Returns a set of FileSelector instances, which may be used to select the files to extract from the archive. If file selectors are present, then a file is only extracted, if it is confirmed by all file selectors.
        Specified by:
        getFileSelectors in interface UnArchiver
      • isSelected

        protected boolean isSelected​(java.lang.String fileName,
                                     org.codehaus.plexus.components.io.resources.PlexusIoResource fileInfo)
                              throws ArchiverException
        Throws:
        ArchiverException
      • isUseJvmChmod

        public boolean isUseJvmChmod()
        Specified by:
        isUseJvmChmod in interface UnArchiver
        Returns:
        Since:
        1.1
      • setUseJvmChmod

        public void setUseJvmChmod​(boolean useJvmChmod)
        jvm chmod won't set group level permissions !
        Specified by:
        setUseJvmChmod in interface UnArchiver
        Since:
        1.1
      • setIgnorePermissions

        public void setIgnorePermissions​(boolean ignorePermissions)
        Specified by:
        setIgnorePermissions in interface UnArchiver
        Since:
        1.1
      • extractFile

        protected void extractFile​(java.io.File srcF,
                                   java.io.File dir,
                                   java.io.InputStream compressedInputStream,
                                   java.lang.String entryName,
                                   java.util.Date entryDate,
                                   boolean isDirectory,
                                   java.lang.Integer mode,
                                   java.lang.String symlinkDestination,
                                   org.codehaus.plexus.components.io.filemappers.FileMapper[] fileMappers)
                            throws java.io.IOException,
                                   ArchiverException
        Throws:
        java.io.IOException
        ArchiverException