maker

Member
  • Content count

    4
  • Joined

  • Last visited

Community Reputation

0 Neutral

2 Followers

About maker

  1. What i have done is 1. create a note "mm" on web client, attach a file "a.abc". 2. copy "a.abc" to "b.abc" 3. edit note "mm", attach "b.abc" 4. what i get is not "a.abc" and "b.abc" in note "mm", but 2 "b.abc". This happened also if i use Android API to do the same thing. What can i do to save two file with same content in a note?
  2. I have to compare the guid and the filename of the resources to get the GUID i have add. But at least it works. If someone know a better way, please let me know. Right, it is very important. and also while deleting resource.
  3. after adding resource and update by using: Note note = getNoteStore().getNote(getAuthToken(), noteGuid , true, false, false, false); note.addToResources(resource); getNoteStore().updateNote(getAuthToken(), note); how can i get the Guid of the added resource?
  4. Hello, I use following code to add a file to Note as attachment. After that I can see the resource on my own app, but not in Web. And the file is not correct if I download it. Can someone help? File file = new File(f); // Hash the data in the image file. The hash is used to reference the // file in the ENML note content. InputStream in = new BufferedInputStream(new FileInputStream(f)); FileData data = new FileData(EDAMUtil.hash(in), new File(f)); in.close(); // Create a new Resource Resource resource = new Resource(); resource.setData(data); resource.setMime(this.mimeType); ResourceAttributes attributes = new ResourceAttributes(); attributes.setFileName(file.getName()); attributes.setAttachment(true); resource.setAttributes(attributes); Note note = getNoteStore().getNote(getAuthToken(), noteGuid , true, false, false, false); note.addToResources(resource); String content = note.getContent(); content.replace(NOTE_SUFFIX, ""); content += "<div><en-media type=\"" + this.mimeType + "\" hash=\"" + EDAMUtil.bytesToHex(resource.getData().getBodyHash()) + "\"/></div>" + NOTE_SUFFIX; getNoteStore().updateNote(getAuthToken(), note);