public class HashPathIdMapper extends Object implements org.akubraproject.map.IdMapper
file: mapping for any URI.
The path component of each internal URI is derived from an MD5 hash of the external URI. The filename component is a reversible encoding of the external URI that is safe to use as a filename on modern filesystems.
Patterns:
Example patterns:
a-z A-Z 0-9 = ( ) [ ] -
In addition, . (period) will be escaped as %2E when
it occurs as the last character of the URI.
urn:example1 becomes file:0/8/urn%3Aexample1http://tinyurl.com/cxzzf becomes file:6/2/http%3A%2F%2Ftinyurl.com%2Fcxzzfurn:example1 becomes file:08/86/urn%3Aexample1http://tinyurl.com/cxzzf becomes file:62/ca/http%3A%2F%2Ftinyurl.com%2Fcxzzf| Constructor and Description |
|---|
HashPathIdMapper(String pattern)
Creates an instance that will use the given pattern.
|
| Modifier and Type | Method and Description |
|---|---|
URI |
getExternalId(URI internalId) |
URI |
getInternalId(URI externalId) |
String |
getInternalPrefix(String externalPrefix) |
public HashPathIdMapper(String pattern)
pathPattern - the pattern to use, possibly null or "".IllegalArgumentException - if the pattern is invalid.public URI getExternalId(URI internalId) throws NullPointerException
getExternalId in interface org.akubraproject.map.IdMapperNullPointerExceptionpublic URI getInternalId(URI externalId) throws NullPointerException
getInternalId in interface org.akubraproject.map.IdMapperNullPointerExceptionpublic String getInternalPrefix(String externalPrefix) throws NullPointerException
getInternalPrefix in interface org.akubraproject.map.IdMapperNullPointerExceptionCopyright © 2013 DuraSpace. All Rights Reserved.