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
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
import java.io.FileWriter;
import java.io.IOException;
import java.io.StringWriter;
import java.nio.file.Files;
import java.util.List;
import java.util.Set;

Expand Down Expand Up @@ -153,17 +154,7 @@ public void run()
private static File createTempDirectory( File baseTmpDirectory )
throws IOException
{
final File temp = File.createTempFile( "temp", Long.toString( System.nanoTime() ), baseTmpDirectory );

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() );
}
final File temp = Files.createTempDirectory(baseTmpDirectory.toPath(), "temp" + Long.toString(System.nanoTime())).toFile();

return temp;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@
import java.net.URISyntaxException;
import java.net.URL;
import java.net.URLClassLoader;
import java.nio.file.Files;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Enumeration;
Expand Down Expand Up @@ -182,17 +183,7 @@ public void run()
private static File createTempDirectory( File baseTmpDirectory )
throws IOException
{
final File temp = File.createTempFile( "temp", Long.toString( System.nanoTime() ), baseTmpDirectory );

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() );
}
final File temp = Files.createTempDirectory(baseTmpDirectory.toPath(), "temp" + Long.toString(System.nanoTime())).toFile();

return temp;
}
Expand Down