com.amazonaws.services.s3.transfer.model.UploadResult Java Examples

The following examples show how to use com.amazonaws.services.s3.transfer.model.UploadResult. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: S3UploadSystemTest.java    From micro-server with Apache License 2.0 6 votes vote down vote up
@Test
@Ignore
@Repeat(times = 1, threads = 4)
public void upload() {
    S3ObjectWriter writerWithoutEncryption = buildWriterWithEncryption(false);
    long startNE = System.currentTimeMillis();
    Try<UploadResult, Throwable> uploadWithoutEncryption = writerWithoutEncryption.putSync("uploadWithoutEncryption" + r.nextLong(), nullableFile.get());
    long endNE = System.currentTimeMillis();
    assertTrue(uploadWithoutEncryption.isSuccess());
    unencryptedHist.update(endNE - startNE);

    S3ObjectWriter writerWithEncryption = buildWriterWithEncryption(true);
    long startWE = System.currentTimeMillis();
    Try<UploadResult, Throwable> uploadWithEncryption = writerWithEncryption.putSync("uploadWithEncryption" + r.nextLong(), nullableFile.get());
    assertTrue(uploadWithEncryption.isSuccess());
    long endWE = System.currentTimeMillis();
    aes256Hist.update(endWE - startWE);
    
    
}
 
Example #2
Source File: S3UploadHandle.java    From secor with Apache License 2.0 4 votes vote down vote up
public UploadResult get() throws Exception {
    return mUpload.waitForUploadResult();
}
 
Example #3
Source File: S3ObjectWriter.java    From micro-server with Apache License 2.0 3 votes vote down vote up
/**
 * Non-blocking call that will throw any Exceptions in the traditional
 * manner on access
 * 
 * @param key
 * @param value
 * @return
 */
public Eval<UploadResult> putAsync(String key, Object value) {
    return Eval.later(() -> put(key, value))
               .map(t -> t.orElse(null))
               .map(FluentFunctions.ofChecked(up -> up.waitForUploadResult()));

}
 
Example #4
Source File: S3ObjectWriter.java    From micro-server with Apache License 2.0 2 votes vote down vote up
/**
 * Blocking call
 * 
 * @param key
 *            with which to store data
 * @param value
 *            Data value
 * @return Try with completed result of operation
 */
public Try<UploadResult, Throwable> putSync(String key, Object value) {
    return put(key, value).map(FluentFunctions.ofChecked(i -> i.waitForUploadResult()));
}