/** * Construct a PID from a string, throwing a MalformedPIDException if it's * not well-formed. */ public PID(String pidString) throws MalformedPIDException { if (pidString.startsWith(Constants.FEDORA.uri)) { m_normalized = normalize(pidString, Constants.FEDORA.uri.length(), pidString.length()); } else { m_normalized = normalize(pidString); } int colon = m_normalized.indexOf(':'); m_namespaceId = m_normalized.substring(0, colon); m_objectId = m_normalized.substring(colon + 1); }
/** * Construct a PID from a string, throwing a MalformedPIDException if it's * not well-formed. */ public PID(String pidString) throws MalformedPIDException { if (pidString.startsWith(Constants.FEDORA.uri)) { m_normalized = normalize(pidString, Constants.FEDORA.uri.length(), pidString.length()); } else { m_normalized = normalize(pidString); } int colon = m_normalized.indexOf(':'); m_namespaceId = m_normalized.substring(0, colon); m_objectId = m_normalized.substring(colon + 1); }
/** * Return the normalized form of the given pid string, or throw a * MalformedPIDException. * @param pidString * @return String normalized version of the pid * @throws MalformedPIDException */ public static String normalize(String pidString) throws MalformedPIDException { if (pidString == null) { throw new MalformedPIDException("PID is null."); } return normalize(pidString, 0, pidString.length()); }
/** * Return the normalized form of the given pid string, or throw a * MalformedPIDException. * @param pidString * @return String normalized version of the pid * @throws MalformedPIDException */ public static String normalize(String pidString) throws MalformedPIDException { if (pidString == null) { throw new MalformedPIDException("PID is null."); } return normalize(pidString, 0, pidString.length()); }
return PID.normalize(pid); } catch (MalformedPIDException e) { throw new PolicyStoreException("Invalid policy name '" + name