Examples of PDURI


Examples of eu.planets_project.ifr.core.storage.impl.util.PDURI

     
      // Add migration resulting text to metadata
      if (dgoBRef != null) {
        try {
            DataRegistry dataRegistry = DataRegistryFactory.getDataRegistry();
          URI baseUri = new PDURI(dgoBRef.normalize()).formDataRegistryRootURI();
          wfResultItem.addLogInfo("base URI " + baseUri);
     
          dgoB = dataRegistry.getDigitalObjectManager(baseUri).retrieve(dgoBRef)
          wfResultItem.addLogInfo("dgoB: " + dgoB.toString());
          if (dgoB != null && dgoA.getPermanentUri() != null) {
View Full Code Here

Examples of eu.planets_project.ifr.core.storage.impl.util.PDURI

      String migratedFileSize = "";
     
      if (dgoBRef != null) {
        try {
            DataRegistry dataRegistry = DataRegistryFactory.getDataRegistry();
          URI baseUri = new PDURI(dgoBRef.normalize()).formDataRegistryRootURI();
          wfResultItem.addLogInfo("base URI " + baseUri);
     
          DigitalObject obj = dataRegistry.getDigitalObjectManager(baseUri).retrieve(dgoBRef);   
          wfResultItem.addLogInfo("obj: " + obj.toString());
View Full Code Here

Examples of eu.planets_project.ifr.core.storage.impl.util.PDURI

        _log.debug("Retrieving DigitalObject: "+pdURI );
//        new Exception().printStackTrace();
       
        DigitalObject.Builder dob;
        try {
            PDURI parsedURI = new PDURI(pdURI);
            String leafname = parsedURI.getDataRegistryPath().substring( parsedURI.getDataRegistryPath().lastIndexOf("/")+1);
            String prefix = parsedURI.getDataRegistryPath().substring( 0, parsedURI.getDataRegistryPath().lastIndexOf("/"));
           
            // Handle the binary:
            String binPath = this._root.getCanonicalPath() + File.separator + prefix +
                File.separator + BIN_DIRNAME + File.separator + leafname;           
            File binf = new File(binPath);
View Full Code Here

Examples of eu.planets_project.ifr.core.storage.impl.util.PDURI

    // First check that the URI isn's null, if it is throw IllegalArgumentException
    if (uri == null) throw new IllegalArgumentException("URI argument is null");

    // OK, let's try to get the DigitalObjectManager
    try {
      dom = DataRegistryImpl.domSet.get(new PDURI(uri.normalize()).formDataRegistryRootURI());
    // Catch the URI syntax thrown by PDURI if this isn't a valid ID URI, and rethrow as not found
    } catch (URISyntaxException e) {
      throw new DigitalObjectManagerNotFoundException("URI: " + uri +
          " is not a valid Planets DataRegistry URI ID", e);
    } catch (Exception e) {
View Full Code Here

Examples of eu.planets_project.ifr.core.storage.impl.util.PDURI

    // Try to retrieve the DigitalObjectManager for the supplied URI
    try {
      log.info("Looking up DigitalObjectManager for " + uri);
      // Return the hash map lookup, this gives the answer
      return DataRegistryImpl.domSet.containsKey(new PDURI(uri.normalize()).formDataRegistryRootURI());
    // Catch the invalid Planets URI, log and return false
    } catch (URISyntaxException e) {
      log.warning("URI: " + uri +
          " is not a valid Planets DataRegistry URI ID");
      log.info(e.getMessage());
View Full Code Here

Examples of eu.planets_project.ifr.core.storage.impl.util.PDURI

    return DataRegistryImpl.domSet.size();
  }

  public void deleteDigitalObjectManager(URI urithrows DigitalObjectManagerNotFoundException {
    try {
      if (DataRegistryImpl.domSet.remove(new PDURI(uri).formDataRegistryRootURI()) == null) {
        throw new DigitalObjectManagerNotFoundException("DigitalObjectManager " +
            new PDURI(uri).formDataRegistryRootURI() + " not found");
      }
    } catch (URISyntaxException e) {
      // TODO Auto-generated catch block
      e.printStackTrace();
    }
View Full Code Here

Examples of eu.planets_project.ifr.core.storage.impl.util.PDURI

    if (uri == null) {
      throw new DigitalObjectManagerNotFoundException("Cannot find DigitalObjectManger for null URI");
    }
    DigitalObjectManagerBase dom;
    try {
      dom = domSet.get(new PDURI(uri).formDataRegistryRootURI());
    } catch (URISyntaxException e) {
      throw new DigitalObjectManagerNotFoundException("Cannot find DigitalObjectManger for " + uri);
    }
    if (dom == null) {
      throw new DigitalObjectManagerNotFoundException("Cannot find DigitalObjectManger for " + uri);
View Full Code Here

Examples of eu.planets_project.ifr.core.storage.impl.util.PDURI

   * @return The default DOM URI following this call
   */
  public URI setDefaultDigitalObjectManagerId(URI uri) {
    if (this.hasDigitalObjectManager(uri))
      try {
        defaultDomUri = new PDURI(uri.normalize()).formDataRegistryRootURI();
      } catch (URISyntaxException e) {
        log.info("URI: " + uri +
            " is not a valid Planets DataRegistry URI ID");
      }
      return defaultDomUri;
View Full Code Here

Examples of eu.planets_project.ifr.core.storage.impl.util.PDURI

          return retVal;
        }
        log.info("OAIDigitalObjectManagerKBBase list() URI is NOT NULL");
        try {
              log.info("Replace HTTP path by registry path: " + pdURI);  
          URI baseUri = new PDURI(pdURI.normalize()).formDataRegistryRootURI();
          log.info("OAIDigitalObjectManagerKBBase list() base URI " + baseUri)
          if (dom != null && baseUri != null) {
            dom.setBaseRegistryURI(baseUri);
          }
View Full Code Here

Examples of eu.planets_project.ifr.core.storage.impl.util.PDURI

     * @return The original HTTP URI
     */
    public static URI getOriginalUri(URI uri) {
      URI res = uri;
      try {
        URI baseUri = new PDURI(uri.normalize()).formDataRegistryRootURI();
        log.info("OAIDigitalObjectManagerKBBase getOriginalUri() base URI " + baseUri);       
        URI keyUri = URI.create(uri.toString().replaceAll(baseUri.toString(), "").substring(1));
        log.info("OAIDigitalObjectManagerKBBase getOriginalUri() keyURI: " + keyUri);
        res = dom.getOriginalUri(keyUri);
      } catch (Exception e) {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.