home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Programming Languages Suite
/
ProgLangD.iso
/
VCAFE.3.0A
/
Main.bin
/
Properties.java
< prev
next >
Wrap
Text File
|
1998-10-23
|
35KB
|
1,429 lines
package com.symantec.itools.util;
import java.io.BufferedReader;
import java.io.FileOutputStream;
import java.io.File;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.IOException;
import java.io.LineNumberReader;
import java.io.OutputStream;
import java.io.PushbackReader;
import java.lang.reflect.Constructor;
import java.lang.reflect.InvocationTargetException;
import java.net.URL;
import java.util.Enumeration;
import java.util.Vector;
import com.symantec.itools.io.FileSystem;
import com.symantec.itools.lang.Debug;
import com.symantec.itools.lang.DynamicClassException;
import com.symantec.itools.lang.NotImplementedError;
/**
* @author Symantec Internet Tools Division
* @version 1.0
* @since VCafe 3.0
*/
public class Properties
extends java.util.Properties
{
/**
* @since VCafe 3.0
*/
protected final static String INDENT = " ";
/**
* @since VCafe 3.0
*/
protected String fileName;
/**
* @since VCafe 3.0
*/
protected boolean saveChanges;
/**
* @since VCafe 3.0
*/
protected boolean saved;
/**
* @since VCafe 3.0
*/
protected boolean extendedPropertiesFileFormat;
{
extendedPropertiesFileFormat = true;
}
public Properties()
{
}
public Properties(String name)
throws IOException
{
InputStream is;
if(name.charAt(0) != '/')
{
name = '/' + name;
}
is = null;
try
{
is = Properties.class.getResourceAsStream(name);
load(is);
}
finally
{
if(is != null)
{
is.close();
}
}
}
public Properties(URL url)
throws IOException
{
InputStream is;
is = null;
fileName = url.getFile();
try
{
is = url.openStream();
load(is);
}
finally
{
if(is != null)
{
is.close();
}
}
}
public Properties(InputStream stream)
throws IOException
{
load(stream);
}
public Properties(Properties properties)
{
load(properties);
fileName = properties.fileName;
}
public Properties(String[][] data)
{
load(data);
}
/**
* @param properties TODO
* @since VCafe 3.0
*/
public void load(java.util.Properties properties)
{
for(Enumeration e = properties.keys(); e.hasMoreElements();)
{
Object key;
key = e.nextElement();
super.put(key, properties.get(key));
}
saved = false;
}
/**
* @param data TODO
* @since VCafe 3.0
*/
public void load(String[][] data)
{
for(int i = 0; i < data.length; i++)
{
super.put(data[i][0], data[i][1]);
}
saved = false;
}
/**
* @param in TODO
* @exception java.io.IOException
* @since VCafe 3.0
*/
public synchronized void load(InputStream in)
throws IOException
{
BufferedReader bufferedReader;
LineNumberReader lineReader;
PushbackReader reader;
int ch;
String key;
Object value;
if(in == null)
{
throw new IOException("Input Stream is null");
}
bufferedReader = new BufferedReader(new InputStreamReader(in));
lineReader = new LineNumberReader(bufferedReader);
reader = new PushbackReader(lineReader);
ch = reader.read();
if(ch == '{')
{
ch = reader.read();
while(ch >= 0 && ch != '}')
{
reader.unread(ch);
key = readKey(reader, lineReader);
if(key.indexOf('$') == -1)
{
value = readValue(reader, lineReader, ';');
skipWhitespace(reader, lineReader);
}
else
{
value = skipWhitespace(reader, lineReader);
}
super.put(key, value);
ch = reader.read();
}
if(ch < 0)
{
throw new IOException("Unexpected termination of input reader - no closing '}' character found on line" +
lineReader.getLineNumber());
}
extendedPropertiesFileFormat = true;
// ignore everything after the closing curly
}
else
{
super.load(in);
extendedPropertiesFileFormat = false;
}
}
/**
* @param key TODO
* @param value TODO
* @since VCafe 3.0
*/
public Object put(Object key, Object value)
{
if(extendedPropertiesFileFormat)
{
if(!((value instanceof String) || (value instanceof String[]) ||
(value instanceof Properties) || (value instanceof Properties[])))
{
throw new NotImplementedError("put(Object, Object) is not allowed for Extended Properties");
}
}
saved = false;
return (super.put(key, value));
}
/**
* @param f TODO
* @since VCafe 3.0
*/
public void setSaveChanges(boolean f)
{
saveChanges = f;
}
/**
* @since VCafe 3.0
*/
public boolean isSaveChanges()
{
return (saveChanges);
}
/**
* @param name TODO
* @since VCafe 3.0
*/
public void setFileName(String name)
{
fileName = FileSystem.getCanonicalPath(name, true);
}
/**
* @since VCafe 3.0
*/
public String getFileName()
{
return (fileName);
}
/**
* @param f TODO
* @since VCafe 3.0
*/
public void setExtendedPropertiesFileFormat(boolean f)
{
extendedPropertiesFileFormat = f;
}
/**
* @since VCafe 3.0
*/
public boolean getExtendedPropertiesFileFormat()
{
return (extendedPropertiesFileFormat);
}
/**
* @exception java.lang.Throwable
* @since VCafe 3.0
*/
public void finalize()
throws Throwable
{
super.finalize();
if(saveChanges && fileName != null && !saved)
{
save(fileName);
}
}
/**
* @param key TODO
* @param value TODO
* @since VCafe 3.0
*/
public void set(String key, String value)
{
super.put(key, value);
}
/**
* @param key TODO
* @param f TODO
* @since VCafe 3.0
*/
public void set(String key, boolean f)
{
super.put(key, new Boolean(f).toString());
}
/**
* @param key TODO
* @param i TODO
* @since VCafe 3.0
*/
public void set(String key, int i)
{
super.put(key, Integer.toString(i));
}
/**
* @param key TODO
* @param f TODO
* @since VCafe 3.0
*/
public void set(String key, float f)
{
super.put(key, Float.toString(f));
}
/**
* @param key TODO
* @param l TODO
* @since VCafe 3.0
*/
public void set(String key, long l)
{
super.put(key, Long.toString(l));
}
/**
* @param key TODO
* @param d TODO
* @since VCafe 3.0
*/
public void set(String key, double d)
{
super.put(key, Double.toString(d));
}
/**
* @param key TODO
* @param clazz TODO
* @since VCafe 3.0
*/
public void set(String key, Class clazz)
{
super.put(key, clazz.getName());
}
/**
* @param key TODO
* @param value TODO
* @since VCafe 3.0
*/
public void set(String key, Properties value)
{
super.put(key, value);
}
/**
* @param key TODO
* @param value TODO
* @since VCafe 3.0
*/
public void set(String key, String[] value)
{
if(value == null)
{
value = new String[0];
}
super.put(key, value);
}
/**
* @param key TODO
* @param value TODO
* @since VCafe 3.0
*/
public void set(String key, Properties[] value)
{
if(value == null)
{
value = new Properties[0];
}
super.put(key, value);
}
/**
* @param key TODO
* @since VCafe 3.0
*/
public String getString(String key)
{
return getProperty(key, null);
}
/**
* @param key TODO
* @param defaultValue TODO
* @since VCafe 3.0
*/
public String getString(String key, String defaultValue)
{
return getProperty(key, defaultValue);
}
/**
* @param key TODO
* @since VCafe 3.0
*/
public boolean getBoolean(String key)
{
return (getBoolean(key, false));
}
/**
* @param key TODO
* @param defaultValue TODO
* @since VCafe 3.0
*/
public boolean getBoolean(String key, boolean defaultValue)
{
String value;
value = getProperty(key);
if(value != null)
{
return (new Boolean(value).booleanValue());
}
return (defaultValue);
}
/**
* @param key TODO
* @since VCafe 3.0
*/
public int getInteger(String key)
{
return (getInteger(key, 0));
}
/**
* @param key TODO
* @param defaultValue TODO
* @since VCafe 3.0
*/
public int getInteger(String key, int defaultValue)
{
String value;
value = getProperty(key);
try
{
if(value != null)
{
return (Integer.parseInt(value));
}
}
catch(NumberFormatException ex)
{
}
return (defaultValue);
}
/**
* @param key TODO
* @since VCafe 3.0
*/
public long getLong(String key)
{
return (getLong(key, 0));
}
/**
* @param key TODO
* @param defaultValue TODO
* @since VCafe 3.0
*/
public long getLong(String key, long defaultValue)
{
String value;
value = getProperty(key);
try
{
if(value != null)
{
return (Long.parseLong(value));
}
}
catch(NumberFormatException ex)
{
}
return (defaultValue);
}
/**
* @param key TODO
* @since VCafe 3.0
*/
public float getFloat(String key)
{
return (getFloat(key, 0.0f));
}
/**
* @param key TODO
* @param defaultValue TODO
* @since VCafe 3.0
*/
public float getFloat(String key, float defaultValue)
{
String value;
value = getProperty(key);
try
{
if(value != null)
{
return (Float.valueOf(value).floatValue());
}
}
catch(NumberFormatException ex)
{
}
return (defaultValue);
}
/**
* @param key TODO
* @since VCafe 3.0
*/
public double getDouble(String key)
{
return (getDouble(key, 0.0));
}
/**
* @param key TODO
* @param defaultValue TODO
* @since VCafe 3.0
*/
public double getDouble(String key, double defaultValue)
{
String value;
value = getProperty(key);
try
{
if(value != null)
{
return (Double.valueOf(value).doubleValue());
}
}
catch(NumberFormatException ex)
{
}
return (defaultValue);
}
/**
* @param key TODO
* @exception java.lang.ClassNotFoundException
* @since VCafe 3.0
*/
public Class getClass(String key)
throws ClassNotFoundException,
KeyNotFoundException
{
String className;
className = getProperty(key);
if(className == null)
{
throw new KeyNotFoundException(key);
}
return (Class.forName(getProperty(key)));
}
/**
* @param key TODO
* @exception com.symantec.itools.lang.DynamicClassException
* @since VCafe 3.0
*/
public Object getNewInstanceOfClass(String key)
throws DynamicClassException
{
String className;
className = getString(key);
if(className == null)
{
return (null);
}
try
{
return (Class.forName(className).newInstance());
}
catch(ClassNotFoundException ex)
{
throw new DynamicClassException(className, "class cannot be found");
}
catch(InstantiationException ex)
{
throw new DynamicClassException(className, "class is either abstract or an interface)");
}
catch(IllegalAccessException ex)
{
throw new DynamicClassException(className, "class is not public");
}
}
/**
* @param key TODO
* @param argTypes TODO
* @param args TODO
* @exception com.symantec.itools.lang.DynamicClassException
* @since VCafe 3.0
*/
public Object getNewInstanceOfClass(String key, Class[] argTypes, Object[] args)
throws DynamicClassException
{
String className;
className = getString(key);
if(className == null)
{
return (null);
}
try
{
return (Class.forName(className).getConstructor(argTypes).newInstance(args));
}
catch(NoSuchMethodException ex)
{
throw new DynamicClassException(className, "specified constructor does not exist");
}
catch(InvocationTargetException ex)
{
throw new DynamicClassException(className, ex.getTargetException().getMessage());
}
catch(ClassNotFoundException ex)
{
throw new DynamicClassException(className, "class cannot be found");
}
catch(InstantiationException ex)
{
throw new DynamicClassException(className, "class is either abstract or an interface)");
}
catch(IllegalAccessException ex)
{
throw new DynamicClassException(className, "class is not public");
}
}
/**
* @param key TODO
* @since VCafe 3.0
*/
public Properties getProperties(String key)
{
try
{
return ((Properties)get(key));
}
catch(ClassCastException ex)
{
}
return (null);
}
/**
* @param key TODO
* @since VCafe 3.0
*/
public String[] getStringList(String key)
{
String[] value;
try
{
value = (String[])get(key);
}
catch(ClassCastException ex)
{
return (new String[0]);
}
if(value == null)
{
return (new String[0]);
}
return (value);
}
/**
* @param key TODO
* @param defaultValue TODO
* @since VCafe 3.0
*/
public String[] getStringList(String key, String[] defaultValue)
{
String[] value;
try
{
value = (String[])get(key);
}
catch(ClassCastException ex)
{
return (defaultValue);
}
if(value == null)
{
return (defaultValue);
}
return (value);
}
/**
* @param key TODO
* @since VCafe 3.0
*/
public Properties[] getPropertiesList(String key)
{
Properties[] value;
try
{
value = (Properties[])get(key);
}
catch(ClassCastException ex)
{
return (new Properties[0]);
}
if(value == null)
{
return (new Properties[0]);
}
return (value);
}
/**
* @param reader TODO
* @param lineReader TODO
* @exception java.io.IOException
* @since VCafe 3.0
*/
protected String skipWhitespace(PushbackReader reader, LineNumberReader lineReader)
throws IOException
{
StringBuffer buf;
int ch;
buf = new StringBuffer();
ch = reader.read();
while((ch >= 0) && ((Character.isSpaceChar((char)ch)) || (ch == '\t') || (ch == '\n') || (ch == '\r') ||
(ch == '/') || (ch == '#')))
{
buf.append((char)ch);
if(ch == '/')
{
ch = reader.read();
buf.append((char)ch);
if(ch == '*')
{
// read until closing star-slash combo
boolean justSawClosingStar;
justSawClosingStar = false;
while((ch >= 0) && !((ch == '/') && justSawClosingStar))
{
justSawClosingStar = (ch == '*');
ch = reader.read();
buf.append((char)ch);
}
}
else if(ch == '/')
{
// read until end of line
while((ch >= 0) && (ch != '\r') && (ch != '\n'))
{
ch = reader.read();
buf.append((char)ch);
}
}
}
else if(ch == '#')
{
while((ch >= 0) && (ch != '\r') && (ch != '\n'))
{
ch = reader.read();
buf.append((char)ch);
}
}
ch = reader.read();
buf.append((char)ch);
}
reader.unread(ch);
if(buf.length() > 0)
{
buf.setLength(buf.length() - 1);
}
return (buf.toString());
}
/**
* @param reader TODO
* @param lineReader TODO
* @exception java.io.IOException
* @since VCafe 3.0
*/
protected String readKey(PushbackReader reader, LineNumberReader lineReader)
throws IOException
{
int ch;
StringBuffer key;
skipWhitespace(reader, lineReader);
ch = reader.read();
key = new StringBuffer();
while((ch >= 0) && (ch != '=') && (ch != ':') && (ch != '\t') && (ch != '\n') && (ch != '\r'))
{
key.append((char)ch);
ch = reader.read();
}
while((ch >= 0) && (ch != '=') && (ch != ':'))
{
ch = reader.read();
}
return (key.toString().trim());
}
/**
* @param reader TODO
* @param lineReader TODO
* @param expectedTermination TODO
* @exception java.io.IOException
* @since VCafe 3.0
*/
protected Object readValue(PushbackReader reader, LineNumberReader lineReader, int expectedTermination)
throws IOException
{
int ch;
Object value;
skipWhitespace(reader, lineReader);
ch = reader.read();
switch(ch)
{
case '(' :
{
value = readListValue(reader, lineReader, expectedTermination);
break;
}
case '{' :
{
value = readPropertiesValue(reader, lineReader, expectedTermination, -2);
break;
}
default :
{
reader.unread(ch);
value = readStringValue(reader, lineReader, expectedTermination, -2);
break;
}
}
return (value);
}
/**
* @param reader TODO
* @param lineReader TODO
* @param expectedTermination TODO
* @exception java.io.IOException
* @since VCafe 3.0
*/
protected Object[] readListValue(PushbackReader reader, LineNumberReader lineReader, int expectedTermination)
throws IOException
{
int ch;
Vector list;
Object[] objects;
skipWhitespace(reader, lineReader);
ch = reader.read();
list = new Vector(10);
while((ch >= 0) && (ch != ')'))
{
switch(ch)
{
case '{' :
{
list.addElement(readPropertiesValue(reader, lineReader, ',', ')'));
break;
}
default:
{
reader.unread(ch);
list.addElement(readStringValue(reader, lineReader, ',', ')'));
break;
}
}
skipWhitespace(reader, lineReader);
ch = reader.read();
}
skipWhitespace(reader, lineReader);
ch = reader.read();
if (ch != expectedTermination)
{
throw new IOException("List value must be terminated with ')' and '" + (char)expectedTermination +
"' characters on line " + lineReader.getLineNumber());
}
if(list.size() > 0)
{
if(list.elementAt(0) instanceof java.lang.String)
{
objects = new String[list.size()];
}
else if(list.elementAt(0) instanceof Properties)
{
objects = new Properties[list.size()];
}
else
{
throw new IOException("Internal error - unknown list element type");
}
}
else
{
objects = new Object[0];
}
try
{
list.copyInto(objects);
}
catch(ArrayStoreException ex)
{
throw new IOException("Inconsistent list element types on line " + lineReader.getLineNumber());
}
return (objects);
}
/**
* @param reader TODO
* @param lineReader TODO
* @param expectedTermination1 TODO
* @param expectedTermination2 TODO
* @exception java.io.IOException
* @since VCafe 3.0
*/
protected Properties readPropertiesValue(PushbackReader reader,
LineNumberReader lineReader,
int expectedTermination1,
int expectedTermination2)
throws IOException
{
Properties properties;
int ch;
skipWhitespace(reader, lineReader);
ch = reader.read();
properties = new Properties();
while((ch >= 0) && (ch != '}'))
{
String key;
Object value;
reader.unread(ch);
key = readKey(reader, lineReader);
value = readValue(reader, lineReader, ';');
skipWhitespace(reader, lineReader);
properties.put(key, value);
ch = reader.read();
}
skipWhitespace(reader, lineReader);
ch = reader.read();
if(ch == expectedTermination2)
{
reader.unread(ch);
}
if ((ch != expectedTermination1) && (ch != expectedTermination2))
{
throw new IOException("Properties value must be terminated with '}' and '" + (char)expectedTermination1
+ " or " + (char)expectedTermination2
+ "' characters on line " + lineReader.getLineNumber() + " got a " + (char)ch);
}
return (properties);
}
/**
* @param reader TODO
* @param lineReader TODO
* @param expectedTermination1 TODO
* @param expectedTermination2 TODO
* @exception java.io.IOException
* @since VCafe 3.0
*/
protected String readStringValue(PushbackReader reader,
LineNumberReader lineReader,
int expectedTermination1,
int expectedTermination2)
throws IOException
{
int ch;
StringBuffer buf;
boolean trailingQuoteExpected = false;
buf = new StringBuffer();
skipWhitespace(reader, lineReader);
ch = reader.read();
if(ch == DBLQUOTE_CHAR)
{
trailingQuoteExpected = true;
ch = reader.read();
}
if(trailingQuoteExpected)
{
while(ch >= 0)
{
if (ch == BACKSLASH_CHAR)
{
// dblquotes and backslashes must be escaped in storage;
// strip off those escapes here
int nextch = reader.read();
if (nextch != DBLQUOTE_CHAR && nextch != BACKSLASH_CHAR)
{
buf.append((char)ch);
}
ch = nextch;
}
else if (ch == DBLQUOTE_CHAR)
{
skipWhitespace(reader, lineReader);
ch = reader.read();
if ((ch < 0) || (ch == expectedTermination1) || (ch == expectedTermination2))
{
break;
}
else
{
throw new IOException("Bad string value. Expected " + (char)expectedTermination1
+ " or " + (char)expectedTermination2
+ ", but got a " + (char)ch + " on line " + lineReader.getLineNumber());
}
}
buf.append((char)ch);
ch = reader.read();
}
}
else
{
while(((ch >= 0) && (ch != '\r') || (ch != '\n')) && (ch != expectedTermination1) && (ch != expectedTermination2))
{
buf.append((char)ch);
ch = reader.read();
}
}
if (ch == expectedTermination2)
{
reader.unread(ch);
}
return (buf.toString());
}
/**
* @param name TODO
* @exception java.io.IOException
* @since VCafe 3.0
*/
public synchronized void save(String name)
throws IOException
{
if(name != null)
{
String saveName;
File file;
File saveFile;
boolean fileRenamed;
saveName = name + "~~save";
file = new File(name);
saveFile = new File(saveName);
fileRenamed = false;
if(file.exists())
{
fileRenamed = file.renameTo(saveFile);
if(!fileRenamed)
{
throw new IOException("Couldn't rename " + name + " to backup file " + saveName);
}
}
try
{
OutputStream os;
os = null;
try
{
os = new FileOutputStream(name);
save(os);
}
finally
{
if(os != null)
{
os.close();
}
}
}
catch(IOException ex)
{
try
{
if(fileRenamed)
{
saveFile.renameTo(file); // put things back
}
}
catch(SecurityException sex)
{
}
throw(ex);
}
if(fileRenamed && !saveFile.delete())
{
throw new IOException("Couldn't delete backup file: " + saveName);
}
}
}
/**
* @param stream TODO
* @since VCafe 3.0
*/
public synchronized void save(OutputStream stream)
{
if(extendedPropertiesFileFormat)
{
try
{
stream.write(toString().getBytes());
saved = true;
}
catch(IOException ex)
{
// superclass doesn't declare this exception - bogus!
}
}
else
{
super.save(stream, "");
saved = true;
}
}
/**
* @param stream TODO
* @param header TODO
* @since VCafe 3.0
*/
public void save(OutputStream stream, String header)
{
if(extendedPropertiesFileFormat)
{
save(stream);
}
else
{
super.save(stream, header);
}
saved = true;
}
/**
* @since VCafe 3.0
*/
public String toString()
{
return (toString("").append((char)'\n').toString());
}
/**
* @param indentation TODO
* @since VCafe 3.0
*/
protected StringBuffer toString(String indentation)
{
StringBuffer buf;
buf = new StringBuffer(indentation + "{" + EOL);
for(Enumeration e = keys(); e.hasMoreElements();)
{
String key;
key = (String)e.nextElement();
if(key.indexOf('$') == -1)
{
buf.append(toString(key, indentation));
}
}
return (buf.append(indentation).append("}"));
}
protected StringBuffer toString(String key, String indentation)
{
String innerIndentation;
StringBuffer buf;
Object value;
buf = new StringBuffer();
if(get(key + "$Comment") != null)
{
buf.append(toString(key + "$Comment", indentation));
}
innerIndentation = indentation + INDENT;
value = get(key);
buf.append(innerIndentation).append(key).append(" = ");
if(value instanceof String)
{
if(key.indexOf('$') == -1)
{
buf.append(DBLQUOTE_CHAR).append(fixup((String)value)).append(DBLQUOTE_CHAR).append(';').append(EOL);
}
else
{
buf.append((String)value).append(EOL);
}
}
else if(value instanceof String[])
{
String[] array;
array = (String[])value;
buf.append(EOL).append(innerIndentation).append("(").append(EOL);
for(int i = 0; i < array.length; i++)
{
buf.append(innerIndentation).append("\t\"").append(fixup(array[i])).append(DBLQUOTE_CHAR).append(',').append(EOL);
}
buf.append(innerIndentation).append(");").append(EOL);
}
else if(value instanceof Properties)
{
Properties subProp;
subProp = (Properties)value;
buf.append(EOL).append(subProp.toString(innerIndentation)).append(";").append(EOL);
}
else if(value instanceof Properties[])
{
Properties[] array;
array = (Properties[])value;
buf.append(EOL).append(innerIndentation).append("(").append(EOL);
for(int i = 0; i < array.length; i++)
{
buf.append(indentation).append(array[i].toString(innerIndentation + INDENT)).append(",").append(EOL);
}
buf.append(innerIndentation).append(");").append(EOL);
}
else // shouldn't happen since we block "put(Object, Object)"
{
throw new IllegalArgumentException("Can't store a " + value.getClass() + " in a Properties");
}
return (buf);
}
/**
* @param s TODO
* @since VCafe 3.0
*/
protected static String fixup(String s)
{
// If the list of characters to escape grows further,
// it might be faster to make a single pass through the
// string, character by character. Depends on the data somewhat, too.
// Escape any backslashes
s = replace(s, BACKSLASH, BACKSLASH+BACKSLASH);
// Escape any double-quote chars
s = replace(s, DBLQUOTE, BACKSLASH+DBLQUOTE );
return s;
}
/**
* @param s TODO
* @param sOld TODO
* @param sNew TODO
* @since VCafe 3.0
*/
protected static String replace(String s, String sOld, String sNew )
{
StringBuffer sb = new StringBuffer();
int oldLen = sOld.length();
int index = -1;
int startIndex = 0;
while ( (index = s.indexOf(sOld,startIndex)) != -1 ) {
sb.append(s.substring(startIndex,index));
sb.append(sNew);
startIndex = index + oldLen;
}
sb.append(s.substring(startIndex));
return sb.toString();
}
private static final char
DBLQUOTE_CHAR = '\"',
BACKSLASH_CHAR = '\\';
private static final String
BACKSLASH = "\\",
DBLQUOTE = "\"",
EOL = "\r\n";
}