Package com.evernote.edam.type

Examples of com.evernote.edam.type.Resource


      logger.log(logger.EXTREME, "NoteTable.getNoteRecognition exec has failed.");
      logger.log(logger.MEDIUM, query.lastError());
      return null;
    }
    while (query.next()) { 
      Resource r = new Resource();   
      res.add(r);
      Data rec = new Data();
      rec.setBodyHash(query.valueString(0).getBytes());
      String x = new String(query.valueString(1));
      if (!x.equals("")) {
        rec.setSize(new Integer(x));
        rec.setBody(query.valueString(2).getBytes());
      } else
        rec.setSize(0);
      r.setRecognition(rec);
   
    return res;
  }
View Full Code Here


    if (!check) {
      logger.log(logger.EXTREME, "NoteTable.getNoteRecognition exec has failed.");
      logger.log(logger.MEDIUM, query.lastError());
      return null;
    }
    Resource r = null;
    while (query.next()) {
                 
      r = new Resource();   
      Data rec = new Data();
      rec.setBodyHash(query.valueString(0).getBytes());
      String x = new String(query.valueString(1));
      if (!x.equals("")) {
        rec.setSize(new Integer(x));
        rec.setBody(query.valueString(2).getBytes());
      } else
        rec.setSize(0);
      r.setRecognition(rec);
      r.setNoteGuid(query.valueString(3));
   
    return r;
  }
View Full Code Here

        List<Resource> resources = noteResourceTable.getNoteResourcesRecognition(n.getGuid());
        n.setResources(resources);
      } else {
        // We need to merge the recognition resources with the note resources retrieved earlier
        for (int i=0; i<n.getResources().size(); i++) {
          Resource r = noteResourceTable.getNoteResourceRecognition(n.getResources().get(i).getGuid());
          n.getResources().get(i).setRecognition(r.getRecognition());
        }
      }
    }
    n.setContent(fixCarriageReturn(n.getContent()));
    return n;
View Full Code Here

    // for the attachment. At a minimum, the Resource contains the binary
    // attachment
    // data, an MD5 hash of the binary data, and the attachment MIME type.
    // It can also
    // include attributes such as filename and location.
    Resource resource = new Resource();
    resource.setData(readFileAsData(fileName));
    resource.setMime(mimeType);
    ResourceAttributes attributes = new ResourceAttributes();
    attributes.setFileName(fileName);
    resource.setAttributes(attributes);

    // Now, add the new Resource to the note's list of resources
    note.addToResources(resource);

    // To display the Resource as part of the note's content, include an
    // <en-media>
    // tag in the note's ENML content. The en-media tag identifies the
    // corresponding
    // Resource using the MD5 hash.
    String hashHex = bytesToHex(resource.getData().getBodyHash());

    // The content of an Evernote note is represented using Evernote Markup
    // Language
    // (ENML). The full ENML specification can be found in the Evernote API
    // Overview
View Full Code Here

TOP

Related Classes of com.evernote.edam.type.Resource

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.