Package eu.planets_project.services.datatypes

Examples of eu.planets_project.services.datatypes.DigitalObjectContent$Adapter


             _log.log(Level.INFO, "Could not update digital object. Result: " + updateRes);
             throw new DigitalObjectUpdateException(
                 "Could not update digital object. Result: " + updateRes);
           }
         }
         DigitalObjectContent content = evaluateContent(node, includeContent, permanentUri.toString());
         _retVal = fillDigitalObject(node, content);
           _log.log(Level.INFO, "retrieveDigitalObjectDefinition() retrieve completed. " + _retVal.toString());
      } catch (DigitalObjectTooLargeException tle) {
        _log.log(Level.INFO, DIGITAL_OBJECT_TOO_LARGE + tle.getMessage(), tle);
         try {
          DigitalObjectContent content =
            evaluateContentByReference(permanentUri.toString());
           _retVal = fillDigitalObject(node, content);
         } catch (MalformedURLException e) {
           _log.log(Level.INFO, DIGITAL_OBJECT_NOT_FOUND + " MalformedURLException: " + e.getMessage(), e);
             throw new DigitalObjectNotFoundException(DIGITAL_OBJECT_NOT_FOUND + e.getMessage());
View Full Code Here


  public DigitalObjectContent retrieveContent(URI pdURI)
      throws ItemNotFoundException, RepositoryException,
      URISyntaxException
    {
    _log.log(Level.INFO, "JcrDigitalObjectManagerImpl.retrieveContent()");
    DigitalObjectContent resultContent = null;
    try {
      resultContent = Content.byValue(jcrManager.retrieveContent(pdURI));
    } catch (DigitalObjectNotFoundException e) {
      e.printStackTrace();
    }
View Full Code Here

                wfResultItem.addLogInfo("Store DO3 in JCR res: " + permanentUri3.toString());
              DigitalObject tmpDO = dodm.retrieve(permanentUri, true);
              wfResultItem.addLogInfo("result DO from JCR title: " + tmpDO.getTitle());
                wfResultItem.addLogInfo("result DO from JCR content length: " + tmpDO.getContent().length());
               
            DigitalObjectContent c2 = dodm.retrieveContent(permanentUri);
            wfResultItem.addLogInfo("retrieveContent result length: " + c2.length());

              tmpDO = dodm.retrieve(permanentUri, false);
              wfResultItem.addLogInfo("retrieve DO without content");
              if (tmpDO.getContent() != null)
              {
View Full Code Here

        // URI migrateFromURI = new URI(migrateFrom);

        InputStream streamContent = digO.getContent().getInputStream();
        byte[] byteContent = FileUtils.writeInputStreamToBinary(streamContent);
        //ImmutableContent content = new ImmutableContent(byteContent);
        DigitalObjectContent content = Content.byValue(byteContent);
        digO = (new DigitalObject.Builder(digO)).content(content).build();

        URI migrateToURI = this.getServiceCallConfigs(this.migrate).getPropertyAsURI(SER_PARAM_MIGRATE_TO);
       
        // Create service parameter list
View Full Code Here

     * @param type
     * @throws MalformedURLException
     */
    private void testIdentifyThis( URI purl, URI type ) throws MalformedURLException {
        /* Create the content: */
        DigitalObjectContent c1 = Content.byReference(purl.toURL());
        /* Given these, we can instantiate our object: */
        DigitalObject object = new DigitalObject.Builder(c1).permanentUri(purl).build();
       
        /* Now pass this to the service */
        IdentifyResult ir = ids.identify(object, null);
View Full Code Here

    public void testSizeABinary() {
        /* set up a binary */
        byte[] binary = new byte[(int)(Math.random()*1024*10)];
       
        /* Create the content: */
        DigitalObjectContent c1 = Content.byValue(binary);
       
        /* Given these, we can instantiate our object: */
        DigitalObject object = new DigitalObject.Builder(c1).build();

        /* Now run the service */
 
View Full Code Here

        byte[] binary = new byte[(int)(Math.random()*1024*10)];
        File file = File.createTempFile("planets", null);
        FileUtils.writeByteArrayToFile(file, binary);
       
        /* Create the content: */
        DigitalObjectContent c1 = Content.byReference(file.toURI().toURL());
       
        /* Given these, we can instantiate our object: */
        DigitalObject object = new DigitalObject.Builder(c1).build();

        /* Now run the service */
 
View Full Code Here

     * @param type
     * @throws MalformedURLException
     */
    private void testIdentifyThis(URI purl, URI type) throws MalformedURLException {
        /* Create the content: */
        DigitalObjectContent c1 = Content.byReference(purl.toURL());
        /* Given these, we can instantiate our object: */
        DigitalObject object = new DigitalObject.Builder(c1).permanentUri(purl)
                .build();

        /* Now pass this to the service */
 
View Full Code Here

   */
  private void test(final Validate tiffCheck)
  {
    File pngFile = new File("PC/libtiff/src/resources/image01.png");
    File tifFile = new File("PC/libtiff/src/resources/image01.tif");
    DigitalObjectContent pngContent = null;
    DigitalObjectContent tifContent = null;
    try {
      pngContent = Content.byReference(pngFile.toURL());
      tifContent = Content.byReference(tifFile.toURL());
    }
    catch (MalformedURLException e)
View Full Code Here

                File.separator + BIN_DIRNAME + File.separator + leafname;           
            File binf = new File(binPath);
            if( ! binf.exists() || ! binf.canRead() || ! binf.isFile() ) {
                throw new DigitalObjectNotFoundException("The DigitalObject was not found!");
            }
            DigitalObjectContent c = Content.byReference( binf );
            dob = new DigitalObject.Builder( c );
            dob.title( binf.getName() );

           
            // Patch in properties from 'docs' if present.
View Full Code Here

TOP

Related Classes of eu.planets_project.services.datatypes.DigitalObjectContent$Adapter

Copyright © 2018 www.massapicom. 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.