org.sonar.api.utils
Class TempFileUtils
java.lang.Object
org.sonar.api.utils.TempFileUtils
public final class TempFileUtils
- extends Object
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
createTempDirectory
public static File createTempDirectory()
throws IOException
- Create a temporary directory. This directory is NOT deleted when the JVM stops, because using File#deleteOnExit()
is evil (google "deleteonExit evil"). Copied from http://stackoverflow.com/questions/617414/create-a-temporary-directory-in-java :
- deleteOnExit() only deletes for normal JVM shutdowns, not crashes or killing the JVM process
- deleteOnExit() only deletes on JVM shutdown - not good for long running server processes because 3 :
- The most evil of all - deleteOnExit() consumes memory for each temp file entry. If your process is running for months, or creates a lot of temp files in a short time, you consume memory and never release it until the JVM shuts down.
- Throws:
IOException
createTempDirectory
public static File createTempDirectory(String prefix)
throws IOException
- Throws:
IOException
Copyright © 2009-2011 SonarSource. All Rights Reserved.