Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.apache.tools.ant.util
Class SourceFileScanner

    java.lang.Object
      |
      +--org.apache.tools.ant.util.SourceFileScanner

public class SourceFileScanner
extends java.lang.Object

Utility class that collects the functionality of the various scanDir methods that have been scattered in several tasks before.

The only method returns an array of source files. The array is a subset of the files given as a parameter and holds only those that are newer than their corresponding target files.

Author:
  Stefan Bodewig

Field Summary
`protected Task` | `task`

Constructor Summary
`SourceFileScanner(Task task)`

Method Summary
`java.lang.String[]` | `restrict(java.lang.String[] files, java.io.File srcDir, java.io.File destDir, FileNameMapper mapper)` Restrict the given set of files to those that are newer than their corresponding target files.
`java.io.File[]` | `restrictAsFiles(java.lang.String[] files, java.io.File srcDir, java.io.File destDir, FileNameMapper mapper)` Convinience layer on top of restrict that returns the source files as File objects (containing absolute paths if srcDir is absolute).

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### task

    protected Task task

Constructor Detail

### SourceFileScanner

    public SourceFileScanner(Task task)

  Parameters:
    `task` - The task we should log messages through

Method Detail

### restrict

    public java.lang.String[] restrict(java.lang.String[] files,
                                       java.io.File srcDir,
                                       java.io.File destDir,
                                       FileNameMapper mapper)

  Restrict the given set of files to those that are newer than their corresponding target files.
  Parameters:
    `files` - the original set of files
    `srcDir` - all files are relative to this directory
    `destDir` - target files live here. if null file names returned by the mapper are assumed to be absolute.
    `mapper` - knows how to construct a target file names from source file names.

### restrictAsFiles

    public java.io.File[] restrictAsFiles(java.lang.String[] files,
                                          java.io.File srcDir,
                                          java.io.File destDir,
                                          FileNameMapper mapper)

  Convinience layer on top of restrict that returns the source files as File objects (containing absolute paths if srcDir is absolute).

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2000 Apache Software Foundation. All Rights Reserved.