fedora.client.demo
Class DemoObjectConverter

java.lang.Object
  extended by fedora.client.demo.DemoObjectConverter

public class DemoObjectConverter
extends java.lang.Object

Title: DemoObjectConverter.java

Description: Goes through the Fedora demo objects directory and changes all occurrences of strings for protocol, hostname and port number to values supplied by the user in the calling arguments. This utility is used to convert the original Fedora demo objects so that they will function correctly when the Fedora server is configured to run on a protocol, host, or port other than the defaults.

Version:
$Id: DemoObjectConverter.java 4290 2005-08-04 19:17:20Z rlw $
Author:
rlw@virginia.edu

Constructor Summary
DemoObjectConverter(java.lang.String fromProtocol, java.lang.String fromHostName, java.lang.String fromPortNum, java.lang.String toProtocol, java.lang.String toHostName, java.lang.String toPortNum, java.lang.String fedoraHome)
           Constructor for DemoObjectConverter.
 
Method Summary
static void convert(java.lang.String fedoraHome)
           Converts all Fedora demo objects by substituting hostname and port numer supplied in calling arguments.
static void getFiles(java.io.File dir)
           Recursively traverse the specified directory and process each file.<.p>
static void main(java.lang.String[] args)
           
static void showUsage(java.lang.String errMessage)
           Shows argument list for application.
static void substitute(java.io.File demoObject)
           Substitute the protocol, hostname and port number supplied in calling arguments with those found in Fedora demo objects.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DemoObjectConverter

public DemoObjectConverter(java.lang.String fromProtocol,
                           java.lang.String fromHostName,
                           java.lang.String fromPortNum,
                           java.lang.String toProtocol,
                           java.lang.String toHostName,
                           java.lang.String toPortNum,
                           java.lang.String fedoraHome)

Constructor for DemoObjectConverter. Initializes class variables for hostname, port number and fedoraHome.

Parameters:
fromProtocol - The protocol for the URL to be changed from.
fromHostName - The host name to be changed from.
fromPortNum - The port number to be changed from.
toProtocol - The protocol for the URL to be changed to.
toHostName - The host name to be changed to.
toPortNum - The port number ot be changed to.
fedoraHome - The installation directory for Fedora.
Method Detail

convert

public static void convert(java.lang.String fedoraHome)

Converts all Fedora demo objects by substituting hostname and port numer supplied in calling arguments.

Parameters:
fedoraHome - The location Fedora is installed.

getFiles

public static void getFiles(java.io.File dir)

Recursively traverse the specified directory and process each file.<.p>

Parameters:
dir - The directory to be traversed.

substitute

public static void substitute(java.io.File demoObject)

Substitute the protocol, hostname and port number supplied in calling arguments with those found in Fedora demo objects. Replaces the original file with the edited version.

Parameters:
demoObject - The Fedora demo object file to be edited.

showUsage

public static void showUsage(java.lang.String errMessage)

Shows argument list for application.

Parameters:
errMessage - The message to be included with usage information.

main

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