|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.acm.seguin.io.FileCopy
public class FileCopy
Responsible for copying a file from one location to another. This object is implemented as a thread so that if the user of this object does not care when the copy is complete, they can set the parameters and then launch the thread.
To perform other operations on the streams while copying the thread, simply overload the getInputStream or getOutputStream operations.
Constructor Summary | |
---|---|
FileCopy(java.io.File src,
java.io.File dst)
Constructor for the FileCopy object |
|
FileCopy(java.io.File src,
java.io.File dst,
boolean isNoisy)
Create a file copy thread |
Method Summary | |
---|---|
protected java.io.InputStream |
getInputStream()
Gets the InputStream attribute of the FileCopy object |
protected java.io.OutputStream |
getOutputStream()
Gets the OutputStream attribute of the FileCopy object |
static void |
main(java.lang.String[] args)
Tester |
void |
run()
Copy the thread |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public FileCopy(java.io.File src, java.io.File dst)
src
- the sourcedst
- the destinationpublic FileCopy(java.io.File src, java.io.File dst, boolean isNoisy)
src
- the sourcedst
- the destinationisNoisy
- is this thread supposed to report on it's progressMethod Detail |
---|
public void run()
run
in interface java.lang.Runnable
protected java.io.InputStream getInputStream() throws java.io.IOException
FileNotFoundException
- Unable to open the file
java.io.IOException
protected java.io.OutputStream getOutputStream() throws java.io.IOException
FileNotFoundException
- Unable to open the file
java.io.IOException
public static void main(java.lang.String[] args)
args
- The command line arguments
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |