Examples of AttachmentId


Examples of com.cedarsoft.couchdb.AttachmentId

        nextFieldValue( parser, "revpos" );
        nextFieldValue( parser, "length" );
        long length = parser.getNumberValue().longValue();
        nextFieldValue( parser, "stub" );

        attachments.add( new CouchDoc.StubbedAttachment( new AttachmentId( attachmentId ), MediaType.valueOf( contentType ), length ) );

        nextToken( parser, JsonToken.END_OBJECT );
      }
      nextToken( parser, JsonToken.END_OBJECT );
    }
View Full Code Here

Examples of com.cedarsoft.couchdb.AttachmentId

        parserWrapper.nextFieldValue( "digest" );
        parserWrapper.nextFieldValue( "length" );
        long length = parserWrapper.getNumberValue().longValue();
        parserWrapper.nextFieldValue( "stub" );

        attachments.add( new CouchDoc.StubbedAttachment( new AttachmentId( attachmentId ), MediaType.valueOf( contentType ), length ) );

        parserWrapper.nextToken( JsonToken.END_OBJECT );
      }
      parserWrapper.nextToken( JsonToken.END_OBJECT );
    }
View Full Code Here

Examples of com.cedarsoft.couchdb.AttachmentId

        parserWrapper.nextFieldValue( "digest" );
        parserWrapper.nextFieldValue( "length" );
        long length = parserWrapper.getNumberValue().longValue();
        parserWrapper.nextFieldValue( "stub" );

        attachments.add( new CouchDoc.StubbedAttachment( new AttachmentId( attachmentId ), MediaType.valueOf( contentType ), length ) );

        parserWrapper.nextToken( JsonToken.END_OBJECT );
      }
      parserWrapper.nextToken( JsonToken.END_OBJECT );
    }
View Full Code Here

Examples of com.cedarsoft.couchdb.AttachmentId

        nextFieldValue( parser, "revpos" );
        nextFieldValue( parser, "length" );
        long length = parser.getNumberValue().longValue();
        nextFieldValue( parser, "stub" );

        attachments.add( new CouchDoc.StubbedAttachment( new AttachmentId( attachmentId ), MediaType.valueOf( contentType ), length ) );

        nextToken( parser, JsonToken.END_OBJECT );
      }
      nextToken( parser, JsonToken.END_OBJECT );
    }
View Full Code Here

Examples of com.cedarsoft.couchdb.core.AttachmentId

        parserWrapper.nextFieldValue( "digest" );
        parserWrapper.nextFieldValue( "length" );
        long length = parserWrapper.getNumberValue().longValue();
        parserWrapper.nextFieldValue( "stub" );

        attachments.add( new CouchDoc.StubbedAttachment( new AttachmentId( attachmentId ), MediaType.valueOf( contentType ), length ) );

        parserWrapper.nextToken( JsonToken.END_OBJECT );
      }
      parserWrapper.nextToken( JsonToken.END_OBJECT );
    }
View Full Code Here

Examples of com.google.walkaround.wave.server.attachment.AttachmentId

  private Map<String, AttachmentId> buildAttachmentMapping(ImportWaveletTask task) {
    ImmutableMap.Builder<String, AttachmentId> out = ImmutableMap.builder();
    for (ImportedAttachment attachment : task.getAttachment()) {
      if (attachment.hasLocalId()) {
        out.put(attachment.getRemoteId(), new AttachmentId(attachment.getLocalId()));
      }
    }
    return out.build();
  }
View Full Code Here

Examples of com.google.walkaround.wave.server.attachment.AttachmentId

      for (Map.Entry<String, String> entry : attrs.entrySet()) {
        if (!ATTACHMENT_ID_ATTRIBUTE_NAME.equals(entry.getKey())) {
          newAttrs.put(entry.getKey(), entry.getValue());
        } else {
          String newValue;
          AttachmentId mapped = mapping.get(entry.getValue());
          if (mapped == null) {
            log.warning("Attachment id not found: " + entry);
            // Preserve; not sure this is a good idea but it's probably better
            // than dropping the value.
            newValue = entry.getValue();
          } else {
            log.info("Replacing " + entry + " with value " + mapped);
            newValue = mapped.getId();
          }
          newAttrs.put(entry.getKey(), newValue);
        }
      }
      attrs = AttributesImpl.fromStringMap(newAttrs);
View Full Code Here

Examples of com.google.walkaround.wave.server.attachment.AttachmentId

    LinkedList<RemoteAttachmentInfo> toImport = Lists.newLinkedList(task.getToImport());
    log.info("Need attachments for " + waveletName + ": " + toImport);
    int infosFetchedThisTask = 0;
    while (!toImport.isEmpty() && infosFetchedThisTask < MAX_FETCHES_PER_TASK) {
      RemoteAttachmentInfo info = toImport.removeFirst();
      AttachmentId localId = fetchAttachment(instance, info);
      log.info("Local id: " + localId);
      ImportedAttachmentInfo imported = new ImportedAttachmentInfoGsonImpl();
      imported.setRemoteInfo(info);
      if (localId != null) {
        imported.setLocalId(localId.getId());
      }
      infosFetchedThisTask++;
      task.addImported(imported);
    }
    if (toImport.isEmpty()) {
View Full Code Here

Examples of org.waveprotocol.wave.media.model.AttachmentId

*/
public abstract class AttachmentStoreTestBase extends TestCase {

  public void testStoreReturnsNullForNonexistantId() throws IOException {
    AttachmentStore store = newAttachmentStore();
    AttachmentId id = new AttachmentId("", "some_madeup_id");
    assertNull(store.getAttachment(id));
  }
View Full Code Here

Examples of org.waveprotocol.wave.media.model.AttachmentId

    assertNull(store.getAttachment(id));
  }

  public void testStoreCanStoreData() throws Exception {
    String testData = "some file data";
    AttachmentId id = new AttachmentId("", "id_1");
    AttachmentStore store = makeStoreWithData(id, testData);

    AttachmentData data = store.getAttachment(id);
    assertEquals(testData, dataToString(data));
  }
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.