Skip to content

Commit

Permalink
fix: temp file existence checking is wrong getObject method (#387)
Browse files Browse the repository at this point in the history
Previously in getObject method, temp file existence check is wrongly
with actual file name. This causes exception when the destination file
exists.
This patch fixes the issue.
  • Loading branch information
balamurugana authored and harshavardhana committed May 29, 2016
1 parent dd57cd0 commit b5d5fe1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/main/java/io/minio/MinioClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -1180,7 +1180,7 @@ public void getObject(String bucketName, String objectName, String fileName)

String tempFileName = fileName + "." + etag + ".part.minio";
Path tempFilePath = Paths.get(tempFileName);
boolean tempFileExists = Files.exists(filePath);
boolean tempFileExists = Files.exists(tempFilePath);

if (tempFileExists && !Files.isRegularFile(tempFilePath)) {
throw new IOException(tempFileName + ": not a regular file");
Expand Down

0 comments on commit b5d5fe1

Please sign in to comment.