org.sonar.api.utils
Class TempFileUtils

java.lang.Object
  extended by org.sonar.api.utils.TempFileUtils

Deprecated. since 4.0 use TempFolder

@Deprecated
public final class TempFileUtils
extends Object


Method Summary
static File createTempDirectory()
          Deprecated. Create a temporary directory.
static File createTempDirectory(String prefix)
          Deprecated.  
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

createTempDirectory

public static File createTempDirectory()
                                throws IOException
Deprecated. 
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 :
  1. deleteOnExit() only deletes for normal JVM shutdowns, not crashes or killing the JVM process
  2. deleteOnExit() only deletes on JVM shutdown - not good for long running server processes because 3 :
  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
Deprecated. 
Throws:
IOException


Copyright © 2009–2015 SonarSource. All rights reserved.