merge
This commit is contained in:
parent
9dda017450
commit
f5aaa67598
|
@ -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>
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue