Skip to content

Commit

Permalink
Merge branch 'develop' into fix-get-tokens-setstate
Browse files Browse the repository at this point in the history
  • Loading branch information
Phergus authored Feb 4, 2020
2 parents 775c7f2 + 5b5edcf commit 32909ea
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
12 changes: 9 additions & 3 deletions src/main/java/net/rptools/maptool/client/AppUpdate.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
import java.util.Properties;
import java.util.jar.*;
import javax.swing.*;
import net.rptools.maptool.language.I18N;
import net.sf.json.JSONArray;
import net.sf.json.JSONObject;
import okhttp3.OkHttpClient;
Expand Down Expand Up @@ -228,6 +229,12 @@ private static void downloadFile(URL assetDownloadURL, long assetDownloadSize) {

File saveLocation = chooser.getSelectedFile();

if (!saveLocation.canWrite()) {
String parent = saveLocation.getParent();
MapTool.showError(I18N.getText("msg.error.directoryNotWriteable", parent));
return;
}

log.info("URL: " + assetDownloadURL.toString());
log.info("assetDownloadSize: " + assetDownloadSize);

Expand All @@ -248,9 +255,8 @@ public void run() {
pm.setMaximum((int) assetDownloadSize);

FileUtils.copyInputStreamToFile(pmis, saveLocation);
} catch (IOException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
} catch (IOException ioe) {
MapTool.showError("msg.error.failedSavingNewVersion", ioe);
}
}
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1078,6 +1078,8 @@ msg.error.failedSaveCampaign = Could not save campaign.
msg.error.failedSaveCampaignOOM = <html>Out of memory while saving campaign!<p>Try creating a new/empty map and perform the save with that map active.
msg.error.failedSaveCampaignPreview = Could not save the campaign preview image.
msg.error.failedSaveMap = Could not save map.
msg.error.failedSavingNewVersion = Could not save the new version.
msg.error.directoryNotWriteable = Directory {0} is not writeable.
# When the user attempts to save the chat log and we fail, it's an Error.
# When we try to autosave the chat log and fail, it's a Warning.
# It's all about the semantics, baby. ;-)
Expand Down

0 comments on commit 32909ea

Please sign in to comment.