Package org.openbravo.utils

Examples of org.openbravo.utils.DirFilter


    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);
View Full Code Here


   */
  public static void main(String argv[]) throws Exception {
    PropertyConfigurator.configure("log4j.lcf");
    String dirIni;
    boolean boolFilter;
    DirFilter dirFilter = null;
    String relativePath = "";

    if ((argv.length == 2) && argv[0].equals("clean")) {
      log4j.debug("clean AD_TEXTINTERFACES");
      final Translate translate = new Translate(argv[1]);
      translate.clean();
      return;
    }

    if (argv.length < 3) {
      log4j.error("Usage: java Translate Openbravo.properties fileTermination sourceDir");
      return;
    }

    final Translate translate = new Translate(argv[0], argv[1]);

    dirIni = argv[2].replace("\\", "/");

    if (argv.length > 3) {
      moduleDirectories = getDirectories(argv[3]);
      log4j.info("Translation for modules");
    }
    boolFilter = true;
    dirFilter = new DirFilter(fileTermination);
    log4j.info("directory source: " + dirIni);
    log4j.info("file termination: " + fileTermination);

    final File path = new File(dirIni, relativePath);
    if (!path.exists()) {
View Full Code Here

TOP

Related Classes of org.openbravo.utils.DirFilter

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.