org.oddjob.io
Class CopyJob

java.lang.Object
  extended by org.oddjob.io.CopyJob
All Implemented Interfaces:
Serializable, Runnable

public class CopyJob
extends Object
implements Runnable, Serializable

Description

A Copy job. Copy either:

Example

Copy a file.
<oddjob id="this">
    <job>
        <copy to="${this.args[0]}/work/io/copy">
            <from>
                <file file="${this.args[0]}/test/io/reference/test1.txt"/>
            </from>
        </copy>
    </job>
</oddjob>

Example

Copy a directory.
<oddjob id="this">
    <job>
        <copy to="${this.args[0]}/work/io/copy">
            <from>
                <file file="${this.args[0]}/test/io/reference/a"/>
            </from>
        </copy>
    </job>
</oddjob>

Example

Copy from a file to a buffer.
<oddjob id="this">
    <job>
        <sequential>
            <jobs>
                <copy name="Copy from a file to a buffer">
                    <from>
                        <file file="${this.args[0]}/test/io/reference/test1.txt"/>
                    </from>
                    <output>
                        <identify id="buff">
                            <value>
                                <buffer/>
                            </value>
                        </identify>

                    </output>
                </copy>
                <echo id="e" name="What's in the file?">${buff}</echo>
            </jobs>
        </sequential>
    </job>
</oddjob>
See Also:
Serialized Form

Constructor Summary
CopyJob()
           
 
Method Summary
 int getDirectoriesCopied()
           
 int getFilesCopied()
           
 File[] getFrom()
          Get the from file.
 InputStream getInput()
           
 String getName()
          Get the name.
 OutputStream getOutput()
           
 File getTo()
          Get the to file.
 void run()
           
 void setFrom(File[] file)
          Set the from file.
 void setInput(InputStream in)
          Set the InputStream.
 void setName(String name)
          Set the name
 void setOutput(OutputStream out)
          Set the OutputStream.
 void setTo(File file)
          Set the to file.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

CopyJob

public CopyJob()
Method Detail

getName

public String getName()
Get the name.

Returns:
The name.

setName

public void setName(String name)
Set the name

Parameters:
name - The name.

getFrom

public File[] getFrom()
Get the from file.

Returns:
The from file.

setFrom

public void setFrom(File[] file)
Set the from file.

Parameters:
The - from file.

getTo

public File getTo()
Get the to file.

Returns:
The to file.

setTo

public void setTo(File file)
Set the to file.

Parameters:
The - to file.

setInput

public void setInput(InputStream in)
Set the InputStream.

Parameters:
The - InputStream.

setOutput

public void setOutput(OutputStream out)
Set the OutputStream.

Parameters:
The - OutputStream.

getFilesCopied

public int getFilesCopied()

getDirectoriesCopied

public int getDirectoriesCopied()

run

public void run()
Specified by:
run in interface Runnable

getInput

public InputStream getInput()
Returns:
Returns the input.

getOutput

public OutputStream getOutput()
Returns:
Returns the output.

toString

public String toString()
Overrides:
toString in class Object