List of usage examples for com.amazonaws.services.s3.transfer Upload abort
public void abort();
From source file:com.liferay.portal.store.s3.S3Store.java
License:Open Source License
protected void putObject(long companyId, long repositoryId, String fileName, String versionLabel, File file) throws PortalException { Upload upload = null; try {//from w ww. j a v a 2s . c om String key = _s3KeyTransformer.getFileVersionKey(companyId, repositoryId, fileName, versionLabel); PutObjectRequest putObjectRequest = new PutObjectRequest(_bucketName, key, file); putObjectRequest.withStorageClass(_storageClass); upload = _transferManager.upload(putObjectRequest); upload.waitForCompletion(); } catch (AmazonClientException ace) { throw transform(ace); } catch (InterruptedException ie) { upload.abort(); Thread thread = Thread.currentThread(); thread.interrupt(); } }