mirror of
https://github.com/ysoftdevs/DependencyCheck.git
synced 2026-03-21 08:39:24 +01:00
fixed bug related to temp files
Former-commit-id: 3d1a5c6d30411ab026b2f072a8aee25106bf9691
This commit is contained in:
@@ -337,7 +337,7 @@ public final class Settings {
|
|||||||
*/
|
*/
|
||||||
public static void cleanup(boolean deleteTemporary) {
|
public static void cleanup(boolean deleteTemporary) {
|
||||||
if (deleteTemporary && tempDirectory != null && tempDirectory.exists()) {
|
if (deleteTemporary && tempDirectory != null && tempDirectory.exists()) {
|
||||||
FileUtils.delete(tempDirectory);
|
//FileUtils.delete(tempDirectory);
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
localSettings.remove();
|
localSettings.remove();
|
||||||
@@ -586,15 +586,14 @@ public final class Settings {
|
|||||||
* @throws java.io.IOException thrown if the temporary directory does not exist and cannot be created
|
* @throws java.io.IOException thrown if the temporary directory does not exist and cannot be created
|
||||||
*/
|
*/
|
||||||
public static File getTempDirectory() throws IOException {
|
public static File getTempDirectory() throws IOException {
|
||||||
final File tmpDir = new File(Settings.getString(Settings.KEYS.TEMP_DIRECTORY, System.getProperty("java.io.tmpdir")));
|
final File tmpDir = new File(Settings.getString(Settings.KEYS.TEMP_DIRECTORY, System.getProperty("java.io.tmpdir")), "dctemp");
|
||||||
if (!tmpDir.exists()) {
|
if (!tmpDir.exists()) {
|
||||||
if (!tmpDir.mkdirs()) {
|
if (!tmpDir.mkdirs()) {
|
||||||
final String msg = String.format("Unable to make a temporary folder '%s'", tmpDir.getPath());
|
final String msg = String.format("Unable to make a temporary folder '%s'", tmpDir.getPath());
|
||||||
throw new IOException(msg);
|
throw new IOException(msg);
|
||||||
} else {
|
|
||||||
tempDirectory = tmpDir;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
tempDirectory = tmpDir;
|
||||||
return tmpDir;
|
return tmpDir;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user