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.
|
Path |
getCachedResource(String url)
Returns the cached resource path from the given url and null otherwise.
|
boolean |
isDownloadExternalResources() |
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) |
void |
setUseCache(boolean useCache)
Set
true if cache must be used, false otherwise. |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getName
public String resolve(String baseLocation, String publicId, String systemId)
resolve
in interface URIResolverExtension
baseLocation
- - 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.XMLEntityResolver
resolveEntity
in interface URIResolverExtension
org.apache.xerces.xni.XNIException
IOException
public Path getCachedResource(String url) throws IOException, CacheResourceDownloadedException
url
- the urlIOException
CacheResourceDownloadedException
- 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)
public void evictCache() throws IOException
IOException
- if the delete of directory (.lemminx/cache) cannot be
done.Copyright © 2022. All rights reserved.