Package rawDeepLearningClassifier
Class DLZipUtils
java.lang.Object
rawDeepLearningClassifier.DLZipUtils
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic FileextractFile(String zipPackage, String fileToBeExtracted, String outFolder) Extract a single file from a zip folder.static FileextractFile(URI zipPackage, String fileToBeExtracted, String outFolder) Extract a single file from a zip folder.static StringgetZipFilePath(File zipFileIn, String filePattern) Find the first file within a zip folder that matches a pattern.static StringgetZipFilePath(URI zipUri, String filePattern) Find the first file within a zip folder that matches a pattern.
-
Constructor Details
-
DLZipUtils
public DLZipUtils()
-
-
Method Details
-
getZipFilePath
public static String getZipFilePath(URI zipUri, String filePattern) throws ZipException, IOException Find the first file within a zip folder that matches a pattern. This peaks into the zip file instead of decompressing it.- Parameters:
zipUri- - uri to the zip filefilePattern- - the file pattern to match - the file must contain this string.- Returns:
- null if no file found and the file pqth if the file is founf
- Throws:
ZipExceptionIOException
-
extractFile
public static File extractFile(String zipPackage, String fileToBeExtracted, String outFolder) throws IOException, URISyntaxException Extract a single file from a zip folder.- Parameters:
zipPackage- - URI to the the zip filefileToBeExtracted- - the name of the file to be extracted- Returns:
- - return the File that has been extracted.
- Throws:
IOExceptionURISyntaxException
-
extractFile
public static File extractFile(URI zipPackage, String fileToBeExtracted, String outFolder) throws IOException Extract a single file from a zip folder.- Parameters:
zipPackage- - path the the zip filefileToBeExtracted- - the name of the file to be extracted- Returns:
- - return the File that has been extracted.
- Throws:
IOException
-
getZipFilePath
public static String getZipFilePath(File zipFileIn, String filePattern) throws ZipException, IOException Find the first file within a zip folder that matches a pattern.- Parameters:
filePattern- - the file pattern to match - the file must contain this string.zipFile- - uri to the zip file- Returns:
- null if no file found and the file pqth if the file is founf
- Throws:
ZipExceptionIOException
-