java.lang.Object | |
↳ | com.atlassian.core.util.FileUtils |
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
This method is deprecated.
since 3.18 use
copy(InputStream, OutputStream) | |||||||||||
This method is deprecated.
since 3.18 use
copy(InputStream, OutputStream) | |||||||||||
Copies all files from srcDir to destDir.
| |||||||||||
Save an input stream to a file, optionally overwriting the file if is exists.
| |||||||||||
Save an input stream to a file.
| |||||||||||
Copies a file to a new location, optionally overwriting an existing file in the new location.
| |||||||||||
Copy file from source to destination.
| |||||||||||
Create a zip file of a given directory.
| |||||||||||
safely performs a recursive delete on a directory
| |||||||||||
Check that a given file and its parent directories exist - will create blank file and all directories if necessary.
| |||||||||||
This method is deprecated.
since 3.18 use
toString(InputStream, String) | |||||||||||
Get the contents of a servlet context resource as a String.
| |||||||||||
Get the contents of a classpath resource as a String.
| |||||||||||
move a directory with all it's children into another directory
if destination directory already exists, it will be deleted.
| |||||||||||
Get the contents of a resource as a list, one line representing one list item.
| |||||||||||
Recursively delete everything beneath file then delete dir.
| |||||||||||
Writes text to the nominated file.
| |||||||||||
This method is deprecated.
since 3.18 use
closeQuietly(OutputStream) | |||||||||||
This method is deprecated.
since 3.18 use
closeQuietly(OutputStream) |
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() |
This method is deprecated.
since 3.18 use copy(InputStream, OutputStream)
Copy bytes from an InputStream
to an OutputStream
.
input | the InputStream to read from |
---|---|
output | the OutputStream to write to |
bufferSize | ignored |
IOException | In case of an I/O problem |
---|
This method is deprecated.
since 3.18 use copy(InputStream, OutputStream)
Copy bytes from an InputStream
to an OutputStream
.
input | the InputStream to read from |
---|---|
output | the OutputStream to write to |
IOException | In case of an I/O problem |
---|
Copies all files from srcDir to destDir. Currently it just copies the files at te root, it's not recursive.
IOException |
---|
Save an input stream to a file, optionally overwriting the file if is exists. The client is responsible for opening and closing the provided InputStream.
If overwrite is false and the file already exists, this method logs a warning and returns. If the parent directory of the destination file does not exist, it is created.srcStream | the input stream to save |
---|---|
destFile | the file to be saved, which can already exist if overwrite is set |
overwrite | true if an existing file should be overwritten |
IOException | if a problem occurs writing to the file, or the file exists and is read-only |
---|
Save an input stream to a file. The client is responsible for opening and closing the provided InputStream. If the file already exists, a warning will be logged and the method will not ovewrite it.
If the parent directory of the destination file does not exist, it is created.srcStream | the input stream to save |
---|---|
destFile | the file to be saved |
IOException | if a problem occurs writing to the file, or the file exists and is read-only |
---|
Copies a file to a new location, optionally overwriting an existing file in the new location.
If overwrite is false and the file already exists, this method logs a warning and returns. If the parent directory of the destination file does not exist, it is created. If the source file does not exist, this method throws an IOException. If the length of the two files are not the same after the copy completes,srcFile | the file to copy |
---|---|
destFile | the file to be saved, which can already exist if overwrite is set |
overwrite | true if an existing file should be overwritten |
IOException | if the source file does not exist, a problem occurs writing to the destination file, or the destination file exists and is read-only |
---|
Copy file from source to destination. The directories up to destination
will be
created if they don't already exist. destination
will be overwritten if it
already exists.
srcFile | An existing non-directory File to copy bytes from. |
---|---|
destFile | 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.
|
---|
Create a zip file of a given directory.
Exception |
---|
Check that a given file and its parent directories exist - will create blank file and all directories if necessary.
IOException |
---|
This method is deprecated.
since 3.18 use toString(InputStream, String)
Get the contents of an inputstream as a String.
Get the contents of a servlet context resource as a String. Returns an empty String ("") if the resource cannot be found or an error occurs reading the resource.
Get the contents of a classpath resource as a String. Returns null if the resource cannot be found or an error occurs reading the resource.
move a directory with all it's children into another directory if destination directory already exists, it will be deleted. e.g. rename c:/foo/bar to c:/fooz/bar
Get the contents of a resource as a list, one line representing one list item.
Note: lines starting with # are deemed to be comments and not included.Recursively delete everything beneath file then delete dir.
Writes text to the nominated file. If this file already exists, its content will be overwritten
IOException |
---|
This method is deprecated.
since 3.18 use closeQuietly(OutputStream)
Unconditionally close an OutputStream
.
Equivalent to close()
, except any exceptions will be ignored.
output | A (possibly null) OutputStream |
---|
This method is deprecated.
since 3.18 use closeQuietly(OutputStream)
Unconditionally close an InputStream
.
Equivalent to close()
, except any exceptions will be ignored.
input | A (possibly null) InputStream |
---|