This commit is contained in:
Julian Dolby 2017-07-30 18:08:06 -04:00
parent 9dda017450
commit f5aaa67598
2 changed files with 4 additions and 16 deletions

View File

@ -55,11 +55,4 @@
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>1.6.0</version>
</dependency>
</dependencies>
</project>

View File

@ -20,20 +20,15 @@ import java.nio.file.Path;
public class TemporaryFile {
private final static Path outputDir;
static {
try {
outputDir = Files.createTempDirectory("wala");
} catch (IOException e) {
throw new RuntimeException(e);
}
}
private static Path outputDir;
public static File urlToFile(String fileName, URL input) throws IOException {
if (input == null) {
throw new NullPointerException("input == null");
}
if (outputDir == null) {
outputDir = Files.createTempDirectory("wala");
}
Path filePath = outputDir.resolve(fileName);
return urlToFile(filePath.toFile(), input);
}