Class CacheResourcesManager


  • public class CacheResourcesManager
    extends Object
    Cache resources manager.
    • Constructor Detail

      • CacheResourcesManager

        public CacheResourcesManager()
    • Method Detail

      • canUseCache

        public boolean canUseCache​(String url)
        Returns true if cache is enabled and url comes from "http(s)" or "ftp" and false otherwise.
        Parameters:
        url -
        Returns:
        true if cache is enabled and url comes from "http(s)" or "ftp" and false otherwise.
      • setUseCache

        public void setUseCache​(boolean useCache)
        Set true if cache must be used, false otherwise.
        Parameters:
        useCache - true if cache must be used, false otherwise.
      • isUseCache

        public boolean isUseCache()
        Returns true if cache must be used, false otherwise.
        Returns:
        true if cache must be used, false otherwise.
      • isDownloadExternalResources

        public boolean isDownloadExternalResources()
        Returns true if the external resources can be downloaded and false otherwise.
        Returns:
        true if the external resources can be downloaded and false otherwise.
      • setDownloadExternalResources

        public void setDownloadExternalResources​(boolean downloadExternalResources)
        Set true if the external resources can be downloaded and false otherwise.
        Parameters:
        downloadExternalResources - the external resources
      • evictCache

        public void evictCache()
                        throws IOException
        Remove the cache directory (.lemminx/cache) if it exists.
        Throws:
        IOException - if the delete of directory (.lemminx/cache) cannot be done.
      • addProtocolForCache

        public void addProtocolForCache​(String protocol)
        Add protocol for using cache when url will start with the given protocol.
        Parameters:
        protocol - the protocol to add.
      • removeProtocolForCache

        public void removeProtocolForCache​(String protocol)
        Remove protocol to avoid using cache when url will start with the given protocol.
        Parameters:
        protocol - the protocol to remove.
      • forceDownloadExternalResource

        public void forceDownloadExternalResource​(String url)
        Force the given url to download.
        Parameters:
        url - the url to download.