com.ptc.windchill.structconf
Class RebuildAnalyzer
java.lang.Object
com.ptc.windchill.structconf.RebuildAnalyzer
- public class RebuildAnalyzer
- extends Object
Determines if xconf files need to be propagated into derived properties files.
It does this by:
- Scanning the declarative and site-specific xconf files for
target file references
- Determining if any of the target files is missing; if so report that target
files should be regenerated
- If all target files are present, compare their timestamps to the xconf
file timestamps; if any xconf file is newer than any target file, report that
target files should be regenerated
- Cache the xconf and target files in a local "hidden" file to speed future
scans. As long as this cache is newer than all xconf files, then you can
quickly avoid rescanning all the xconf files
This class can be created once and shouldPropagate(boolean,boolean
may invoked repeatedly. Each time it is invoked, the analysis will be reperformed.
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
PROP_XCONF_DEPENDENCY_CACHE_FILE
private static final String PROP_XCONF_DEPENDENCY_CACHE_FILE
- See Also:
- Constant Field Values
TARGET_FILE_HINTS_FILE
private static final String TARGET_FILE_HINTS_FILE
- See Also:
- Constant Field Values
sourceFileSet_
private HashSet sourceFileSet_
targetFileSet_
private HashSet targetFileSet_
targetFileInfoHints_
private HashMap targetFileInfoHints_
propagatableItemCount_
private int propagatableItemCount_
cachedTargetFileHintsFileTimestamp_
private long cachedTargetFileHintsFileTimestamp_
propertiesHtmlFile_
private File propertiesHtmlFile_
descriptPropsFile_
private File descriptPropsFile_
RebuildAnalyzer
public RebuildAnalyzer()
show
private void show(String title,
HashSet file_set)
readCachedDependencies
private boolean readCachedDependencies()
throws StructConfManagerException
- Returns:
- true if the file was successfully read
- Throws:
StructConfManagerException
cacheDependencies
private void cacheDependencies()
throws StructConfManagerException
- Throws:
StructConfManagerException
getHintsFor
private FileUtil.FileInfo getHintsFor(File file)
throws StructConfManagerException
- Throws:
StructConfManagerException
readHints
private boolean readHints()
throws StructConfManagerException
- Throws:
StructConfManagerException
updateTargetFileHints
public void updateTargetFileHints(FileUtil.FileInfo[] file_infos)
throws StructConfManagerException
- Throws:
StructConfManagerException
hintsUpToDate
private boolean hintsUpToDate()
decommafy
private String decommafy(String str)
commafy
private String commafy(String str)
scanXconfsForDependencies
private void scanXconfsForDependencies()
throws StructConfManagerException
- Throws:
StructConfManagerException
shouldScanForDependencies
private boolean shouldScanForDependencies()
throws StructConfManagerException
- Throws:
StructConfManagerException
outOfDate
private boolean outOfDate(boolean force_xconf_scan)
throws StructConfManagerException
- Throws:
StructConfManagerException
lastModified
private long lastModified(URL url)
throws IOException
- Returns:
- 0L if it cannot be determined
- Throws:
IOException
shouldPropagate
public boolean shouldPropagate(boolean force_propagate,
boolean force_xconf_scan)
throws StructConfManagerException
- Throws:
StructConfManagerException
getTargetFileHintsFile
private File getTargetFileHintsFile()
getPropXconfDepCacheFile
private File getPropXconfDepCacheFile()