Package com.ibm.dbb.dependency
Class AbstractDependencyScanner
- java.lang.Object
-
- com.ibm.dbb.dependency.AbstractDependencyScanner
-
- All Implemented Interfaces:
IDependencyScanner
- Direct Known Subclasses:
DependencyScanner
,DummyScanner
,ZUnitConfigScanner
public abstract class AbstractDependencyScanner extends java.lang.Object implements IDependencyScanner
Abstract dependency scanner class to help jump start creating a new DBB source code scanner. Implements IDependencyScanner. Users just need to extend this class and implement methods:protected Object runScan(String file, InputStream is, String encoding); protected abstract LogicalFile createLogicalFile(String file, Object scanMetadata);
-
-
Constructor Summary
Constructors Constructor Description AbstractDependencyScanner()
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description java.lang.String
createLogicalName(java.lang.String fileName)
Create a logical name from a file name, for example: /u/user/test/cobol/myfile.cbl will create logical name MYFILELogicalFile
scan(java.lang.String file, java.io.InputStream inputStream)
Deprecated.As of release 2.0.1, replaced byscanStream(String, InputStream)
LogicalFile
scan(java.lang.String file, java.io.InputStream inputStream, java.lang.String encoding)
Deprecated.As of release 2.0.1, replaced byscanStream(String, InputStream, String)
LogicalFile
scan(java.lang.String file, java.lang.String sourceDir)
Scan and collect logical dependency of a fileLogicalFile
scan(java.lang.String file, java.lang.String sourceDir, java.lang.String encoding)
Scan and collect logical dependency of a filejava.util.List<LogicalFile>
scanArchive(java.lang.String archive, java.lang.String sourceDir)
Scan and collect logical dependencies from an archivejava.util.List<LogicalFile>
scanArchive(java.lang.String archive, java.lang.String sourceDir, java.lang.String encoding)
Scan and collect logical dependencies from an archiveLogicalFile
scanArchivedFile(java.lang.String archive, java.lang.String sourceDir, java.lang.String file)
Scan and collect the logical dependency from an archived fileLogicalFile
scanArchivedFile(java.lang.String archive, java.lang.String sourceDir, java.lang.String file, java.lang.String encoding)
Scan and collect the logical dependency from an archived fileLogicalFile
scanStream(java.lang.String file, java.io.InputStream inputStream)
Scan and collect logical dependency of a fileLogicalFile
scanStream(java.lang.String file, java.io.InputStream inputStream, java.lang.String encoding)
Scan and collect logical dependency of a file
-
-
-
Method Detail
-
scan
public LogicalFile scan(java.lang.String file, java.lang.String sourceDir) throws java.io.FileNotFoundException
Scan and collect logical dependency of a file- Specified by:
scan
in interfaceIDependencyScanner
- Parameters:
file
- the relative path of the file, or absolute path if sourceDir is null.sourceDir
- absolute path to the directory where the file is located, or null to use an absolute file path.- Returns:
- the scanned
LogicalFile
- Throws:
java.io.FileNotFoundException
- an exception occurred
-
scan
public LogicalFile scan(java.lang.String file, java.lang.String sourceDir, java.lang.String encoding) throws java.io.FileNotFoundException
Scan and collect logical dependency of a file- Specified by:
scan
in interfaceIDependencyScanner
- Parameters:
file
- the relative path of the file, or absolute path if sourceDir is null.sourceDir
- absolute path to the directory where the file is located, or null to use an absolute file path.encoding
- the encoding to be used to read the content of the file- Returns:
- the scanned
LogicalFile
- Throws:
java.io.FileNotFoundException
- an exception occurred
-
scanStream
public LogicalFile scanStream(java.lang.String file, java.io.InputStream inputStream)
Scan and collect logical dependency of a file- Parameters:
file
- the name of the fileinputStream
- the file content- Returns:
- the scanned
LogicalFile
-
scanStream
public LogicalFile scanStream(java.lang.String file, java.io.InputStream inputStream, java.lang.String encoding)
Scan and collect logical dependency of a file- Parameters:
file
- the name of the fileinputStream
- the file contentencoding
- the encoding to be used to read the content of the file- Returns:
- the scanned
LogicalFile
-
scan
@Deprecated public LogicalFile scan(java.lang.String file, java.io.InputStream inputStream)
Deprecated.As of release 2.0.1, replaced byscanStream(String, InputStream)
Scan and collect logical dependency of a file- Specified by:
scan
in interfaceIDependencyScanner
- Parameters:
file
- the name of the fileinputStream
- the file content- Returns:
- the scanned
LogicalFile
-
scan
@Deprecated public LogicalFile scan(java.lang.String file, java.io.InputStream inputStream, java.lang.String encoding)
Deprecated.As of release 2.0.1, replaced byscanStream(String, InputStream, String)
Scan and collect logical dependency of a file- Specified by:
scan
in interfaceIDependencyScanner
- Parameters:
file
- the name of the fileinputStream
- the file contentencoding
- the encoding to be used to read the content of the file- Returns:
- the scanned
LogicalFile
-
scanArchive
public java.util.List<LogicalFile> scanArchive(java.lang.String archive, java.lang.String sourceDir) throws BuildException
Scan and collect logical dependencies from an archive- Specified by:
scanArchive
in interfaceIDependencyScanner
- Parameters:
archive
- the name of the archivesourceDir
- the directory where the archive can be located- Returns:
- the scanned
List<LogicalFile>
- Throws:
BuildException
- an exception occurred
-
scanArchive
public java.util.List<LogicalFile> scanArchive(java.lang.String archive, java.lang.String sourceDir, java.lang.String encoding) throws BuildException
Scan and collect logical dependencies from an archive- Specified by:
scanArchive
in interfaceIDependencyScanner
- Parameters:
archive
- the name of the archivesourceDir
- the directory where the archive can be locatedencoding
- the encoding of the file content- Returns:
- the scanned
List<LogicalFile>
- Throws:
BuildException
- an exception occurred
-
scanArchivedFile
public LogicalFile scanArchivedFile(java.lang.String archive, java.lang.String sourceDir, java.lang.String file) throws BuildException
Scan and collect the logical dependency from an archived file- Specified by:
scanArchivedFile
in interfaceIDependencyScanner
- Parameters:
archive
- the name of the archivesourceDir
- the directory where the archive can be locatedfile
- the name of the file- Returns:
- the scanned
LogicalFile
- Throws:
BuildException
- an exception occurred
-
scanArchivedFile
public LogicalFile scanArchivedFile(java.lang.String archive, java.lang.String sourceDir, java.lang.String file, java.lang.String encoding) throws BuildException
Scan and collect the logical dependency from an archived file- Specified by:
scanArchivedFile
in interfaceIDependencyScanner
- Parameters:
archive
- the name of the archivesourceDir
- the directory where the archive can be locatedfile
- the name of the fileencoding
- the encoding- Returns:
- the scanned
LogicalFile
- Throws:
BuildException
- an exception occurred
-
createLogicalName
public java.lang.String createLogicalName(java.lang.String fileName)
Create a logical name from a file name, for example: /u/user/test/cobol/myfile.cbl will create logical name MYFILE- Parameters:
fileName
- the name of the file on HFS- Returns:
- the logical name
-
-