Code example for URI

Methods: toStringtoURL

0
     */ 
    public DigitalObject retrieve(URI pdURI) throws DigitalObjectNotFoundException {
		try { 
			// Will simply attempt to download the object at the provided URI, 
			// no matter whether located at ONB or not 
            DigitalObject.Builder dob = new DigitalObject.Builder(Content.byReference(pdURI.toURL()));
            String uriStr = pdURI.toString();
            System.out.println("Building: " + uriStr);
            System.out.println("DigitalObject: " + dob.toString());
            dob.title(uriStr.substring(uriStr.lastIndexOf('?') + 5) + ".tif");
            System.out.println("Title: " + dob.getTitle());
            return dob.build();
		} catch (Exception e) {
			throw new DigitalObjectNotFoundException("Error retrieving object from " + pdURI.toString() + " (" + e.getMessage() + ")");
		} 
    } 
     
    public URI getRootURI() {
    	return root;
    }