Class DatasetDownloadUtils

java.lang.Object
gaiasky.util.datadesc.DatasetDownloadUtils

public class DatasetDownloadUtils extends Object
  • Constructor Details

    • DatasetDownloadUtils

      public DatasetDownloadUtils()
  • Method Details

    • fileSize

      public static long fileSize(String inputFilePath)
      Returns the file size.
      Parameters:
      inputFilePath - A file.
      Returns:
      The size in bytes.
    • fileSizeGZUncompressed

      public static long fileSizeGZUncompressed(String inputFilePath) throws IOException
      Returns the GZ uncompressed size.
      Parameters:
      inputFilePath - A gzipped file.
      Returns:
      The uncompressed size in bytes.
      Throws:
      IOException - If the file failed to read.
    • cleanupTempFiles

      public static void cleanupTempFiles()
      We should never need to call this, as the main GaiaSky.dispose() method already cleans up the temp directory. This way, we allow download resumes within the same session.
    • cleanupTempFile

      public static void cleanupTempFile(String file)
      Remove a single file in the temp directory.
      Parameters:
      file - The file to remove.
    • cleanupTempFiles

      public static void cleanupTempFiles(boolean dataDownloads, boolean dataDescriptor)
    • deleteFile

      public static void deleteFile(Path p)
    • decompress

      public static void decompress(String in, File out, DatasetDesc dataset) throws Exception
      Throws:
      Exception
    • isEnabled

      public static boolean isEnabled(DatasetDesc dataset)
    • isPathIn

      public static boolean isPathIn(String path, List<String> setting)