コード例 #1
0
 public BlobMetadata blobMetadata(String container, String name) {
   try {
     StorageObject storageObject = service.getStorageObject(container, name);
     return generateJcloudsMetadata(storageObject.getMetadata());
   } catch (FileNotExistsException e) {
     e.printStackTrace();
     return null;
   }
 }
コード例 #2
0
 public Blob getBlob(String container, String name) {
   try {
     StorageObject storageObject = service.getStorageObject(container, name);
     Blob blob = new BlobImpl(generateJcloudsMetadata(storageObject.getMetadata()));
     if (storageObject.getStream() != null) {
       blob.setPayload(storageObject.getStream());
       blob.getMetadata()
           .getContentMetadata()
           .setContentLength(storageObject.getMetadata().getLength());
     }
     return blob;
   } catch (FileNotExistsException e) {
     e.printStackTrace();
     return null;
   }
 }