com.Prominic.jFTPd
Class FileUtils
java.lang.Object
com.Prominic.jFTPd.FileUtils
public class FileUtils
- extends java.lang.Object
Method Summary |
(package private) static int |
copyStream(java.io.InputStream in,
java.io.OutputStream out)
Copies data from an InputStream to an OutputStream using a default buffer size |
(package private) static int |
copyStream(java.io.InputStream in,
java.io.OutputStream out,
int bufsize)
Copies data from an InputStream to an OutputStream with a caller-specified buffer size. |
(package private) static java.io.File |
getTempFile(java.lang.String id,
java.io.File near)
Create a uniquely named temporary file of the form XXX99999999.tmp. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
FileUtils
public FileUtils()
copyStream
static int copyStream(java.io.InputStream in,
java.io.OutputStream out)
throws java.io.IOException
- Copies data from an InputStream to an OutputStream using a default buffer size
- Parameters:
in
- - input streamout
- - output stream
- Returns:
- - amount of bytes copied
- Throws:
java.io.IOException
- thrown if something goes bad.
copyStream
static int copyStream(java.io.InputStream in,
java.io.OutputStream out,
int bufsize)
throws java.io.IOException
- Copies data from an InputStream to an OutputStream with a caller-specified buffer size.
- Parameters:
in
- - input streamout
- - output streambufsize
- - intermediate buffer size
- Returns:
- - number of bytes copied
- Throws:
java.io.IOException
- thrown if something goes bad.
getTempFile
static java.io.File getTempFile(java.lang.String id,
java.io.File near)
throws java.io.IOException
- Create a uniquely named temporary file of the form XXX99999999.tmp. E E *
- Parameters:
id
- a string prepended on the file generated.E Should you fail to delete
it later, the id will help identify where it came from. null and "" also allowed.near
- if null, the temporary file will be created in the current directory.
If near represents a file, the temporary file will be created in the E E * same directory as near.
If near represents a directory, the temporary file will be created in that
directory.
If near is invalid, then the temporary file will be created in the current
directory
- Returns:
- a temporary File with a unique name of the form XXX99999999.tmp.
- Throws:
java.io.IOException