|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectcom.atlassian.user.util.FileUtils
| Constructor Summary | |
FileUtils()
|
|
| Method Summary | |
static int |
copy(java.io.InputStream input,
java.io.OutputStream output)
Copy bytes from an InputStream to an OutputStream. |
static int |
copy(java.io.InputStream input,
java.io.OutputStream output,
int bufferSize)
Copy bytes from an InputStream to an OutputStream. |
static void |
copyFile(java.io.File source,
java.io.File destination)
Copy file from source to destination. |
static java.io.File |
copyIntoTemporaryFile(java.lang.String source,
java.lang.String fileName)
creates a temp file with a given filename from an input stream in the classpath or a file in the filesystem |
static boolean |
deleteDir(java.io.File dir)
safely performs a recursive delete on a directory |
static void |
deleteFilesBeginningWith(java.lang.String directory,
java.lang.String prefix)
|
static java.lang.String |
getInputStreamTextContent(java.io.InputStream is)
|
static void |
shutdownStream(java.io.InputStream input)
Unconditionally close an InputStream. |
static void |
shutdownStream(java.io.OutputStream output)
Unconditionally close an OutputStream. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public FileUtils()
| Method Detail |
public static void copyFile(java.io.File source,
java.io.File destination)
throws java.io.IOException
destination will be
created if they don't already exist. destination will be overwritten if it
already exists.
source - An existing non-directory File to copy bytes from.destination - A non-directory File to write bytes to (possibly
overwriting).
java.io.IOException - if source does not exist, destination cannot be
written to, or an IO error occurs during copying.
public static int copy(java.io.InputStream input,
java.io.OutputStream output)
throws java.io.IOException
InputStream to an OutputStream.
input - the InputStream to read fromoutput - the OutputStream to write to
java.io.IOException - In case of an I/O problem
public static int copy(java.io.InputStream input,
java.io.OutputStream output,
int bufferSize)
throws java.io.IOException
InputStream to an OutputStream.
input - the InputStream to read fromoutput - the OutputStream to write tobufferSize - Size of internal buffer to use.
java.io.IOException - In case of an I/O problempublic static void shutdownStream(java.io.OutputStream output)
OutputStream.
Equivalent to OutputStream.close(), except any exceptions will be ignored.
output - A (possibly null) OutputStreampublic static void shutdownStream(java.io.InputStream input)
InputStream.
Equivalent to InputStream.close(), except any exceptions will be ignored.
input - A (possibly null) InputStreampublic static boolean deleteDir(java.io.File dir)
dir -
public static void deleteFilesBeginningWith(java.lang.String directory,
java.lang.String prefix)
public static java.io.File copyIntoTemporaryFile(java.lang.String source,
java.lang.String fileName)
throws java.io.IOException,
java.lang.Exception
fileName -
java.io.IOException
java.lang.Exceptionpublic static java.lang.String getInputStreamTextContent(java.io.InputStream is)
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||