Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 2 additions & 11 deletions src/main/java/doc/UnZip.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

import javax.swing.*;
import java.io.*;
import java.nio.file.Files;
import java.util.ArrayList;
import java.util.Enumeration;
import java.util.List;
Expand All @@ -23,17 +24,7 @@ public static File createTempDirectory()
throws IOException {
final File temp;

temp = File.createTempFile("temp", Long.toString(System.nanoTime()));

if(!(temp.delete()))
{
throw new IOException("Could not delete temp file: " + temp.getAbsolutePath());
}

if(!(temp.mkdir()))
{
throw new IOException("Could not create temp directory: " + temp.getAbsolutePath());
}
temp = Files.createTempDirectory("temp" + Long.toString(System.nanoTime())).toFile();

return (temp);
}
Expand Down
13 changes: 2 additions & 11 deletions src/main/java/doc_gui/NotebookPanel.java
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
import java.net.HttpURLConnection;
import java.net.URL;
import java.net.URLEncoder;
import java.nio.file.Files;
import java.util.Vector;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
Expand Down Expand Up @@ -878,17 +879,7 @@ public void save() {
public static File createTempDirectory() throws IOException{
final File temp;

temp = File.createTempFile("temp", Long.toString(System.nanoTime()));

if(!(temp.delete()))
{
throw new IOException("Could not delete temp file: " + temp.getAbsolutePath());
}

if(!(temp.mkdir()))
{
throw new IOException("Could not create temp directory: " + temp.getAbsolutePath());
}
temp = Files.createTempDirectory("temp" + Long.toString(System.nanoTime())).toFile();

return (temp);
}
Expand Down