|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectfedora.common.PID
public class PID
A persistent identifier for Fedora digital objects.
The following describes the syntactic constraints for PIDs in normalized form. The only differences with non-normalized PIDs are that the colon delimiter may be encoded as "%3a" or "%3A", and hex-digits may use lowercase [a-f].
PID: Length : maximum 64 Syntax : namespace-id ":" object-id namespace-id: Syntax : ( [A-Z] / [a-z] / [0-9] / "-" / "." ) 1+ object-id: Syntax : ( [A-Z] / [a-z] / [0-9] / "-" / "." / "~" / "_" / escaped-octet ) 1+ escaped-octet: Syntax : "%" hex-digit hex-digit hex-digit: Syntax : [0-9] / [A-F]
| Field Summary | |
|---|---|
static int |
MAX_LENGTH
The maximum length of a PID is 64. |
static java.lang.String |
NS_HANDLE
The reserved handle namespace id |
| Constructor Summary | |
|---|---|
PID(java.lang.String pidString)
Construct a PID from a string, throwing a MalformedPIDException if it's not well-formed. |
|
| Method Summary | |
|---|---|
static PID |
fromFilename(java.lang.String filenameString)
Construct a PID given a filename of the form produced by toFilename(), throwing a MalformedPIDException if it's not well-formed. |
static PID |
getInstance(java.lang.String pidString)
Alternate constructor that throws an unchecked exception if it's not well-formed. |
java.lang.String |
getNamespaceId()
|
java.lang.String |
getObjectId()
|
static void |
main(java.lang.String[] args)
Command-line interactive tester. |
static java.lang.String |
normalize(java.lang.String pidString)
Return the normalized form of the given pid string, or throw a MalformedPIDException. |
java.lang.String |
toFilename()
Return a string representing this PID that can be safely used as a filename on any OS. |
java.lang.String |
toString()
Return the normalized form of this PID. |
java.lang.String |
toURI()
Return the URI form of this PID. |
static java.lang.String |
toURI(java.lang.String pidString)
Return the URI form of some PID string, assuming it is well-formed. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final int MAX_LENGTH
public static final java.lang.String NS_HANDLE
| Constructor Detail |
|---|
public PID(java.lang.String pidString)
throws MalformedPIDException
MalformedPIDException| Method Detail |
|---|
public static PID getInstance(java.lang.String pidString)
public static PID fromFilename(java.lang.String filenameString)
throws MalformedPIDException
MalformedPIDException
public static java.lang.String normalize(java.lang.String pidString)
throws MalformedPIDException
MalformedPIDExceptionpublic java.lang.String toString()
toString in class java.lang.Objectpublic java.lang.String toURI()
public static java.lang.String toURI(java.lang.String pidString)
public java.lang.String toFilename()
public java.lang.String getNamespaceId()
public java.lang.String getObjectId()
public static void main(java.lang.String[] args)
throws java.lang.Exception
java.lang.Exception
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||