Skip to content
Open
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
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
import java.io.InputStream;
import java.io.OutputStream;
import java.net.URL;
import java.nio.file.Files;
import java.util.HashMap;
import java.util.Map;

Expand Down Expand Up @@ -59,7 +60,7 @@ public static File getStreamAsFile(final InputStream is)
{
OutputStream os = null;
try {
final File f = File.createTempFile("dkpro_stream", "tmp");
final File f = Files.createTempFile("dkpro_stream", "tmp").toFile();
f.deleteOnExit();
os = new FileOutputStream(f);
IOUtils.copy(is, os);
Expand Down Expand Up @@ -111,7 +112,7 @@ public static synchronized File getUrlAsFile(URL aUrl, boolean aCache)

// Get a temporary file which will be deleted when the JVM shuts
// down.
file = File.createTempFile(name, suffix);
file = Files.createTempFile(name, suffix).toFile();
file.deleteOnExit();

// Now copy the file from the URL to the file.
Expand All @@ -135,4 +136,4 @@ public static synchronized File getUrlAsFile(URL aUrl, boolean aCache)

return file;
}
}
}