/** * Returns an object representing the details and data of an item in a service, * without applying any preconditions. * <p> * This method can be performed by anonymous services. Anonymous services * can get a publicly-readable object. * <p> * <b>Important:</b> It is the caller's responsibility to close the object's data input stream. * The data stream should be consumed and closed as soon as is practical as network connections * may be held open until the streams are closed. Excessive unclosed streams can lead to * connection starvation. * * @param bucketName * the name of the bucket containing the object. * @param objectKey * the key identifying the object. * @return * the object with the given key, including the object's data input stream. * @throws ServiceException */ public StorageObject getObject(String bucketName, String objectKey) throws ServiceException { return getObject(bucketName, objectKey, null, null, null, null, null, null); }
public void run() { try { if (headOnly) { result = storageService.getObjectDetails( bucketName, objectKey, null, null, null, null); } else { result = storageService.getObject( bucketName, objectKey); } } catch (ServiceException e) { if (this.errorPermitter != null && this.errorPermitter.isPermitted(e)) { result = new ThrowableBearingStorageObject(this.objectKey, e); } else { result = e; } } }
public void run() { try { if (headOnly) { result = storageService.getObjectDetails( bucketName, objectKey, null, null, null, null); } else { result = storageService.getObject( bucketName, objectKey); } } catch (ServiceException e) { if (this.errorPermitter != null && this.errorPermitter.isPermitted(e)) { result = new ThrowableBearingStorageObject(this.objectKey, e); } else { result = e; } } }
/** * Returns an object representing the details and data of an item in a service, * without applying any preconditions. * <p> * This method can be performed by anonymous services. Anonymous services * can get a publicly-readable object. * <p> * <b>Important:</b> It is the caller's responsibility to close the object's data input stream. * The data stream should be consumed and closed as soon as is practical as network connections * may be held open until the streams are closed. Excessive unclosed streams can lead to * connection starvation. * * @param bucketName * the name of the bucket containing the object. * @param objectKey * the key identifying the object. * @return * the object with the given key, including the object's data input stream. * @throws ServiceException */ public StorageObject getObject(String bucketName, String objectKey) throws ServiceException { return getObject(bucketName, objectKey, null, null, null, null, null, null); }
credentials = null; StorageService service = getStorageService(); encryptedCredentialsObject = service.getObject( bucketName[0], credentialObjectKey[0]); } catch (ServiceException e) {
credentials = null; StorageService service = getStorageService(); encryptedCredentialsObject = service.getObject( bucketName[0], credentialObjectKey[0]); } catch (ServiceException e) {
object = storageService.getObject( bucketName, objectKey);
object = storageService.getObject( bucketName, objectKey);
@Override public InputStream openStream() throws IOException { try { final long start; final long end = objectDetails.getContentLength() - 1; if (offset > 0 && offset < objectDetails.getContentLength()) { start = offset; } else if (offset < 0 && (-1 * offset) < objectDetails.getContentLength()) { start = objectDetails.getContentLength() + offset; } else { start = 0; } return service.getObject( config.getS3Bucket(), taskKey, null, null, new String[]{objectDetails.getETag()}, null, start, end ).getDataInputStream(); } catch (ServiceException e) { throw new IOException(e); } } }