org.acm.seguin.util
Class BackupTraversal

java.lang.Object
  extended by org.acm.seguin.io.DirectoryTreeTraversal
      extended by org.acm.seguin.util.BackupTraversal
All Implemented Interfaces:
java.lang.Runnable

public class BackupTraversal
extends DirectoryTreeTraversal

Traverses a directory structure and backups all java files found

Author:
Chris Seguin

Constructor Summary
BackupTraversal(java.lang.String init, java.lang.String out)
          Traverses a directory tree structure
 
Method Summary
protected  void arriveAtDir(java.io.File current)
          Program called when we arrive at a directory
protected  boolean isTarget(java.io.File currentFile)
          Determines if this file should be handled by this traversal
protected  void leaveDir(java.io.File current)
          Program called when we arrive at a directory
static void main(java.lang.String[] args)
          The main program
protected  void visit(java.io.File currentFile)
          Visits the current file
 
Methods inherited from class org.acm.seguin.io.DirectoryTreeTraversal
isAllowed, run, traverse
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BackupTraversal

public BackupTraversal(java.lang.String init,
                       java.lang.String out)
Traverses a directory tree structure

Parameters:
init - the initial directory
out - the output directory
Method Detail

isTarget

protected boolean isTarget(java.io.File currentFile)
Determines if this file should be handled by this traversal

Specified by:
isTarget in class DirectoryTreeTraversal
Parameters:
currentFile - the current file
Returns:
true if the file should be handled

visit

protected void visit(java.io.File currentFile)
Visits the current file

Specified by:
visit in class DirectoryTreeTraversal
Parameters:
currentFile - the current file

arriveAtDir

protected void arriveAtDir(java.io.File current)
Program called when we arrive at a directory

Overrides:
arriveAtDir in class DirectoryTreeTraversal
Parameters:
current - the current directory

main

public static void main(java.lang.String[] args)
The main program

Parameters:
args - Description of Parameter

leaveDir

protected void leaveDir(java.io.File current)
Program called when we arrive at a directory

Overrides:
leaveDir in class DirectoryTreeTraversal
Parameters:
current - Description of the Parameter