Exemplo n.º 1
0
 private void initSystemLogger() {
   File loggerConfig = new File(deployDir, LOGGER_CONFIG);
   if (loggerConfig.canRead()) {
     hasSystemLogger = true;
     try {
       register(loggerConfig);
       deploy();
     } catch (Exception e) {
       getLog().warn("init-system-logger", e);
     }
   }
   getLog().info("Q2 started, deployDir=" + deployDir.getAbsolutePath());
 }
Exemplo n.º 2
0
  public static int checkFiles(String[] filenames) {
    int errors = 0;

    for (String filename : filenames) {
      File file = new File(filename);
      if (!file.exists()) {
        System.err.println("error: file not found: " + file);
        ++errors;
      } else if (!file.canRead()) {
        System.err.println("error: file not readable: " + file);
        ++errors;
      }
    }

    return errors;
  }
Exemplo n.º 3
0
 public boolean accept(File f) {
   return f.canRead()
       && (f.getName().endsWith(".xml")
           || (recursive && f.isDirectory() && !"lib".equalsIgnoreCase(f.getName())));
 }