When creating a new input stream with the API call Files.newInputStream a AmazonS3Exception is thrown instead of a NoSuchFileException resulting in the following strack trace:
com.amazonaws.services.s3.model.AmazonS3Exception: The specified key does not exist.
at com.amazonaws.http.AmazonHttpClient.handleErrorResponse(AmazonHttpClient.java:679) ~[aws-java-sdk-1.5.6.jar:na]
at com.amazonaws.http.AmazonHttpClient.executeHelper(AmazonHttpClient.java:350) ~[aws-java-sdk-1.5.6.jar:na]
at com.amazonaws.http.AmazonHttpClient.execute(AmazonHttpClient.java:202) ~[aws-java-sdk-1.5.6.jar:na]
at com.amazonaws.services.s3.AmazonS3Client.invoke(AmazonS3Client.java:3037) ~[aws-java-sdk-1.5.6.jar:na]
at com.amazonaws.services.s3.AmazonS3Client.getObject(AmazonS3Client.java:955) ~[aws-java-sdk-1.5.6.jar:na]
at com.amazonaws.services.s3.AmazonS3Client.getObject(AmazonS3Client.java:845) ~[aws-java-sdk-1.5.6.jar:na]
at com.upplication.s3fs.AmazonS3Client.getObject(AmazonS3Client.java:80) ~[nxf-s3fs-0.2.8b.jar:na]
at com.upplication.s3fs.S3FileSystemProvider.newInputStream(S3FileSystemProvider.java:258) ~[nxf-s3fs-0.2.8b.jar:na]
at java.nio.file.Files.newInputStream(Files.java:108) ~[na:1.7.0_75]
When creating a new input stream with the API call
Files.newInputStream
aAmazonS3Exception
is thrown instead of aNoSuchFileException
resulting in the following strack trace:The proposed pull request fix this issue.