au.gov.tas.dpiwe.mr.tool
Class MultiCopy

java.lang.Object
  extended by au.gov.tas.dpiwe.mr.tool.MultiCopy
Direct Known Subclasses:
MultiCount, RejarTool

public class MultiCopy
extends Object

This tool copies the files in multiple directories meeting the filename specification.

Since:
Mr Architecture 3.0
Version:
1.0.0.5
Author:
Kade Hansson
See Also:
MultiEnumDir, MultiNewer

Field Summary
protected static ThreadLocal totalCount
           
 
Constructor Summary
MultiCopy()
           
 
Method Summary
static long copy(InputStream input, OutputStream output)
          Produce a copy of a stream.
static boolean copy(String filename, String copyDir)
          Produce a copy of a file in the specified directory.
static void main(String[] argv)
          Initiates the MultiCopy tool.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

totalCount

protected static ThreadLocal totalCount
Constructor Detail

MultiCopy

public MultiCopy()
Method Detail

main

public static void main(String[] argv)
                 throws Exception
Initiates the MultiCopy tool.

Parameters:
argv - arguments are filenames, directory names or switches (one of "-destination", "-spec", -single" or "-multi").
Throws:
IOException - if the input files could not be read or the output files could not be written.
SecurityException - if the configured security policy is too restrictive.
Exception - if something else goes wrong.

copy

public static boolean copy(String filename,
                           String copyDir)
                    throws IOException,
                           SecurityException
Produce a copy of a file in the specified directory.

Parameters:
filename - the name of the file to be copied.
copyDir - the directory to contain the copied file.
Returns:
true if the file was successfully copied, false if the file copy was abandoned.
Throws:
IOException - if the input files could not be read or the output file could not be written.
SecurityException - if the configured security policy is too restrictive.

copy

public static long copy(InputStream input,
                        OutputStream output)
                 throws IOException
Produce a copy of a stream.

Parameters:
input - the InputStream from which the original file should be read.
output - the OutputStream to which the copied file should be written.
Throws:
IOException - if the input file could not be read or the output file could not be written.