Removed an unused import and combined nested if statements.

This commit is contained in:
Anthony Whitford
2015-09-07 14:38:43 -07:00
parent 83263f8dee
commit 115f63c330

View File

@@ -31,7 +31,6 @@ import java.io.UnsupportedEncodingException;
import java.net.URLDecoder; import java.net.URLDecoder;
import java.util.Enumeration; import java.util.Enumeration;
import java.util.Properties; import java.util.Properties;
import java.util.logging.Level;
/** /**
* A simple settings container that wraps the dependencycheck.properties file. * A simple settings container that wraps the dependencycheck.properties file.
@@ -626,11 +625,9 @@ public final class Settings {
*/ */
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")), "dctemp"); final File tmpDir = new File(Settings.getString(Settings.KEYS.TEMP_DIRECTORY, System.getProperty("java.io.tmpdir")), "dctemp");
if (!tmpDir.exists()) { if (!tmpDir.exists() && !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);
}
} }
tempDirectory = tmpDir; tempDirectory = tmpDir;
return tmpDir; return tmpDir;