Package v7db.files.spi

Examples of v7db.files.spi.ContentPointer


  ContentPointer getContentPointer(BSONObject metaData) {
    return storage.getContentPointer(metaData);
  }

  Content getContent(BSONObject metaData) throws IOException {
    ContentPointer pointer = storage.getContentPointer(metaData);
    return storage.getContent(pointer);
  }
View Full Code Here


  public boolean hasContent() {
    return getContentPointer() != null;
  }

  public Long getLength() {
    ContentPointer p = getContentPointer();
    if (p == null)
      return null;
    return p.getLength();
  }
View Full Code Here

      return null;
    return p.getLength();
  }

  public String getDigest() {
    ContentPointer contentPointer = getContentPointer();
    if (contentPointer instanceof ContentSHA) {
      return ((ContentSHA) contentPointer).getDigest();
    }
    if (contentPointer instanceof InlineContent) {
      try {
        return DigestUtils.shaHex(((InlineContent) contentPointer)
            .getInputStream());
      } catch (IOException e) {
        throw new RuntimeException(e);
      }
    }
    if (contentPointer.getLength() == 0)
      return ContentSHA.calculate(ArrayUtils.EMPTY_BYTE_ARRAY)
          .getDigest();

    // TODO:
    System.err.println("NO DIGEST!");
View Full Code Here

TOP

Related Classes of v7db.files.spi.ContentPointer

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.