diff options
author | axtloss <axtlos@getcryst.al> | 2023-05-24 23:43:57 +0200 |
---|---|---|
committer | axtloss <axtlos@getcryst.al> | 2023-05-24 23:43:57 +0200 |
commit | 44ea7455e1f440a8df4070604213b390c21e7a3d (patch) | |
tree | 8c0cb535f4cb3588ef8bd610edfb418e15ec0ff2 /src/main/java/io/github/jshipit/BlobDownloader.java | |
parent | a881b5319b1a7d03f476231df9c8491fb4cdd451 (diff) | |
download | jshipit-44ea7455e1f440a8df4070604213b390c21e7a3d.tar.gz jshipit-44ea7455e1f440a8df4070604213b390c21e7a3d.tar.bz2 |
Add command line options
Diffstat (limited to '')
-rw-r--r-- | src/main/java/io/github/jshipit/BlobDownloader.java | 22 |
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) { |