Examples of PDURI


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

    URI storeLocation = null;
   
    // OK, if this has a folder part we need the path
    // get the path array from the URI to store at
    log.info("Getting new PDURI from " + pdURI);
    PDURI _parsedURI;
    try {
      // URI used to build folder ids as we go
      _parsedURI = new PDURI(pdURI);
     
      // Get the path parts
      String[] decodedPath =_parsedURI.getPathParts();

      // Save the URI context from "root", and a variable for the last element
      URI contextURI = this.id.normalize();
     
      // Iterate through the path elements
View Full Code Here

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

    public List<URI> list(URI pdURI){

        try {
     
          logger.info("FEDORA list called w URI: "+pdURI);
          URI baseUri = new PDURI(pdURI.normalize()).formDataRegistryRootURI();
          logger.info("FedoraDigitalObjectManager list() base URI " + baseUri)
         
          if (pdURI.equals(baseUri) == false){
            logger.severe("FEDORA DOM list method does not support hierarchical browsing");
            return null;
View Full Code Here

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

     */
    public DigitalObject retrieve(URI pdURI) throws DigitalObjectNotFoundException{

      String leafName = null;
      try {
      leafName = new PDURI(pdURI).getLeafname();
    } catch (URISyntaxException e1) {
      throw new RuntimeException("Failed to generate PDURI",e1);
    }
     
    pdURI = URI.create(managerUri+"/"+leafName).normalize();
View Full Code Here

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

      retVal = new ArrayList<URI>();
      retVal.add( this.id );
      return retVal;
    }
    log.fine("URI is NOT NULL");
    PDURI realPdURI;
    String fullPath = null;
    try {
      realPdURI = new PDURI(pdURI);
      fullPath = this._root.getCanonicalPath() + File.separator + realPdURI.getDataRegistryPath();
      log.info("Full path is " + fullPath);
          File searchRoot = new File(fullPath);
          log.info("Looking at: " + pdURI + " -> " + searchRoot.getCanonicalPath() );   
      retVal = this.listFileLocation( pdURI, searchRoot );
     
View Full Code Here

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

        // Look for the XML:
    try {
          // All files should have a binary:
          // Files without an associated metadata file are patched in like this:
          File binFile = new File( this._root.getCanonicalPath() + File.separator + ( new PDURI(pdURI).getDataRegistryPath() ) );
          if( ! binFile.exists() ) {
            log.info("binFile doesn't exist, throwing Not Found exception");
            log.info("looking for file:" + binFile.getAbsolutePath());
              throw new DigitalObjectNotFoundException("The DigitalObject was not found!");
          }
          DigitalObjectContent c = Content.byReference( binFile );
           
            // Look for the XML:
      PDURI parsedURI = new PDURI(pdURI);
      parsedURI.replaceDecodedPath(parsedURI.getDataRegistryPath() + FilesystemDigitalObjectManagerImpl.DO_EXTENSION);
      String fullPath = this._root.getCanonicalPath() + File.separator + parsedURI.getDataRegistryPath();
      StringBuilder fileData = new StringBuilder(1024);
      File xmlf = new File(fullPath);
      if( xmlf.exists() ) {
          BufferedReader reader = new BufferedReader(new FileReader(xmlf));
          char[] buf = new char[1024];
          int numRead = 0;
          while((numRead=reader.read(buf)) != -1) {
              fileData.append(buf, 0, numRead);
          }
          reader.close();
          // Re-create the digital object metadata.
                dob = new DigitalObject.Builder(fileData.toString());
                // Attach the content:
                dob.content(c);
      } else {
                dob = new DigitalObject.Builder(c);
            }
            // If there is no title, add title to the dob.
            // TODO Not the originally intended behaviour - if an object has been stored with no title, then that should remain the case.  The 'filename' is already in the URI, where it belongs.
            if( dob.getTitle() == null ) {
                String title = null;
                title = new PDURI(pdURI).getLeafname();
                dob.title(title);
                log.info("Add title: " + title);
            }
      // Ensure the PDURI is fixed up:
      dob.permanentUri(pdURI);
View Full Code Here

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

              "The DigitalObject title was not found!");
         }

      // get the path from the URI to store at
      log.info("Getting new PDURI from " + pdURI);
      PDURI _parsedURI = new PDURI(pdURI);
      log.info("getting dr path");
      String path = _parsedURI.getDataRegistryPath();
      log.info("path is " + path);

      // We need to append the path to the root dir of this registry for the data
      log.info("New binary file");
      File doBinary = new File(this._root.getCanonicalPath() +
View Full Code Here

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

          return retVal;
        }
//        log.info("JcrDigitalObjectManagerBase list() URI is NOT NULL");
        try {
//              log.info("Replace HTTP path by registry path: " + pdURI);  
          URI baseUri = new PDURI(pdURI.normalize()).formDataRegistryRootURI();
//          log.info("JcrDigitalObjectManagerBase list() base URI " + baseUri);       

          if (pdURI.equals(baseUri)) {
            retVal = this.listFileLocation(pdURI);
          }
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("JcrDigitalObjectManagerBase getOriginalUri() base URI " + baseUri);
        if (!uri.equals(baseUri)) {
          URI keyUri = URI.create(uri.toString().replaceAll(baseUri.toString(), ""));
//          log.info("JcrDigitalObjectManagerBase getOriginalUri() keyURI: " + keyUri);
          res = keyUri;
View Full Code Here

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);
     
          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

      wfResultItem.addLogInfo("Completed migration. URI: " + dgoCRef);
     
      // Add migration resulting text to metadata
      if (dgoCRef != null) {
        try {
          baseUri = new PDURI(dgoCRef.normalize()).formDataRegistryRootURI();
          wfResultItem.addLogInfo("migration base URI: " + baseUri);
     
          dgoC = dataRegistry.getDigitalObjectManager(baseUri).retrieve(dgoCRef)
          wfResultItem.addLogInfo("dgoC: " + dgoC.toString());
          if (dgoC != null && dgoB.getPermanentUri() != null) {
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.