org.eclipse.mat.util
Class FileUtils

java.lang.Object
  extended by org.eclipse.mat.util.FileUtils

public final class FileUtils
extends Object


Method Summary
static void copy(InputStream in, OutputStream out)
          Basic stream copy
static File createTempDirectory(String prefix, File parent)
          Create a temporary directory which should be deleted on application close.
static String toFilename(String name, String extension)
           
static String toFilename(String prefix, String suffix, String extension)
          Build a file name.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

copy

public static final void copy(InputStream in,
                              OutputStream out)
                       throws IOException
Basic stream copy

Parameters:
in - input stream
out - output stream
Throws:
IOException

createTempDirectory

public static File createTempDirectory(String prefix,
                                       File parent)
                                throws IOException
Create a temporary directory which should be deleted on application close.

Parameters:
prefix -
parent -
Returns:
the temporary directory, to be deleted on shutdown
Throws:
IOException

toFilename

public static String toFilename(String name,
                                String extension)

toFilename

public static String toFilename(String prefix,
                                String suffix,
                                String extension)
Build a file name. Convert non-letters or digits to underscore.

Parameters:
prefix - the prefix of the file
suffix - the suffix
extension - the file extension
Returns:
the combined file name