Package org.apache.batik.bridge
Class DefaultExternalResourceSecurity
java.lang.Object
org.apache.batik.bridge.DefaultExternalResourceSecurity
- All Implemented Interfaces:
ExternalResourceSecurity
Default implementation for the
ExternalResourceSecurity
interface.
It allows all types of external resources to be loaded, but only if they
come from the same server as the document they are referenced from.-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final String
static final String
Message when trying to load a external resource file and the Document does not have a URLstatic final String
Message when trying to load a externalResource file from a server different than the one of the document.protected SecurityException
The exception is built in the constructor and thrown if not null and the checkLoadExternalResource method is called. -
Constructor Summary
ConstructorsConstructorDescriptionDefaultExternalResourceSecurity
(ParsedURL externalResourceURL, ParsedURL docURL) -
Method Summary
Modifier and TypeMethodDescriptionvoid
Controls whether the externalResource should be loaded or not.
-
Field Details
-
DATA_PROTOCOL
- See Also:
-
ERROR_CANNOT_ACCESS_DOCUMENT_URL
Message when trying to load a external resource file and the Document does not have a URL- See Also:
-
ERROR_EXTERNAL_RESOURCE_FROM_DIFFERENT_URL
Message when trying to load a externalResource file from a server different than the one of the document.- See Also:
-
se
The exception is built in the constructor and thrown if not null and the checkLoadExternalResource method is called.
-
-
Constructor Details
-
DefaultExternalResourceSecurity
- Parameters:
externalResourceURL
- url for the externalResource, as defined in the externalResource's xlink:href attribute. If that attribute was empty, then this parameter should be nulldocURL
- url for the document into which the externalResource was found.
-
-
Method Details
-
checkLoadExternalResource
public void checkLoadExternalResource()Controls whether the externalResource should be loaded or not.- Specified by:
checkLoadExternalResource
in interfaceExternalResourceSecurity
- Throws:
SecurityException
- if the externalResource should not be loaded.
-