PropertyConfigurator.configure("log4j.lcf");
String dirIni;
String dirFin;
boolean boolFilter;
String strFilter;
DirFilter dirFilter = null;
errorNum = 0;
if (argv.length < 1) {
log4j
.error("Usage: java org.openbravo.data.Sqlc connection.xml [fileTermination [sourceDir destinyDir [write_txt_files]]]");
return;
}
final Sqlc sqlc = new Sqlc();
XMLReader parser;
parser = new SAXParser();
if (argv.length <= 4)
sqlc.writeTxtFiles = false;
else
sqlc.writeTxtFiles = argv[4].equalsIgnoreCase("true");
parser.setContentHandler(sqlc);
final String strFileConnection = argv[0];
sqlc.readProperties(strFileConnection);
// the first parameter is the directory where the search is done
if (argv.length <= 2)
dirIni = ".";
else
dirIni = argv[2];
if (argv.length <= 3)
dirFin = dirIni;
else
dirFin = argv[3];
// include only directories (and sub-directories under this one) with
// this pattern, the packaging will be from this point, not from call
// point
if (argv.length <= 4)
includeDirectories = null;
else
includeDirectories = getDirectories(argv[4]);
// the second parameter is the string-chain to make the filter
// the file must end with this string-chain in order to be recognized
boolFilter = true; // there always must be a termination
if (argv.length <= 1)
strFilter = ".xml";
else
strFilter = argv[1];
dirFilter = new DirFilter(strFilter);
log4j.info("directory source: " + dirIni);
log4j.info("directory destiny: " + dirFin);
log4j.info("file termination: " + strFilter);
log4j.info("file connection: " + strFileConnection);
log4j.info("Write TXT Files: " + sqlc.writeTxtFiles);