[Mulgara-svn] r1436 - trunk/src/jar/util/java/org/mulgara/util
ronald at mulgara.org
ronald at mulgara.org
Mon Jan 19 11:27:49 UTC 2009
Author: ronald
Date: 2009-01-19 03:27:48 -0800 (Mon, 19 Jan 2009)
New Revision: 1436
Modified:
trunk/src/jar/util/java/org/mulgara/util/TempDir.java
Log:
Code formatting and imports cleanup.
Modified: trunk/src/jar/util/java/org/mulgara/util/TempDir.java
===================================================================
--- trunk/src/jar/util/java/org/mulgara/util/TempDir.java 2009-01-16 18:43:46 UTC (rev 1435)
+++ trunk/src/jar/util/java/org/mulgara/util/TempDir.java 2009-01-19 11:27:48 UTC (rev 1436)
@@ -28,7 +28,8 @@
package org.mulgara.util;
// Java 2 standard packages
-import java.io.*;
+import java.io.File;
+import java.io.IOException;
// Third party packages
import org.apache.log4j.Logger;
@@ -38,40 +39,26 @@
* Manages the creation of temporary files in a controlled location.
*
* @created 2004-12-03
- *
* @author David Makepeace
- *
* @version $Revision: 1.9 $
- *
* @modified $Date: 2005/01/05 04:59:29 $
- *
* @maintenanceAuthor $Author: newmana $
- *
* @company <A href="mailto:info at PIsoftware.com">Plugged In Software</A>
- *
- * @copyright ©2001 <a href="http://www.pisoftware.com/">Plugged In
- * Software Pty Ltd</a>
+ * @copyright ©2001 <a href="http://www.pisoftware.com/">Plugged In Software Pty Ltd</a>
* @licence <a href="{@docRoot}/../../LICENCE">Mozilla Public License v1.1</a>
*/
public final class TempDir {
+ /** Logger. */
+ private static final Logger logger = Logger.getLogger(TempDir.class);
+ private static final File systemTempDir = new File(System.getProperty("java.io.tmpdir"));
- /**
- * Logger.
- */
- private final static Logger logger = Logger.getLogger(TempDir.class);
-
- private static final File systemTempDir =
- new File(System.getProperty("java.io.tmpdir"));
-
private static File tempDir = null;
public static synchronized File getTempDir() {
if (tempDir == null) {
// Initialize tempDir.
- File dir = new File(
- systemTempDir, "mulgara_" + System.getProperty("user.name")
- );
+ File dir = new File(systemTempDir, "mulgara_" + System.getProperty("user.name"));
dir.mkdirs();
if (dir.isDirectory()) {
tempDir = dir;
@@ -85,9 +72,7 @@
// The temporary directory has gone away! This is a fatal error because,
// for security reasons, we don't want to just revert to using the system
// temporary directory.
- logger.error(
- "The temporary directory no longer exists! (" + tempDir + ")"
- );
+ logger.error("The temporary directory no longer exists! (" + tempDir + ")");
System.exit(1);
}
@@ -100,9 +85,7 @@
throw new IllegalArgumentException("dir is null");
}
if (!dir.isDirectory()) {
- throw new IllegalArgumentException(
- "dir (" + dir + ") is not a directory"
- );
+ throw new IllegalArgumentException("dir (" + dir + ") is not a directory");
}
tempDir = dir;
}
@@ -111,10 +94,7 @@
/**
* Creates an empty file in the current mulgara temp directory.
*/
- public static synchronized File createTempFile(
- String prefix, String suffix
- ) throws IOException {
+ public static synchronized File createTempFile(String prefix, String suffix) throws IOException {
return File.createTempFile(prefix, suffix, getTempDir());
}
-
}
More information about the Mulgara-svn
mailing list