Package net.sf.saxon.lib
Class ProtocolRestrictor
- java.lang.Object
-
- net.sf.saxon.lib.ProtocolRestrictor
-
public class ProtocolRestrictor extends java.lang.Object
This class implements the rules in a property such asXMLConstants.ACCESS_EXTERNAL_SCHEMA
, which constrain the set of URIs that can be used by supplying a list of permitted protocols.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
ProtocolRestrictor.RestrictedResourceResolver
-
Constructor Summary
Constructors Constructor Description ProtocolRestrictor(java.lang.String value)
Create a predicate from a list of allowed protocols.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ResourceResolver
asResourceResolver(ResourceResolver existing)
boolean
test(java.net.URI uri)
Test whether a particular URI is permitted by this protocol restrictorjava.lang.String
toString()
-
-
-
Constructor Detail
-
ProtocolRestrictor
public ProtocolRestrictor(java.lang.String value)
Create a predicate from a list of allowed protocols.The value is a comma-separated list of permitted protocols. A protocol is the scheme portion of a URI, or in the case of the JAR protocol, "jar" plus the scheme portion separated by colon. The value "all" gives access to all protocols (which is the default). The value "" (empty string) disallows all external resource access. (The format is thus the same as for
XMLConstants.ACCESS_EXTERNAL_SCHEMA
and similar attributes.)- Parameters:
value
- the list of allowed protocols
-
-
Method Detail
-
test
public boolean test(java.net.URI uri)
Test whether a particular URI is permitted by this protocol restrictor- Parameters:
uri
- the candidate URI- Returns:
- true if access to this URI is permitted
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
asResourceResolver
public ResourceResolver asResourceResolver(ResourceResolver existing)
-
-