planetj.util
Class CopyrightGenerator

java.lang.Object
  |
  +--planetj.util.CopyrightGenerator

public class CopyrightGenerator
extends Object

Appends copyright info to .java files


Constructor Summary
CopyrightGenerator()
           
 
Method Summary
static void getCopyrightText()
          Getst the complete copyright text to add/update
static String getProductName()
          Get the product name
static String getYear()
          Gets the current year
static void main(String[] args)
          Takes one or two arguments.
static void updateCopyright(File origFile)
          Adds/updates the copyright text to a single file
static void updateCopyright(String path)
          Adds/updates the copyright text to a single file
static int updateCopyrightInDirectory(File dir, boolean recursive)
          Updates the copyright in all the .java files in the directory
static int updateCopyrightInDirectory(String directory, boolean recursive)
          Updates the copyright in all the .java files in the directory
static void writeCopyrightText(Writer w)
          Appends the complete copyright text to the writer
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CopyrightGenerator

public CopyrightGenerator()
Method Detail

getCopyrightText

public static void getCopyrightText()
Getst the complete copyright text to add/update


getProductName

public static String getProductName()
Get the product name


getYear

public static String getYear()
Gets the current year


main

public static void main(String[] args)
Takes one or two arguments. The first is the directory containing the .java files to modify, or a name of a single .java file to alter. The second argument (which is optional) is the name of the product to include in the copyright section


updateCopyright

public static void updateCopyright(File origFile)
                            throws IOException,
                                   CMException
Adds/updates the copyright text to a single file

IOException
CMException

updateCopyright

public static void updateCopyright(String path)
                            throws IOException,
                                   CMException
Adds/updates the copyright text to a single file

IOException
CMException

updateCopyrightInDirectory

public static int updateCopyrightInDirectory(File dir,
                                             boolean recursive)
                                      throws CMException
Updates the copyright in all the .java files in the directory

Parameters:
dir - The directory
recursive - Whether the process should be repeated for subdirectories
Returns:
The number of updated files
CMException

updateCopyrightInDirectory

public static int updateCopyrightInDirectory(String directory,
                                             boolean recursive)
                                      throws CMException
Updates the copyright in all the .java files in the directory

Parameters:
directory - The path to the directory
recursive - Whether the process should be repeated for subdirectories
Returns:
The number of updated files
CMException

writeCopyrightText

public static void writeCopyrightText(Writer w)
                               throws IOException
Appends the complete copyright text to the writer

IOException