Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.jasig.portal.utils.uri
Class PrefixUriScrutinizer

    java.lang.Object
      org.jasig.portal.utils.uri.PrefixUriScrutinizer

All Implemented Interfaces:
  java.io.Serializable, IUriScrutinizer

    public final class PrefixUriScrutinizer

extends java.lang.Object
implements IUriScrutinizer, java.io.Serializable

UriScrutinizer implementation matching URIs against allowed prefixes and disallowed prefixes to determine whether to block the URI.

The URI will be allowed if it is prefixed by at least one of the allowed prefixes and it is not prefixed by any of the blocked prefixes.

Instances of this class are immutable once constructed.

Instances of this class are threadsafe and serializable.

Since:
  uPortal 2.5.1
See Also:
  Serialized Form

Field Summary
`private java.lang.String[]` | `allowPrefixes` Allowed prefixes for URIs examined by this scrutinizer instance.
`private java.lang.String[]` | `denyPrefixes` Blocked prefixes for URIs examined by this scrutinizer instance.
`private org.apache.commons.logging.Log` | `log`

Constructor Summary
`PrefixUriScrutinizer(java.lang.String[] allowPrefixesArg, java.lang.String[] denyPrefixesArg)` Create a new PrefixUriScrutinizer instance specifying the allowed URI prefixes and the blocked URI prefixes.

Method Summary
`java.util.List` | `getAllowPrefixes()` Get an unmodifiable List of the Strings allowed as prefixes to URIs scrutinized by this PrefixUriScrutinizer.
`java.util.List` | `getDenyPrefixes()` Get an unmodifiable List of the Strings explicitly denied as prefixes to URIs scrutinized by this PrefixUriScrutinizer.
`static PrefixUriScrutinizer` | `instanceFromParameters(java.lang.String allowPrefixesArg, java.lang.String denyPrefixesArg)`
`void` | `scrutinize(java.net.URI uriArg)` Scrutinize a URI to determine if access to it should be blocked for reasons of policy.
`java.lang.String` | `toString()`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

Field Detail

### log

    private final org.apache.commons.logging.Log log

### allowPrefixes

    private final java.lang.String[] allowPrefixes

  Allowed prefixes for URIs examined by this scrutinizer instance. URIs must match at least one of these prefixes.

### denyPrefixes

    private final java.lang.String[] denyPrefixes

  Blocked prefixes for URIs examined by this scrutinizer instance. URIs must not match any of these prefixes.

Constructor Detail

### PrefixUriScrutinizer

    public PrefixUriScrutinizer(java.lang.String[] allowPrefixesArg,
                                java.lang.String[] denyPrefixesArg)

  Create a new PrefixUriScrutinizer instance specifying the allowed URI prefixes and the blocked URI prefixes. Both arguments must not be null or contain null references. This instance will block all URIs if allowPrefixesArg is empty. This constructor will copy the argument arrays, normalizing the prefix content to all-lowercase.

  Parameters:
    `allowPrefixesArg` - non-null potentially empty array of Strings
    `denyPrefixesArg` - non-null potentially empty array of Strings

Method Detail

### instanceFromParameters

    public static PrefixUriScrutinizer instanceFromParameters(java.lang.String allowPrefixesArg,
                                                              java.lang.String denyPrefixesArg)

### scrutinize

    public void scrutinize(java.net.URI uriArg)
                    throws BlockedUriException

  Description copied from interface: `IUriScrutinizer`
  Scrutinize a URI to determine if access to it should be blocked for reasons of policy. Throws BlockedUriException if access to the URI should be blocked, conveying the reason for blockage. Blocking a URI is an exceptional and ideally rare circumstance which will usually abort whatever operation was being undertaken, and so this method throws on that exceptional circumstance.

  Specified by:
    `scrutinize` in interface `IUriScrutinizer`
  Parameters:
    `uriArg` - non-null URI for examination
  Throws:
    `BlockedUriException` - if access should be blocked

### getAllowPrefixes

    public java.util.List getAllowPrefixes()

  Get an unmodifiable List of the Strings allowed as prefixes to URIs scrutinized by this PrefixUriScrutinizer.

  Returns:
    an unmodifiable List of Strings

### getDenyPrefixes

    public java.util.List getDenyPrefixes()

  Get an unmodifiable List of the Strings explicitly denied as prefixes to URIs scrutinized by this PrefixUriScrutinizer.

  Returns:
    an unmodifiable potentially empty list of Strings

### toString

    public java.lang.String toString()

  Overrides:
    `toString` in class `java.lang.Object`

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD