com.sas.servlet.util
Class OpenURL

java.lang.Object
  |
  +--com.sas.servlet.util.OpenURL

public class OpenURL
extends Object

Application for opening the given URL and redirecting the contents to some output device (such as the console or file).

Usage:

java com.sas.servlet.util.OpenURL <url> [-o<filename>] [-r<search>=<replace>]

url = The URL to open

filename = The optional output file name

search=replace = An optional search and replace parameter. Multiple search and replace parameters can be specified. If an '=' sign must be used in the search and/or replace string it must be escaped with '\='. Searches are case- sensitive. A quote (") can be represented by double single quotes ('')


Constructor Summary
OpenURL()
           
 
Method Summary
protected  int findString(String s, String p, String escPrefix)
          Finds the given pattern in the given string.
protected  String getArg(String[] args, String sw)
          Returns the argument with the given leading switch.
static void main(String[] args)
          Main entry point
 void open(String[] args)
          Open the URL and send to the output device
protected  String searchAndReplace(String s, String search, String replace)
          Searches and replaces.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OpenURL

public OpenURL()
Method Detail

main

public static void main(String[] args)
Main entry point
Parameters:
args - The program arguments

open

public void open(String[] args)
          throws Exception
Open the URL and send to the output device
Parameters:
args - The program arguments
Throws:
Exception - If some exception occurs

getArg

protected String getArg(String[] args,
                        String sw)
Returns the argument with the given leading switch. If the switch is null this indicates to return the first non-switched argument. Note that the argument will be removed from the array once the value has been retrieved.
Parameters:
args - The program arguments
switch - The switch to search for
Returns:
The argument, or null for not found

findString

protected int findString(String s,
                         String p,
                         String escPrefix)
Finds the given pattern in the given string. An escape prefix can also be specified to indicate a pattern that should not be considered a match

searchAndReplace

protected String searchAndReplace(String s,
                                  String search,
                                  String replace)
Searches and replaces. The search string must match exactly - it is case sensitive


Version: 1.2.20000317.001 Formatted: 2000/07/06 15:57:33PM