Examples of openOutputStream()


Examples of org.akubraproject.Blob.openOutputStream()

      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

Examples of org.akubraproject.Blob.openOutputStream()

    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

Examples of org.akubraproject.Blob.openOutputStream()

    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

Examples of org.akubraproject.Blob.openOutputStream()

          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

Examples of org.akubraproject.Blob.openOutputStream()

    // 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

Examples of org.akubraproject.Blob.openOutputStream()

            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

Examples of org.akubraproject.Blob.openOutputStream()

  }

  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

Examples of org.akubraproject.Blob.openOutputStream()

    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

Examples of org.eclipse.core.filesystem.IFileStore.openOutputStream()

    }

    if (!fileInfo.exists() || confirmOverwrite(fileStore)) {
      OutputStream output= null;
      try {
        output= new BufferedOutputStream(fileStore.openOutputStream(EFS.NONE, null));
        TemplateReaderWriter writer= new TemplateReaderWriter();
        writer.save(templates, output);
      } catch (CoreException e) {
        openWriteErrorDialog();
      } catch (IOException e) {
View Full Code Here

Examples of org.osgi.service.io.ConnectorService.openOutputStream()

        assertEquals("file://test.txt", connFactory.getName());
        assertEquals(ConnectorService.READ, connFactory.getMode());
        assertEquals(false, connFactory.isTimeout());
        assertNotNull("checks returned InputStream", inStream);

        OutputStream outStream = service.openOutputStream("file://test.txt");
        assertEquals("file://test.txt", connFactory.getName());
        assertEquals(ConnectorService.WRITE, connFactory.getMode());
        assertEquals(false, connFactory.isTimeout());
        assertNotNull("checks returned OutputStream", outStream);
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.