|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.ptc.wgmecad.ProcessManager
Created by IntelliJ IDEA. User: barky Date: Jan 8, 2003 Time: 3:37:51 PM To change this template use Options | File Templates. Change History: 2004.02.12 Nickv: added bom template processing
Field Summary | |
private static FileFilter |
emptyFilter
|
protected FileManager |
fileMgr
|
static int |
HOOKRESPONSEDIALOG_X_LOCATION
|
static int |
HOOKRESPONSEDIALOG_Y_LOCATION
|
private static ProcessManager |
instance
|
(package private) static org.apache.log4j.Logger |
logger
|
private static int |
nominalZipSize
|
static String |
POST
|
static String |
POST_FUNC
|
static String |
PRE
|
static String |
PRE_FUNC
|
static String |
PRE_LOAD
|
protected static String |
separator
|
static String |
templateBOMName
|
static int |
zipWriteBlockSize
|
Constructor Summary | |
private |
ProcessManager()
|
Method Summary | |
private void |
copyFileAndSubstitute(InputStream is,
OutputStream os,
String fromName,
String toName,
String fromNum,
String toNum)
|
private boolean |
execute(DesignAll _design,
String[] commandAndArgs,
PrintStream output)
return true on execution of the command without any exceptions being thrown |
static boolean |
execute(String command,
PrintStream output,
String[] env,
boolean waitFlag)
return true on execution of the command without any exceptions being thrown |
boolean |
executeBOM(DesignAll _design,
File cpmFile,
File output,
File tempDir,
PrintStream outputStream)
|
boolean |
executeHook(DesignAll _design,
String function,
String when)
Execute the appropriate hook function |
boolean |
executeInternalHook(DesignAll _design,
String function,
String when,
String _ecadTool,
String _command)
Execute the appropriate hook function |
boolean |
executeOhio(String fileName)
Execute the appropriate hook function |
boolean |
executeUnzip(String fileName)
Execute the appropriate hook function |
boolean |
extractPkgFile(File pkgFile,
File toLocation)
This method basically unzips the file into the target toLocation directory |
private String[] |
getCommandEnvironment(DesignAll _design,
String command,
String function,
String when,
String _ecadTool)
provide 4 args to the tools being called: WGM function being executed where in the process it is the main Assembly number the project location or file |
static Vector |
getDirectoryContent(File root)
recursively traverses a directory (root) and creates a vector of all files/subdirectories it contains. |
static Vector |
getDirectoryContent(File root,
FileFilter filter,
boolean traverseSubDirectories)
filtered version of getDirectorContent. |
private File[] |
getFilesForDirectory(File inputFile,
File excludeDir)
|
static File[] |
getFilesForDirectory(File inputFile,
Vector excludeDirs)
handle multiple exclude directories |
static ProcessManager |
getInstance()
|
static ProgressMonitor |
getProgressMonitor(String resourceKey,
int blocks)
|
static ProgressMonitor |
getProgressMonitor(String resourceKey,
int blocks,
String fileName)
|
static Object[] |
getTemplateBomTotaledProperties()
parse the template bom and pull out the properties that have a total associated with them |
int |
getTotalInitTime()
|
int |
getTotalOperation()
|
int |
getTotalPre()
|
FilterInputStream |
getZStream(File pkgFile)
|
static void |
main(String[] args)
|
private boolean |
processCommandOutput(String commandOutputString,
String commandArgument)
when a hook executes and returns a status, we need to parse it. |
static boolean |
recursiveDeleteDirectory(File dir)
|
static boolean |
recursiveDeleteDirectory(File dir,
File[] excl)
|
private boolean |
showHookResponseDialog(String errorType,
boolean aButton,
boolean cButton,
String message,
String commandArgument)
|
private String |
substCommandMacros(String command)
|
Vector |
writeZipFile(File zipFile,
File root,
File[] inputFiles,
ZipOutputStream zipout,
HashMap alreadyArchived)
|
Vector |
writeZipFile(File zipFile,
File inputFile,
File excludeDir,
ZipOutputStream zipout,
HashMap alreadyArchived)
|
Vector |
writeZipFile(File zipFile,
File inputFile,
Vector excludeDirs,
ZipOutputStream zipout,
HashMap alreadyArchived)
Allow multiple exclude directories |
Vector |
writeZipFile(File zipFile,
File inputFile,
ZipOutputStream zipout,
HashMap alreadyArchived)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected FileManager fileMgr
public static final int zipWriteBlockSize
private static final FileFilter emptyFilter
public static final String templateBOMName
public static final String PRE_LOAD
public static final String PRE
public static final String PRE_FUNC
public static final String POST
public static final String POST_FUNC
public static final int HOOKRESPONSEDIALOG_X_LOCATION
public static final int HOOKRESPONSEDIALOG_Y_LOCATION
protected static final String separator
private static ProcessManager instance
static org.apache.log4j.Logger logger
private static final int nominalZipSize
Constructor Detail |
private ProcessManager()
Method Detail |
public static ProcessManager getInstance()
public static boolean recursiveDeleteDirectory(File dir)
public static boolean recursiveDeleteDirectory(File dir, File[] excl)
public static Vector getDirectoryContent(File root)
root
- - directory to traverse
public static Vector getDirectoryContent(File root, FileFilter filter, boolean traverseSubDirectories)
root
- filter
- traverseSubDirectories
- - true to cause it to enumerate the files of the subdirectories
public Vector writeZipFile(File zipFile, File inputFile, ZipOutputStream zipout, HashMap alreadyArchived) throws IOException, FileNotFoundException, zipFileCreationInterruptedException
IOException
FileNotFoundException
zipFileCreationInterruptedException
public Vector writeZipFile(File zipFile, File inputFile, File excludeDir, ZipOutputStream zipout, HashMap alreadyArchived) throws IOException, FileNotFoundException, zipFileCreationInterruptedException
IOException
FileNotFoundException
zipFileCreationInterruptedException
public Vector writeZipFile(File zipFile, File inputFile, Vector excludeDirs, ZipOutputStream zipout, HashMap alreadyArchived) throws IOException, FileNotFoundException, zipFileCreationInterruptedException
zipFile
- inputFile
- excludeDirs
-
IOException
FileNotFoundException
zipFileCreationInterruptedException
private File[] getFilesForDirectory(File inputFile, File excludeDir)
public static File[] getFilesForDirectory(File inputFile, Vector excludeDirs)
inputFile
- excludeDirs
-
public FilterInputStream getZStream(File pkgFile) throws IOException
IOException
public boolean extractPkgFile(File pkgFile, File toLocation) throws IOException, FileNotFoundException, CancelledException
toLocation
- this is where the zip file will be unzipped to. Will be created if not already existing.
IOException
FileNotFoundException
CancelledException
public static ProgressMonitor getProgressMonitor(String resourceKey, int blocks)
public static ProgressMonitor getProgressMonitor(String resourceKey, int blocks, String fileName)
public Vector writeZipFile(File zipFile, File root, File[] inputFiles, ZipOutputStream zipout, HashMap alreadyArchived) throws IOException, FileNotFoundException, zipFileCreationInterruptedException
IOException
FileNotFoundException
zipFileCreationInterruptedException
public static Object[] getTemplateBomTotaledProperties()
public boolean executeBOM(DesignAll _design, File cpmFile, File output, File tempDir, PrintStream outputStream) throws InternalBomFailedException
InternalBomFailedException
private void copyFileAndSubstitute(InputStream is, OutputStream os, String fromName, String toName, String fromNum, String toNum) throws IOException
IOException
public static void main(String[] args)
public boolean executeHook(DesignAll _design, String function, String when) throws ApplicationInvocationException
function
- the resource key for the function being executedwhen
- the resource key for the timing (pre/post/post function etc.)
ApplicationInvocationException
public boolean executeInternalHook(DesignAll _design, String function, String when, String _ecadTool, String _command) throws ApplicationInvocationException
function
- the resource key for the function being executedwhen
- the resource key for the timing (pre/post/post function etc.)
ApplicationInvocationException
public boolean executeOhio(String fileName) throws ApplicationInvocationException
ApplicationInvocationException
public boolean executeUnzip(String fileName) throws ApplicationInvocationException
ApplicationInvocationException
private boolean processCommandOutput(String commandOutputString, String commandArgument)
commandOutputString
-
private boolean showHookResponseDialog(String errorType, boolean aButton, boolean cButton, String message, String commandArgument)
public static boolean execute(String command, PrintStream output, String[] env, boolean waitFlag) throws ApplicationInvocationException
command
- - the exact command to run
ApplicationInvocationException
- thrown if any exception is thrown while running
the command.private boolean execute(DesignAll _design, String[] commandAndArgs, PrintStream output) throws ApplicationInvocationException
commandAndArgs
- - the exact command to run
ApplicationInvocationException
- thrown if any exception is thrown while running
the command.()private String[] getCommandEnvironment(DesignAll _design, String command, String function, String when, String _ecadTool)
function
- when
-
private String substCommandMacros(String command)
public int getTotalPre()
getTotalPre
in interface IRegisterProgress
public int getTotalOperation()
getTotalOperation
in interface IRegisterProgress
public int getTotalInitTime()
getTotalInitTime
in interface IRegisterProgress
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |