Fixed too large temp files creation for svg icons on startup

This commit is contained in:
Oleg Agafonov 2018-08-20 17:52:30 +04:00
parent 8b8392f42c
commit 09f5af154e
4 changed files with 46 additions and 22 deletions

View file

@ -325,6 +325,7 @@ public class DeckGeneratorDialog {
// Generated deck has a nice unique name which corresponds to the timestamp at which it was created.
String deckName = "Generated-Deck-" + dateFormat.format(new Date());
File tmp = new File(tempDir + File.separator + deckName + ".dck");
tmp.getParentFile().mkdirs();
tmp.createNewFile();
deck.setName(deckName);
Sets.saveDeck(tmp.getAbsolutePath(), deck.getDeckCardLists());

View file

@ -57,6 +57,7 @@ public final class SaveObjectUtil {
String time = now(DATE_PATTERN);
File f = new File("income" + File.separator + name + '_' + time + ".save");
if (!f.exists()) {
f.getParentFile().mkdirs();
f.createNewFile();
}
oos = new ObjectOutputStream(new FileOutputStream(f));