Package org.akubraproject

Examples of org.akubraproject.Blob.openOutputStream()


    } catch (URISyntaxException e) {
      e.printStackTrace();
    }
    OutputStream out = null;
    try {
      out = blob.openOutputStream(-1, true);
    } catch (DuplicateBlobException e) {
      e.printStackTrace();
    } catch (IOException e) {
      e.printStackTrace();
    }
View Full Code Here


      throws UnsupportedOperationException, IOException {
    BlobStoreConnection connnection = blobStore.openConnection(null, null);
    try {
      Blob blob = connnection.getBlob(new URI(
          "info:fedora/bhle:10706-a000test/JPG"), null);
      blob.openOutputStream(-1, true);
    } catch (URISyntaxException e) {
      e.printStackTrace();
    }
  }
View Full Code Here

    if (blob == null && request.isOffline()) {
      blob = storage.fetchBlob((OfflineDownloadRequest) request);
    }
    OutputStream out = null;
    try {
      out = blob.openOutputStream(-1, true);
    } catch (DuplicateBlobException e) {
      e.printStackTrace();
    } catch (IOException e) {
      e.printStackTrace();
    }
View Full Code Here

    Blob b1 = con.getBlob(null, s1Hint);
    Blob b2 = con.getBlob(null, s2Hint);

    b1.openOutputStream(0, true).close();
    b2.openOutputStream(0, true).close();

    Set<Blob> blobs = new HashSet<Blob>();

    for (Iterator<URI> it = con.listBlobIds(null); it.hasNext();)
      blobs.add(con.getBlob(it.next(), null));
View Full Code Here

          if (isOutputSupp) {
            shouldFail(new ERunnable() {
              @Override
              public void erun() throws Exception {
                b.openOutputStream(-1, true);
              }
            }, IllegalStateException.class, null);
          }

          shouldFail(new ERunnable() {
View Full Code Here

    // check if create is supported
    if (!isOutputSupp) {
      shouldFail(new ConAction() {
        public void run(BlobStoreConnection con) throws Exception {
          Blob b = getBlob(con, createId("blobOutputStream1"), false);
          b.openOutputStream(-1, true).close();
        }
      }, UnsupportedOperationException.class, null);

      return;
    }
View Full Code Here

            throws IOException, UnsupportedOperationException {
    Blob blob = getBlob(null, hints);

    boolean success = false;
    try {
      OutputStream out = blob.openOutputStream(estimatedSize, true);
      try {
        IOUtils.copyLarge(content, out);
        out.close();
        out = null;
      } finally {
View Full Code Here

  }

  private static void addTestBlob(BlobStoreConnection connection,
                                  URI blobId) throws Exception {
    Blob blob = connection.getBlob(blobId, null);
    OutputStream out = blob.openOutputStream(-1, false);
    IOUtils.copy(new StringReader(blobId.toString()), out);
    out.close();
  }

}
View Full Code Here

    IdMapper mapper = new MockIdMapper();
    BlobStore store = new IdMappingBlobStore(URI.create("urn:test-store"),
        new MemBlobStore(), mapper);
    BlobStoreConnection connection = store.openConnection(null, null);
    Blob delegate = connection.getBlob(blobId, null);
    OutputStream out = delegate.openOutputStream(-1, false);
    IOUtils.copy(new StringReader(blobId.toString()), out);
    out.close();
    if (!delegateCanCanonicalize)
      delegate = new BlobWrapper(delegate) {
        @Override
View Full Code Here

        // write new content to origId/new
        Blob newBlob = null;
        try {
            newBlob = connection.getBlob(new URI(origId + "/new"), null);
            copy(content, newBlob.openOutputStream(-1, false));
        } catch (Throwable th) {
            // any error or exception here is an unrecoverable fault
            throw new FaultException(th);
        }
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.