From 2a966dfc7aa199d5221b66ee43b88b625e61cbc0 Mon Sep 17 00:00:00 2001 From: Rafal Korytkowski Date: Fri, 15 Dec 2017 16:16:58 +0100 Subject: [PATCH] Delete OWA if exists --- .../main/java/org/openmrs/maven/plugins/bintray/Bintray.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/maven-plugin/src/main/java/org/openmrs/maven/plugins/bintray/Bintray.java b/maven-plugin/src/main/java/org/openmrs/maven/plugins/bintray/Bintray.java index 87887d27..6a4d16ee 100644 --- a/maven-plugin/src/main/java/org/openmrs/maven/plugins/bintray/Bintray.java +++ b/maven-plugin/src/main/java/org/openmrs/maven/plugins/bintray/Bintray.java @@ -113,7 +113,7 @@ public File downloadFile(BintrayFile file, File destDirectory, String filename){ } File destFile = new File(destDirectory, filename); if(destFile.exists()){ - throw new RuntimeException("Cannot overwrite file: "+file.getPath()); + destFile.delete(); } String url = String.format("https://dl.bintray.com/%s/%s/%s", file.getOwner(), file.getRepository(), file.getPath()); URL fileUrl = new URL(url);