Package org.owasp.dependencycheck.utils
Class ExtractionUtil
- java.lang.Object
- 
- org.owasp.dependencycheck.utils.ExtractionUtil
 
- 
 @ThreadSafe public final class ExtractionUtil extends java.lang.ObjectSet of utilities to extract files from archives.- Author:
- Jeremy Long
 
- 
- 
Method SummaryAll Methods Static Methods Concrete Methods Modifier and Type Method Description static voidextractFiles(java.io.File archive, java.io.File extractTo)Extracts the contents of an archive into the specified directory.static voidextractFiles(java.io.File archive, java.io.File extractTo, Engine engine)Extracts the contents of an archive into the specified directory.static voidextractFiles(java.io.InputStream archive, java.io.File extractTo)Extracts the contents of an archive into the specified directory.static voidextractFilesUsingFilter(java.io.File archive, java.io.File destination, java.io.FilenameFilter filter)Extracts the contents of an archive into the specified directory.static voidextractGzip(java.io.File file)Extracts the file contained in a gzip archive.static voidextractZip(java.io.File file)Extracts the file contained in a Zip archive.
 
- 
- 
- 
Method Detail- 
extractFilespublic static void extractFiles(java.io.File archive, java.io.File extractTo) throws ExtractionExceptionExtracts the contents of an archive into the specified directory.- Parameters:
- archive- an archive file such as a WAR or EAR
- extractTo- a directory to extract the contents to
- Throws:
- ExtractionException- thrown if an exception occurs while extracting the files
 
 - 
extractFilespublic static void extractFiles(java.io.File archive, java.io.File extractTo, Engine engine) throws ExtractionExceptionExtracts the contents of an archive into the specified directory. The files are only extracted if they are supported by the analyzers loaded into the specified engine. If the engine is specified as null then all files are extracted.- Parameters:
- archive- an archive file such as a WAR or EAR
- extractTo- a directory to extract the contents to
- engine- the scanning engine
- Throws:
- ExtractionException- thrown if there is an error extracting the files
 
 - 
extractFilespublic static void extractFiles(java.io.InputStream archive, java.io.File extractTo) throws ExtractionExceptionExtracts the contents of an archive into the specified directory. The files are only extracted if they are supported by the analyzers loaded into the specified engine. If the engine is specified as null then all files are extracted.- Parameters:
- archive- an archive file such as a WAR or EAR
- extractTo- a directory to extract the contents to
- Throws:
- ExtractionException- thrown if there is an error extracting the files
 
 - 
extractFilesUsingFilterpublic static void extractFilesUsingFilter(java.io.File archive, java.io.File destination, java.io.FilenameFilter filter) throws ExtractionExceptionExtracts the contents of an archive into the specified directory.- Parameters:
- archive- an archive file such as a WAR or EAR
- destination- a directory to extract the contents to
- filter- determines which files get extracted
- Throws:
- ExtractionException- thrown if the archive is not found
 
 - 
extractGzippublic static void extractGzip(java.io.File file) throws java.io.FileNotFoundException, java.io.IOExceptionExtracts the file contained in a gzip archive. The extracted file is placed in the exact same path as the file specified.- Parameters:
- file- the archive file
- Throws:
- java.io.FileNotFoundException- thrown if the file does not exist
- java.io.IOException- thrown if there is an error extracting the file.
 
 - 
extractZippublic static void extractZip(java.io.File file) throws java.io.FileNotFoundException, java.io.IOExceptionExtracts the file contained in a Zip archive. The extracted file is placed in the exact same path as the file specified.- Parameters:
- file- the archive file
- Throws:
- java.io.FileNotFoundException- thrown if the file does not exist
- java.io.IOException- thrown if there is an error extracting the file.
 
 
- 
 
-