|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.atlassian.user.util.FileUtils
public class FileUtils
| Constructor Summary | |
|---|---|
FileUtils()
|
|
| Method Summary | |
|---|---|
static int |
copy(InputStream input,
OutputStream output)
Copy bytes from an InputStream to an OutputStream. |
static int |
copy(InputStream input,
OutputStream output,
int bufferSize)
Copy bytes from an InputStream to an OutputStream. |
static void |
copyFile(File source,
File destination)
Copy file from source to destination. |
static File |
copyIntoTemporaryFile(String source,
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(File dir)
safely performs a recursive delete on a directory |
static void |
deleteFilesBeginningWith(String directory,
String prefix)
|
static String |
getInputStreamTextContent(InputStream is)
|
static void |
shutdownStream(InputStream input)
Unconditionally close an InputStream. |
static void |
shutdownStream(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(File source,
File destination)
throws 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).
IOException - if source does not exist, destination cannot be
written to, or an IO error occurs during copying.
public static int copy(InputStream input,
OutputStream output)
throws IOException
InputStream to an OutputStream.
input - the InputStream to read fromoutput - the OutputStream to write to
IOException - In case of an I/O problem
public static int copy(InputStream input,
OutputStream output,
int bufferSize)
throws IOException
InputStream to an OutputStream.
input - the InputStream to read fromoutput - the OutputStream to write tobufferSize - Size of internal buffer to use.
IOException - In case of an I/O problempublic static void shutdownStream(OutputStream output)
OutputStream.
Equivalent to OutputStream.close(), except any exceptions will be ignored.
output - A (possibly null) OutputStreampublic static void shutdownStream(InputStream input)
InputStream.
Equivalent to InputStream.close(), except any exceptions will be ignored.
input - A (possibly null) InputStreampublic static boolean deleteDir(File dir)
dir -
public static void deleteFilesBeginningWith(String directory,
String prefix)
public static File copyIntoTemporaryFile(String source,
String fileName)
throws IOException,
Exception
fileName -
IOException
Exceptionpublic static String getInputStreamTextContent(InputStream is)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||