org.eclipse.mat.util
Class FileUtils

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

public final class FileUtils
extends java.lang.Object


Method Summary
static void copy(java.io.InputStream in, java.io.OutputStream out)
          Basic stream copy
static java.io.File createTempDirectory(java.lang.String prefix, java.io.File parent)
          Create a temporary directory which should be deleted on application close.
static java.lang.String toFilename(java.lang.String name, java.lang.String extension)
           
static java.lang.String toFilename(java.lang.String prefix, java.lang.String suffix, java.lang.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(java.io.InputStream in,
                              java.io.OutputStream out)
                       throws java.io.IOException
Basic stream copy

Parameters:
in - input stream
out - output stream
Throws:
java.io.IOException

createTempDirectory

public static java.io.File createTempDirectory(java.lang.String prefix,
                                               java.io.File parent)
                                        throws java.io.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:
java.io.IOException

toFilename

public static java.lang.String toFilename(java.lang.String name,
                                          java.lang.String extension)

toFilename

public static java.lang.String toFilename(java.lang.String prefix,
                                          java.lang.String suffix,
                                          java.lang.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