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

## org.owasp.dependencycheck
Class Engine

    java.lang.Object
      org.owasp.dependencycheck.Engine

    public class Engine

extends Object

Scans files, directories, etc. for Dependencies. Analyzers are loaded and used to process the files found by the scan, if a file is encountered and an Analyzer is associated with the file type then the file is turned into a dependency.

Author:
  Jeremy Long (jeremy.long@owasp.org)

Constructor Summary
`Engine()` Creates a new Engine.
`Engine(boolean autoUpdate)` Deprecated. This function should no longer be used; the autoupdate flag should be set using: `Settings.setBoolean(Settings.KEYS.AUTO_UPDATE, value);`

Method Summary
`void` | `analyzeDependencies()` Runs the analyzers against all of the dependencies.
`List<Analyzer>` | `getAnalyzers()` Returns a full list of all of the analyzers.
`List<Analyzer>` | `getAnalyzers(AnalysisPhase phase)` Get the List of the analyzers for a specific phase of analysis.
`List<Dependency>` | `getDependencies()` Get the dependencies identified.
`void` | `scan(File file)` Scans a given file or directory.
`void` | `scan(File[] files)` Scans an array of files or directories.
`void` | `scan(List<File> files)` Scans a list of files or directories.
`void` | `scan(Set<File> files)` Scans a list of files or directories.
`void` | `scan(String path)` Scans a given file or directory.
`void` | `scan(String[] paths)` Scans an array of files or directories.
`protected void` | `scanDirectory(File dir)` Recursively scans files and directories.
`protected void` | `scanFile(File file)` Scans a specified file.
`boolean` | `supportsExtension(String ext)` Checks all analyzers to see if an extension is supported.

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

Constructor Detail

### Engine

    public Engine()

  Creates a new Engine.

### Engine

    @Deprecated
    public Engine(boolean autoUpdate)

  Deprecated. This function should no longer be used; the autoupdate flag should be set using: `Settings.setBoolean(Settings.KEYS.AUTO_UPDATE, value);`

  Creates a new Engine.

  Parameters:
    `autoUpdate` - indicates whether or not data should be updated from the Internet

Method Detail

### getAnalyzers

    public List<Analyzer> getAnalyzers(AnalysisPhase phase)

  Get the List of the analyzers for a specific phase of analysis.

  Parameters:
    `phase` - the phase to get the configured analyzers.
  Returns:
    the analyzers loaded

### getDependencies

    public List<Dependency> getDependencies()

  Get the dependencies identified.

  Returns:
    the dependencies identified

### scan

    public void scan(String[] paths)

  Scans an array of files or directories. If a directory is specified, it will be scanned recursively. Any dependencies identified are added to the dependency collection.

  Parameters:
    `paths` - an array of paths to files or directories to be analyzed.
  Since:
    v0.3.2.5

### scan

    public void scan(String path)

  Scans a given file or directory. If a directory is specified, it will be scanned recursively. Any dependencies identified are added to the dependency collection.

  Parameters:
    `path` - the path to a file or directory to be analyzed.

### scan

    public void scan(File[] files)

  Scans an array of files or directories. If a directory is specified, it will be scanned recursively. Any dependencies identified are added to the dependency collection.

  Parameters:
    `files` - an array of paths to files or directories to be analyzed.
  Since:
    v0.3.2.5

### scan

    public void scan(Set<File> files)

  Scans a list of files or directories. If a directory is specified, it will be scanned recursively. Any dependencies identified are added to the dependency collection.

  Parameters:
    `files` - a set of paths to files or directories to be analyzed.
  Since:
    v0.3.2.5

### scan

    public void scan(List<File> files)

  Scans a list of files or directories. If a directory is specified, it will be scanned recursively. Any dependencies identified are added to the dependency collection.

  Parameters:
    `files` - a set of paths to files or directories to be analyzed.
  Since:
    v0.3.2.5

### scan

    public void scan(File file)

  Scans a given file or directory. If a directory is specified, it will be scanned recursively. Any dependencies identified are added to the dependency collection.

  Parameters:
    `file` - the path to a file or directory to be analyzed.
  Since:
    v0.3.2.4

### scanDirectory

    protected void scanDirectory(File dir)

  Recursively scans files and directories. Any dependencies identified are added to the dependency collection.

  Parameters:
    `dir` - the directory to scan.

### scanFile

    protected void scanFile(File file)

  Scans a specified file. If a dependency is identified it is added to the dependency collection.

  Parameters:
    `file` - The file to scan.

### analyzeDependencies

    public void analyzeDependencies()

  Runs the analyzers against all of the dependencies.

### getAnalyzers

    public List<Analyzer> getAnalyzers()

  Returns a full list of all of the analyzers. This is useful for reporting which analyzers where used.

  Returns:
    a list of Analyzers

### supportsExtension

    public boolean supportsExtension(String ext)

  Checks all analyzers to see if an extension is supported.

  Parameters:
    `ext` - a file extension
  Returns:
    true or false depending on whether or not the file extension is supported

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

Copyright © 2012-2013 OWASP. All Rights Reserved.