Ejemplo n.º 1
0
  /**
   * Scans the directory looking for source files to be decompiled. The results are returned in the
   * instance variable <code>reportFilesMap</code>.
   *
   * @param srcdir source directory
   * @param destdir destination directory
   * @param files included file names
   */
  protected void scanDir(File srcdir, File destdir, String[] files) {
    RegexpPatternMapper mapper = new RegexpPatternMapper();
    mapper.setFrom("^(.*)\\.(.*)$");
    mapper.setTo("\\1.jasper.jrxml");

    SourceFileScanner scanner = new SourceFileScanner(this);
    String[] newFiles = scanner.restrict(files, srcdir, destdir, mapper);

    if (newFiles != null && newFiles.length > 0) {
      for (int i = 0; i < newFiles.length; i++) {
        reportFilesMap.put(
            (new File(srcdir, newFiles[i])).getAbsolutePath(),
            (new File(destdir, mapper.mapFileName(newFiles[i])[0])).getAbsolutePath());
      }
    }
  }
Ejemplo n.º 2
0
 /**
  * Scans the directory looking for class files to be compiled. The result is returned in the class
  * variable compileList.
  *
  * @param baseDir the base direction
  * @param files the list of files to scan
  * @param mapper the mapper of files to target files
  */
 protected void scanDir(File baseDir, String[] files, FileNameMapper mapper) {
   String[] newFiles = files;
   if (idl) {
     log("will leave uptodate test to rmic implementation in idl mode.", Project.MSG_VERBOSE);
   } else if (iiop && iiopOpts != null && iiopOpts.indexOf("-always") > -1) {
     log("no uptodate test as -always option has been specified", Project.MSG_VERBOSE);
   } else {
     SourceFileScanner sfs = new SourceFileScanner(this);
     newFiles = sfs.restrict(files, baseDir, getOutputDir(), mapper);
   }
   for (int i = 0; i < newFiles.length; i++) {
     String name = newFiles[i].replace(File.separatorChar, '.');
     name = name.substring(0, name.lastIndexOf(".class"));
     compileList.addElement(name);
   }
 }
Ejemplo n.º 3
0
 /**
  * Return the list of Directories from this DirectoryScanner that should be included on the
  * command line - i.e. only those that are newer than the corresponding target files.
  */
 protected String[] getDirs(File baseDir, DirectoryScanner ds) {
   SourceFileScanner sfs = new SourceFileScanner(this);
   return sfs.restrict(ds.getIncludedDirectories(), baseDir, destDir, mapper);
 }