Search Java Code Snippets


  Help us in improving the repository. Add new snippets through 'Submit Code Snippet ' link.





Java - Code Samples

 Sample 1. Code Sample / Example / Snippet of org.apache.storm.blobstore.AtomicOutputStream

    private static void createBlobWithContent(String blobKey, ClientBlobStore clientBlobStore, File file)

throws AuthorizationException, KeyAlreadyExistsException, IOException,KeyNotFoundException {

String stringBlobACL = "o::rwa";

AccessControl blobACL = BlobStoreAclHandler.parseAccessControl(stringBlobACL);

List<AccessControl> acls = new LinkedList<AccessControl>();

acls.add(blobACL); // more ACLs can be added here

SettableBlobMeta settableBlobMeta = new SettableBlobMeta(acls);

AtomicOutputStream blobStream = clientBlobStore.createBlob(blobKey,settableBlobMeta);

blobStream.write(readFile(file).toString().getBytes());

blobStream.close();

}


   Like      Feedback      org.apache.storm.blobstore.AtomicOutputStream



Subscribe to Java News and Posts. Get latest updates and posts on Java from Buggybread.com
Enter your email address:
Delivered by FeedBurner