More changes for the removal of the Axis dependencies.

Removed the log files created by the Windows INSTALL.

Corrected the "Author" for files created by Greg.

Tuned the ATS logs to be less chatty and have a greater backlog.

Updated the NOTICES file and added READMEs to provide information
about external packages included in the project.
This commit is contained in:
Juan Carlos Luciani
2007-03-17 06:39:46 +00:00
parent 33a49c686a
commit 7a44908936
26 changed files with 2650 additions and 2904 deletions

View File

@@ -18,7 +18,7 @@
* To contact Novell about this file by physical or electronic mail,
* you may find current contact information at www.novell.com.
*
* Author: Greg Richardson
* Author: Greg Richardson <grichardson@novell.com>
*
***********************************************************************/
@@ -68,9 +68,9 @@ public class InitConfigFile
FileInputStream fisProperties;
File fileTemplate;
File fileOutput;
File file;
//File file;
//FileWriter fw;
RandomAccessFile raf;
//RandomAccessFile raf;
String[] rgsSearchFor;
String[] rgsReplaceWith;
String sInstallDir;
@@ -88,31 +88,30 @@ public class InitConfigFile
InitConfigFile(String[] args)
{
rc = ERROR_NO_ERROR;
properties = new Properties();
fileProperties = null;
fisProperties = null;
fileTemplate = null;
fileOutput = null;
try
{
file = new File("c:\\test.log");
//file = new File("c:\\test.log");
//fw = new FileWriter(file);
raf = new RandomAccessFile(file, "rw");
raf.seek(raf.length());
//raf = new RandomAccessFile(file, "rw");
//raf.seek(raf.length());
// Process the arguments
if (ERROR_NO_ERROR == (rc = processArgs(args)))
{
// Process the properties
if (ERROR_NO_ERROR == (rc = processProperties()))
{
rc = createOutputFile();
}
// Process the properties
if (ERROR_NO_ERROR == (rc = processProperties()))
{
rc = createOutputFile();
}
}
}
catch (IOException e)
{
@@ -123,7 +122,7 @@ public class InitConfigFile
try
{
log(rc, " " + sOutput + "\n\n\n");
raf.close();
//raf.close();
}
catch (Exception e1)
{
@@ -142,19 +141,19 @@ public class InitConfigFile
int i;
String args[] = new String[argsOld.length];
int iNew;
log("Original arg count " + argsOld.length);
for (i = 0; i < argsOld.length; i++)
{
log("Arg " + i + " = " + argsOld[i] + "\r\n");
}
// Validate the number of parameters
if (argsOld.length < 2)
{
return ERROR_INVALID_NUMBER_OF_PARAMS;
}
iNew = -1;
for (iOld = 0; iOld < argsOld.length; iOld++)
{
@@ -168,7 +167,7 @@ public class InitConfigFile
}
}
}
log("New arg count " + args.length);
for (i = 0; i < args.length; i++)
{
@@ -176,9 +175,9 @@ public class InitConfigFile
{
continue;
}
log("arg[" + i + "] = " +args[i]);
// is this the install dir param?
if (args[i].startsWith(INSTALL_DIR_PARAM))
{
@@ -187,26 +186,26 @@ public class InitConfigFile
{
return ERROR_BAD_INSTALL_DIR_PARAM;
}
sInstallDir = args[i].substring(INSTALL_DIR_PARAM.length()).trim();
fileInstallDir = new File(sInstallDir);
// Make sure the install dir can be found
if (!fileInstallDir.exists())
{
return ERROR_MISSING_INSTALL_DIR;
}
// Make sure the install dir is a directory
if (!fileInstallDir.isDirectory())
{
return ERROR_INSTALL_DIR_NOT_A_DIR;
}
log("Adding property (key = " + INSTALL_DIR_PROPERTY + " - value = " + sInstallDir);
properties.setProperty(INSTALL_DIR_PROPERTY, sInstallDir);
}
// is this the properties file param?
else if (args[i].startsWith(PROPERTY_FILE_PARAM))
{
@@ -215,16 +214,16 @@ public class InitConfigFile
{
return ERROR_BAD_PROPERTY_FILE_PARAM;
}
sProperties = args[i].substring(PROPERTY_FILE_PARAM.length()).trim();
fileProperties = new File(sProperties);
// Make sure the properties file can be found
if (!fileProperties.exists())
{
return ERROR_MISSING_PROPERTIES_FILE;
}
// Read the properties
try
{
@@ -236,7 +235,7 @@ public class InitConfigFile
return ERROR_UNABLE_TO_READ_PROPERTIES;
}
}
else if (args[i].startsWith(TEMPLATE_FILE_PARAM))
{
// Make sure it is more than the param tag
@@ -244,10 +243,10 @@ public class InitConfigFile
{
return ERROR_BAD_TEMPLATE_FILE_PARAM;
}
sTemplate = args[i].substring(TEMPLATE_FILE_PARAM.length()).trim();
fileTemplate = new File(sTemplate);
// Make sure the template file can be found
if (!fileTemplate.exists())
{
@@ -255,7 +254,7 @@ public class InitConfigFile
return ERROR_MISSING_TEMPLATE_FILE;
}
}
else if (args[i].startsWith(OUTPUT_FILE_PARAM))
{
// Make sure it is more than the param tag
@@ -263,11 +262,11 @@ public class InitConfigFile
{
return ERROR_BAD_OUTPUT_FILE_PARAM;
}
sOutput = args[i].substring(OUTPUT_FILE_PARAM.length()).trim();
fileOutput = new File(sOutput);
}
else if (args[i].startsWith(ESCAPE_PATH_CHARS))
{
// Make sure it is more than the param tag
@@ -275,14 +274,14 @@ public class InitConfigFile
{
return ERROR_BAD_ESCAPE_PATH_CHARS_PARAM;
}
String value = args[i].substring(ESCAPE_PATH_CHARS.length()).trim();
if (value.equalsIgnoreCase("true"))
{
escapePathCharsInReplaceString = true;
escapePathCharsInReplaceString = true;
}
}
// Handle additional parameters
else
{
@@ -298,27 +297,27 @@ public class InitConfigFile
properties.setProperty(sKey, sValue);
}
}
// Make sure we got an install dir
if (null == fileInstallDir)
{
return ERROR_MISSING_INSTALL_DIR_PARAM;
}
// Make sure we got a template file
if (null == fileTemplate)
{
return ERROR_MISSING_TEMPLATE_FILE_PARAM;
}
// Make sure we got an output file
if (null == fileOutput)
{
return ERROR_MISSING_OUTPUT_FILE_PARAM;
}
// Note: the properties file parameter is optional
return ERROR_NO_ERROR;
}
@@ -330,20 +329,20 @@ public class InitConfigFile
String sKey;
String sValue;
int i = 0;
e = properties.propertyNames();
rgsSearchFor = new String[properties.size()];
rgsReplaceWith = new String[properties.size()];
log("property count = " + properties.size());
while (e.hasMoreElements())
{
sKey = (String)e.nextElement();
sValue = (String)properties.get(sKey);
log("Property key = " + sKey + " Value = " + sValue);
rgsSearchFor[i] = sKey;
if (escapePathCharsInReplaceString)
{
@@ -372,7 +371,7 @@ public class InitConfigFile
String sLineOutput;
int iSearchFor;
int i;
try
{
// Open the files
@@ -382,7 +381,7 @@ public class InitConfigFile
{
return ERROR_UNABLE_TO_OPEN_TEMPLATE;
}
try
{
fwOutput = new FileWriter(fileOutput);
@@ -398,7 +397,7 @@ public class InitConfigFile
{
sLineOutput = sLineTemplate;
log("<-- " + sLineOutput);
// For each term to be replaced...
for (i = 0; i < rgsSearchFor.length; i++)
{
@@ -408,7 +407,7 @@ public class InitConfigFile
{
log("replacing " + rgsSearchFor[i] + " at position " + iSearchFor + " with " + rgsReplaceWith[i]);
sLineOutput = sLineOutput.substring(0, iSearchFor) + rgsReplaceWith[i] +
sLineOutput.substring(iSearchFor + rgsSearchFor[i].length());
sLineOutput.substring(iSearchFor + rgsSearchFor[i].length());
}
}
try
@@ -421,7 +420,7 @@ public class InitConfigFile
return -42;
}
}
// Clean up
fwOutput.flush();
fwOutput.close();
@@ -531,6 +530,7 @@ public class InitConfigFile
void log(String s)
{
/*
try
{
raf.writeUTF(this.getClass().getName() + ": " + s + "\r\n");
@@ -538,5 +538,6 @@ public class InitConfigFile
catch (IOException ioe)
{
}
*/
}
}