Package smile.util

Interface CacheFiles


public interface CacheFiles
Static methods that manage cache files.
  • Method Summary

    Static Methods
    Modifier and Type
    Method
    Description
    static void
    Cleans up the cache directory.
    static String
    dir()
    Returns the cache directory path.
    static Path
    Downloads a file and save to the cache directory.
    static Path
    download(String url, boolean force)
    Downloads a file and save to the cache directory.
  • Method Details

    • dir

      static String dir()
      Returns the cache directory path.
      Returns:
      the cache directory path.
    • download

      static Path download(String url) throws IOException, URISyntaxException
      Downloads a file and save to the cache directory.
      Parameters:
      url - the url of online file.
      Returns:
      the path to the cache file.
      Throws:
      IOException - if fail to download the file.
      URISyntaxException - if url is invalid.
    • download

      static Path download(String url, boolean force) throws IOException, URISyntaxException
      Downloads a file and save to the cache directory.
      Parameters:
      url - the url of online file.
      force - flag indicating if download even when cache file exists.
      Returns:
      the path to the cache file.
      Throws:
      IOException - if fail to download the file.
      URISyntaxException - if url is invalid.
    • clean

      static void clean() throws IOException
      Cleans up the cache directory.
      Throws:
      IOException - if fail to delete the cache files.