Examples of storeContent()


Examples of v7db.files.mongodb.MongoContentStorage.storeContent()

      }
    }

    MongoContentStorage storage = new MongoContentStorage(getMongo().getDB(
        "test"));
    ContentSHA sha = storage.storeContent(new ByteArrayInputStream("test"
        .getBytes()));
    {
      WebRequest request = new GetMethodWebRequest(
          "http://test/myServlet/1");
      request.setParameter("sha", sha.getDigest());
View Full Code Here

Examples of v7db.files.mongodb.MongoContentStorage.storeContent()

  public void testFormPostGET() throws IOException, SAXException {

    BasicBSONObject bucket = prepareBucket("1", "FormPost", null, null);
    MongoContentStorage storage = new MongoContentStorage(getMongo().getDB(
        "test"));
    ContentSHA sha = storage.storeContent(new ByteArrayInputStream("test"
        .getBytes()));
    ServletUnitClient sc = sr.newClient();
    {
      WebRequest request = new GetMethodWebRequest(
          "http://test/myServlet/1");
View Full Code Here

Examples of v7db.files.mongodb.MongoContentStorage.storeContent()

  }

  public void testSha() throws IOException {
    MongoContentStorage storage = new MongoContentStorage(getMongo().getDB(
        "test"));
    ContentSHA sha = storage.storeContent(new ByteArrayInputStream("test"
        .getBytes()));
    CatCommand.main(new String[] { "cat", "-sha", sha.getDigest() });
    System.out.flush();
    assertEquals("test", out.toString());
  }
View Full Code Here

Examples of v7db.files.mongodb.MongoContentStorage.storeContent()

    for (int i = 1; i < args.length; i++) {
      File f = new File(args[i]);
      if (f.isFile() && f.canRead()) {
        try {
          ContentSHA up = storage
              .storeContent(new FileInputStream(f));

          // TODO: display if chunked or not
          System.out.format("-      %10d %80s %40s\n", f.length(), f
              .getName(), up.getDigest());
View Full Code Here

Examples of v7db.files.spi.ContentStorage.storeContent()

        "v7files.content");
    ContentStorage storage = new MongoContentStorage(contents);

    byte[] data = "abcdefghijklmnopqrstuvwxyz".getBytes();

    ContentPointer pointer = storage.storeContent(new ByteArrayInputStream(
        data));

    DBCollection references = mongo.getDB("test").getCollection(
        "v7files.refs");
    ReferenceTracking refs = new MongoReferenceTracking(references);
View Full Code Here

Examples of v7db.files.spi.ContentStorage.storeContent()

      ZipException, DecoderException {

    ContentStorage storage = new MongoContentStorage(getMongo().getDB(
        "test"));

    ContentPointer zip = storage.storeContent(getClass()
        .getResourceAsStream("mongodb.epub"));

    ContentPointer png = ZipFile.extractFile(storage, zip,
        "images/img0.png");
View Full Code Here

Examples of v7db.files.spi.ContentStorage.storeContent()

      ZipException, DecoderException {

    ContentStorage storage = new MongoContentStorage(getMongo().getDB(
        "test"));

    ContentPointer zip = storage.storeContent(getClass()
        .getResourceAsStream("mongodb.epub"));

    ZipFile.index(storage, zip);

    assertEquals("fc012bb0439382f709d3caebab958ff592811d17", DigestUtils
View Full Code Here

Examples of v7db.files.spi.ContentStorage.storeContent()

    ContentStorage storage = new MongoContentStorage(mongo.getDB("test")
        .getCollection("v7files.content"));

    byte[] data = "abcdefghijklmnopqrstuvwxyz".getBytes();

    ContentPointer pointer = storage.storeContent(new ByteArrayInputStream(
        data));
    Content check = storage.getContent(pointer);

    assertEquals(new String(data), IOUtils.toString(check.getInputStream()));
    assertEquals(data.length, check.getLength());
View Full Code Here

Examples of v7db.files.spi.ContentStorage.storeContent()

    for (int i = 1; i < args.length; i++) {
      File f = new File(args[i]);
      if (f.isFile() && f.canRead()) {
        try {
          ContentSHA up = storage
              .storeContent(new FileInputStream(f));

          // TODO: display if chunked or not
          System.out.format("-      %10d %80s %40s\n", f.length(), f
              .getName(), up.getDigest());
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.