Class DLZipUtils

java.lang.Object
rawDeepLearningClassifier.DLZipUtils

public class DLZipUtils extends Object
  • 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 file
      filePattern - - 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 file
      fileToBeExtracted - - 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 file
      fileToBeExtracted - - 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