Examples of StorageScheme


Examples of v7db.files.spi.StorageScheme

    data.removeField("_id");
    String store = BSONUtils.getString(data, "store");
    if (store == null || "raw".equals(store)) {
      return InlineContent.deserialize(data.toMap());
    }
    StorageScheme s = storageSchemes.get(store);
    if (s != null)
      return s.getContent(this, data.toMap());
    throw new UnsupportedOperationException(store);
  }
View Full Code Here

Examples of v7db.files.spi.StorageScheme

    return _sha;
  }

  public ContentPointer storeContent(Map<String, Object> storageScheme)
      throws IOException {
    StorageScheme s = storageSchemes.get(storageScheme.get("store"));
    if (s == null)
      throw new UnsupportedOperationException(storageScheme.toString());

    DBObject x = new BasicDBObject();
    for (Map.Entry<String, Object> e : storageScheme.entrySet()) {
      x.put(e.getKey(), e.getValue());
    }
    long length = BSONUtils.getRequiredLong(x, "length");
    byte[] sha = DigestUtils.sha(s.getContent(this, storageScheme)
        .getInputStream());

    long existing = contentCollection.count(new BasicDBObject(_ID, sha));
    if (existing == 0) {
      x.put(_ID, sha);
View Full Code Here

Examples of v7db.files.spi.StorageScheme

            8 * 1024);
      }
      throw new UnsupportedOperationException(data.toString());
    }

    StorageScheme s = storageSchemes.get(store);
    if (s == null)
      throw new UnsupportedOperationException(store);

    return s.getContent(this, 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.