uk.ac.bham.gloss
Class Copy

java.lang.Object
  extended by uk.ac.bham.gloss.Copy

public class Copy
extends java.lang.Object

Class providing a command line utility to copy files listed in file "list" in directory args[0] to the directory of the file args[1], by default without clobbering existing files. If args[0] and/or args[1] are plain directories they MUST end with the file separator. They can bethe names of regular files in which case the containing directory is used. Copyright Richard Kaye 2007 for GLOSS, http://gloss.bham.ac.uk Usage permitted according to the GPL. No waranty.


Constructor Summary
Copy()
           
 
Method Summary
static void copy(ParameterContainer params, Logger logger)
          This is the main command line, with logger and parameter container arguments.
static void copy(java.lang.String src, java.lang.String dest, boolean clobber, Logger logger)
          This is the main executed method: copies files listed in file "list" in directory src to the directory of the file dest, with silent and clobber flags.
static void copyFiles(java.lang.String srcDir, java.lang.String destDir, boolean clobber, Logger logger)
          copies any files in srcDir to destDir
static void main(java.lang.String[] args)
          main: called from the console.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Copy

public Copy()
Method Detail

main

public static void main(java.lang.String[] args)
main: called from the console. This makes logger and parametercontainer objects and calls copy(), catching any exceptions.


copy

public static void copy(ParameterContainer params,
                        Logger logger)
                 throws java.io.IOException
This is the main command line, with logger and parameter container arguments. The params parameter contains values as on the command line: for each switch "-switch value" there is a parameter "switch" with value "value" in params. Boolean switches (such as -[no]clobber) should have parameter (in this case "clobber") with value "true" or "false". The input location or file corresponds to parameter "input". The output location or file corresponds to parameter "output". Default values will be added to the params object by these methods.

Throws:
java.io.IOException

copy

public static void copy(java.lang.String src,
                        java.lang.String dest,
                        boolean clobber,
                        Logger logger)
This is the main executed method: copies files listed in file "list" in directory src to the directory of the file dest, with silent and clobber flags. If src or dest are null or empty they will be assumed to be the current directory. If they are directories they MUST end in the system file separator. If not they are assumed to be names of files, and these files' containing directories are used.


copyFiles

public static void copyFiles(java.lang.String srcDir,
                             java.lang.String destDir,
                             boolean clobber,
                             Logger logger)
copies any files in srcDir to destDir