Package com.sun.javatest
Class EditLinks
java.lang.Object
com.sun.javatest.EditLinks
A utility to rewrite links within a set of HTML files.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
An exception to report bad command line arguments. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
Add another edit to be applied when the files are edited.void
Edit the given files, using the current set of edits and ignores.void
Edit the given file, using the current set of edits and ignores.void
Add another file to be ignored when the files are edited.static void
Command line entry point.
Usage:void
run()
Edit the files set up by theEditLinks(String[])
constructor.
-
Constructor Details
-
EditLinks
public EditLinks()Create an empty editor object. -
EditLinks
Create an editor object based on command line args. It is an error if no edits, no input files, or no output file is given.- Parameters:
args
- Command line args.- Throws:
EditLinks.BadArgs
- if problems are found in the given arguments.- See Also:
-
-
Method Details
-
main
Command line entry point.
Usage:java com.sun.javatest.EditLinks options files...
Arguments:- -e oldPrefix newPrefix
- Links beginning with oldPrefix are rewritten to begin with newPrefix
- -ignore file
- Ignore files and directories named 'file' when scanning directories. E.g. -ignore SCCS
- -o file
- Output file or directory. It should only be a file if the input is a single file; otherwise it should be a directory.
- files...
- Input files or directories to be copied, with the links edited.
- Parameters:
args
- Command line arguments, per the usage as described.
-
addEdit
Add another edit to be applied when the files are edited.- Parameters:
oldPrefix
- The prefix of HTML references to be updated.newPrefix
- The replacement value for occurrences of oldPrefix.
-
ignore
Add another file to be ignored when the files are edited. For example, specify "SCCS" to ignore SCCS directories.- Parameters:
file
- The name of a file to be ignored when editing.
-
run
Edit the files set up by theEditLinks(String[])
constructor.- Throws:
IOException
- if any errors occur while editing the specified files.
-
edit
Edit the given files, using the current set of edits and ignores. The source files may be files or directories; the destination can be a directory, or a file if the source is a single file.- Parameters:
src
- An array of files or directories of files to be edited.dest
- A destination file for the edit.- Throws:
IOException
- if any problems occur while editing the specified files.IllegalArgumentException
- if the destination is a single file but the source file is not.- See Also:
-
edit
Edit the given file, using the current set of edits and ignores. The source files may be file or directory; the destination can be a directory, or a file if the source is a single file.- Parameters:
src
- A file or directory of files to be edited.dest
- A destination file for the edit.- Throws:
IOException
- if any problems occur while editing the specified files.IllegalArgumentException
- if the destination is a single file but the source file is not.- See Also:
-