Skip to content

Commit e815a18

Browse files
author
Guzman, David
committed
Deprecating old methods
1 parent c2d83de commit e815a18

File tree

1 file changed

+46
-0
lines changed
  • micro-s3/src/main/java/com/aol/micro/server/s3/data

1 file changed

+46
-0
lines changed

micro-s3/src/main/java/com/aol/micro/server/s3/data/S3Utils.java

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,15 @@
88
import java.util.List;
99
import java.util.concurrent.ExecutorService;
1010
import java.util.function.Function;
11+
import java.util.function.Supplier;
1112

1213
import org.springframework.beans.factory.annotation.Autowired;
1314
import org.springframework.beans.factory.annotation.Qualifier;
1415
import org.springframework.beans.factory.annotation.Value;
1516
import org.springframework.stereotype.Component;
1617

18+
import com.amazonaws.AmazonClientException;
19+
import com.amazonaws.AmazonServiceException;
1720
import com.amazonaws.services.s3.AmazonS3Client;
1821
import com.amazonaws.services.s3.model.DeleteObjectsRequest;
1922
import com.amazonaws.services.s3.model.DeleteObjectsRequest.KeyVersion;
@@ -147,6 +150,49 @@ public void delete(String bucketName, List<KeyVersion> objects) {
147150
public static InputStream emptyInputStream() {
148151
return emptyInputStream;
149152
}
153+
154+
/**
155+
* Method returns InputStream from S3Object. Multi-part download is used to
156+
* get file. s3.tmp.dir property used to store temporary files.
157+
*
158+
* @param bucketName
159+
* @param key
160+
* @return
161+
* @throws AmazonServiceException
162+
* @throws AmazonClientException
163+
* @throws InterruptedException
164+
* @throws IOException
165+
*
166+
* This method is deprecated as it is now provided by ReadUtils
167+
*/
168+
@Deprecated
169+
public InputStream getInputStream(String bucketName, String key)
170+
throws AmazonServiceException, AmazonClientException, InterruptedException, IOException{
171+
return readUtils.getInputStream(bucketName, key);
172+
}
173+
174+
/**
175+
* Method returns InputStream from S3Object. Multi-part download is used to
176+
* get file. s3.tmp.dir property used to store temporary files. You can
177+
* specify temporary file name by using tempFileSupplier object.
178+
*
179+
* @param bucketName
180+
* @param key
181+
* -
182+
* @param tempFileSupplier
183+
* - Supplier providing temporary filenames
184+
* @return InputStream of
185+
* @throws AmazonServiceException
186+
* @throws AmazonClientException
187+
* @throws InterruptedException
188+
* @throws IOException
189+
*
190+
* This method is deprecated as it is now provided by ReadUtils
191+
*/
192+
@Deprecated
193+
public InputStream getInputStream(String bucketName, String key, Supplier<File> tempFileSupplier) throws AmazonServiceException, AmazonClientException, InterruptedException, IOException{
194+
return readUtils.getInputStream(bucketName, key, tempFileSupplier);
195+
}
150196

151197
static class EmptyInputStream extends InputStream {
152198

0 commit comments

Comments
 (0)