com.bbn.openmap.util.wanderer
Class Purge

java.lang.Object
  extended by com.bbn.openmap.util.wanderer.Wanderer
      extended by com.bbn.openmap.util.wanderer.Purge
All Implemented Interfaces:
WandererCallback

public class Purge
extends Wanderer
implements WandererCallback

PURGE deletes files that start with, or end with, certain strings. Good for cleaning up backup leftover from various editors.

 
  Usage: java com.bbn.openmap.util.wanderer.Purge (dir path) ...
 
 


Field Summary
 
Fields inherited from class com.bbn.openmap.util.wanderer.Wanderer
exhaustiveSearch, topToBottom
 
Constructor Summary
Purge(java.lang.String[] startsWith, java.lang.String[] endsWith)
           
 
Method Summary
 boolean handleDirectory(java.io.File directory)
          Do what you need to do to the directory.
 boolean handleFile(java.io.File file)
          Do what you need to do to the file.
static void main(java.lang.String[] argv)
          Given a set of files or directories, parade through them to find files that end with '`', or files that start with '.#', and delete them.
 
Methods inherited from class com.bbn.openmap.util.wanderer.Wanderer
getCallback, handleDirectory, handleEntry, isExhaustiveSearch, isTopToBottom, setCallback, setExhaustiveSearch, setTopToBottom
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Purge

public Purge(java.lang.String[] startsWith,
             java.lang.String[] endsWith)
Method Detail

handleDirectory

public boolean handleDirectory(java.io.File directory)
Description copied from interface: WandererCallback
Do what you need to do to the directory.

Specified by:
handleDirectory in interface WandererCallback
Parameters:
directory - that represents a directory to deal with.
Returns:
true to continue wandering through to children.

handleFile

public boolean handleFile(java.io.File file)
Description copied from interface: WandererCallback
Do what you need to do to the file.

Specified by:
handleFile in interface WandererCallback
Parameters:
file - to handle.
Returns:
true to continue evaluating siblings and parent directory siblings.

main

public static void main(java.lang.String[] argv)
Given a set of files or directories, parade through them to find files that end with '`', or files that start with '.#', and delete them.

Parameters:
argv - paths to files or directories, use -h to get a usage statement.


Copyright (C) BBNT Solutions LLC; See http://openmap.bbn.com/ for details