|
Docmosis API 4.8.0 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.docmosis.document.ExternalResourcePermissions
public class ExternalResourcePermissions
Control of the allowed external resources in the form of a white list of urls or url-prefixes. From a security standpoint, it is preferable for templates and generated documents would contain no links to external locations. Sometimes it is necessary or practical to allow such links. This class facilitates control at varying degrees over what is permitted. The permissions are applied against templates and converted documents to control whether external resources (such as embedded OLE objects) can reference external objects (like urls or file references). Template registration and document generation will fail with an error if links are present that are not permittied. The permission is simply a true/false test and typically is applied to reading a url but could apply to any operation with a url.
Matching is done with the white list items as a prefix, so:
Field Summary | |
---|---|
static ExternalResourcePermissions |
ALL
All permission granted |
static ExternalResourcePermissions |
NONE
No permission granted |
Method Summary | |
---|---|
ExternalResourcePermissionsCheckResult |
permitted(ExternalResourceCollection resources,
boolean compareCaseInsensitive,
boolean compareDecodeUrls)
Determine whether the given resource urls are permitted based on this instances prefixes. |
static ExternalResourcePermissionsCheckResult |
permitted(ExternalResourcePermissions permission,
ExternalResourceCollection resources,
boolean compareCaseInsensitive,
boolean compareDecodeUrls)
Check whether permission is granted for all given resources. |
boolean |
permitted(String url,
boolean compareCaseInsensitive,
boolean compareDecodeUrls)
Determine whether the given url is permitted based on this instances prefixes. |
static ExternalResourcePermissions |
whitelist(String[] prefixes)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final ExternalResourcePermissions ALL
public static final ExternalResourcePermissions NONE
Method Detail |
---|
public static ExternalResourcePermissions whitelist(String[] prefixes)
public static ExternalResourcePermissionsCheckResult permitted(ExternalResourcePermissions permission, ExternalResourceCollection resources, boolean compareCaseInsensitive, boolean compareDecodeUrls)
permission
- resources
- compareCaseInsensitive
- compareDecodeUrls
-
public ExternalResourcePermissionsCheckResult permitted(ExternalResourceCollection resources, boolean compareCaseInsensitive, boolean compareDecodeUrls)
resources
- the resources to testcompareCaseInsensitive
- whether to ignore differences in character-case (true is more forgiving).compareDecodeUrls
- whether to apply decoding (eg %20 == space) when comparing
(true is more forgiving).
public boolean permitted(String url, boolean compareCaseInsensitive, boolean compareDecodeUrls)
url
- the url to testcompareCaseInsensitive
- whether to ignore differences in character-case (true is more forgiving).compareDecodeUrls
- whether to apply decoding (eg %20 == space) when comparing
(true is more forgiving).
|
Docmosis API 4.8.0 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |