Package rawDeepLearningClassifier
Class DLZipUtils
java.lang.Object
rawDeepLearningClassifier.DLZipUtils
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic File
extractFile
(String zipPackage, String fileToBeExtracted, String outFolder) Extract a single file from a zip folder.static File
extractFile
(URI zipPackage, String fileToBeExtracted, String outFolder) Extract a single file from a zip folder.static String
getZipFilePath
(File zipFileIn, String filePattern) Find the first file within a zip folder that matches a pattern.static String
getZipFilePath
(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:
ZipException
IOException
-
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:
IOException
URISyntaxException
-
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:
ZipException
IOException
-