public class XMLCacheResolverExtension extends Object implements URIResolverExtension
DEFAULT| Constructor and Description |
|---|
XMLCacheResolverExtension() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
canUseCache(String url)
Returns
true if cache is enabled and url comes from "http(s)" or
"ftp" and false otherwise. |
void |
evictCache()
Remove the cache directory (.lemminx/cache) if it exists.
|
void |
forceDownloadExternalResource(String url)
Force the given
url to download. |
Path |
getCachedResource(String url)
Returns the cached resource path from the given url and null otherwise.
|
boolean |
isDownloadExternalResources()
Returns true if the external resources can be downloaded and false otherwise.
|
boolean |
isUseCache()
Returns
true if cache must be used, false
otherwise. |
String |
resolve(String baseLocation,
String publicId,
String systemId) |
org.apache.xerces.xni.parser.XMLInputSource |
resolveEntity(org.apache.xerces.xni.XMLResourceIdentifier resourceIdentifier) |
void |
setDownloadExternalResources(boolean downloadExternalResources)
Set true if the external resources can be downloaded and false otherwise.
|
void |
setUseCache(boolean useCache)
Set
true if cache must be used, false otherwise. |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetNamepublic String resolve(String baseLocation, String publicId, String systemId)
resolve in interface URIResolverExtensionbaseLocation - - the location of the resource that contains the uripublicId - - an optional public identifier (i.e. namespace name), or
null if nonesystemId - - an absolute or relative URI, or null if nonepublic org.apache.xerces.xni.parser.XMLInputSource resolveEntity(org.apache.xerces.xni.XMLResourceIdentifier resourceIdentifier)
throws org.apache.xerces.xni.XNIException,
IOException
resolveEntity in interface org.apache.xerces.xni.parser.XMLEntityResolverresolveEntity in interface URIResolverExtensionorg.apache.xerces.xni.XNIExceptionIOExceptionpublic Path getCachedResource(String url) throws IOException, CacheResourceDownloadedException
url - the url to download.IOExceptionCacheResourceDownloadedException - throws when resource is downloading.public boolean canUseCache(String url)
true if cache is enabled and url comes from "http(s)" or
"ftp" and false otherwise.url - true if cache is enabled and url comes from "http(s)" or
"ftp" and false otherwise.public void setUseCache(boolean useCache)
true if cache must be used, false otherwise.useCache - true if cache must be used, false
otherwise.public boolean isUseCache()
true if cache must be used, false
otherwise.true if cache must be used, false
otherwise.public boolean isDownloadExternalResources()
public void setDownloadExternalResources(boolean downloadExternalResources)
downloadExternalResources - the external resourcespublic void evictCache()
throws IOException
IOException - if the delete of directory (.lemminx/cache) cannot be
done.public void forceDownloadExternalResource(String url)
url to download.url - the url to download.Copyright © 2022. All rights reserved.