aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/io/github/jshipit/BlobDownloader.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/io/github/jshipit/BlobDownloader.java')
-rw-r--r--src/main/java/io/github/jshipit/BlobDownloader.java22
1 files changed, 11 insertions, 11 deletions
diff --git a/src/main/java/io/github/jshipit/BlobDownloader.java b/src/main/java/io/github/jshipit/BlobDownloader.java
index 3aafec4..850e1ac 100644
--- a/src/main/java/io/github/jshipit/BlobDownloader.java
+++ b/src/main/java/io/github/jshipit/BlobDownloader.java
@@ -53,7 +53,6 @@ public class BlobDownloader extends Thread {
throw new RuntimeException("Failed : HTTP error code : "
+ con.getResponseCode());
} else {
- System.out.println("Success: " + con.getResponseCode());
}
} catch (IOException e) {
System.out.println("Failed to connect");
@@ -79,17 +78,18 @@ public class BlobDownloader extends Thread {
e.printStackTrace();
}
- if (this.renameTo == null) {
+ if (this.renameTo == null && !extract) {
+ return;
+ } else if (this.renameTo != null) {
+ Path rename = new File(renameTo).toPath();
+ Path current = new File(tmpdir + "/" + digest.replace("sha256:", "")+".tar.gz").toPath();
+ try {
+ Files.move(current, rename);
+ } catch (IOException e) {
+ System.out.println("Failed to rename file "+digest);
+ e.printStackTrace();
+ }
return;
- }
-
- Path rename = new File(renameTo).toPath();
- Path current = new File(tmpdir + "/" + digest.replace("sha256:", "")+".tar.gz").toPath();
- try {
- Files.move(current, rename);
- } catch (IOException e) {
- System.out.println("Failed to rename file "+digest);
- e.printStackTrace();
}
if (!extract) {