|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.owasp.webscarab.util.TempDir
public class TempDir
Method Summary | |
---|---|
static java.io.File |
createTempDir(java.lang.String prefix,
java.lang.String suffix,
java.io.File directory)
Creates a new directory in the specified directory, using the given prefix and suffix strings to generate its name. |
static void |
recursiveCopy(java.io.File source,
java.io.File dest)
|
static boolean |
recursiveDelete(java.io.File dir)
Recursive delete files. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static java.io.File createTempDir(java.lang.String prefix, java.lang.String suffix, java.io.File directory) throws java.io.IOException
Creates a new directory in the specified directory, using the given prefix and suffix strings to generate its name. If this method returns successfully then it is guaranteed that:
#deleteOnExit
method.
The prefix
argument must be at least three characters
long. It is recommended that the prefix be a short, meaningful string
such as "hjb"
or "mail"
. The
suffix
argument may be null
, in which case the
suffix ".tmp"
will be used.
To create the new file, the prefix and the suffix may first be
adjusted to fit the limitations of the underlying platform. If the
prefix is too long then it will be truncated, but its first three
characters will always be preserved. If the suffix is too long then it
too will be truncated, but if it begins with a period character
('.'
) then the period and the first three characters
following it will always be preserved. Once these adjustments have been
made the name of the new file will be generated by concatenating the
prefix, five or more internally-generated characters, and the suffix.
If the directory
argument is null
then the
system-dependent default temporary-file directory will be used. The
default temporary-file directory is specified by the system property
java.io.tmpdir
. On UNIX systems the default value of this
property is typically "/tmp"
or "/var/tmp"
; on
Microsoft Windows systems it is typically "c:\\temp"
. A different
value may be given to this system property when the Java virtual machine
is invoked, but programmatic changes to this property are not guaranteed
to have any effect upon the the temporary directory used by this method.
prefix
- The prefix string to be used in generating the file's
name; must be at least three characters longsuffix
- The suffix string to be used in generating the file's
name; may be null
, in which case the
suffix ".tmp"
will be useddirectory
- The directory in which the file is to be created, or
null
if the default temporary-file
directory is to be used
java.lang.IllegalArgumentException
- If the prefix
argument contains fewer than three
characters
java.io.IOException
- If a file could not be created
java.lang.SecurityException
- If a security manager exists and its SecurityManager.checkWrite(java.lang.String)
method does not allow a file to be createdpublic static boolean recursiveDelete(java.io.File dir)
public static void recursiveCopy(java.io.File source, java.io.File dest) throws java.io.IOException
java.io.IOException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |