public static IScanTarget createScanTargetsFromFile(String fileToProcess, string workDirectory,
                                                            bool autoAppendTargetName)
        {
            IScanTarget scanTarget = null;

            switch (Path.GetExtension(fileToProcess))
            {
            case ".sln":
            case ".paf":
            case ".gaf":
            case ".ewf":
                scanTarget = new ScanTarget_Paf();
                break;

            case ".java":
            case ".class":
                scanTarget = new ScanTarget_Java();
                break;

            case ".dll":
            case ".exe":
                scanTarget = new ScanTarget_DotNet();
                break;

            case ".epf":
            case ".ppf":
            case ".gpf":
                scanTarget    = new ScanTarget_Paf();
                fileToProcess = Utils.ScanSupport.createTempApplicationFileForProject(fileToProcess, true, workDirectory);
                break;

            default:
                DI.log.debug("in addFileToProcess, file type not supported: {0}:",
                             Path.GetExtension(fileToProcess));
                break;
            }
            if (scanTarget != null)
            {
                scanTarget.useFileNameOnWorkDirecory = autoAppendTargetName;
                scanTarget.WorkDirectory             = workDirectory;
                scanTarget.Target = fileToProcess;
            }
            return(scanTarget);
        }
Esempio n. 2
0
 public static IScanTarget createScanTargetsFromFile(String fileToProcess, string workDirectory,
                                                     bool autoAppendTargetName)
 {
     IScanTarget scanTarget = null;
     switch (Path.GetExtension(fileToProcess))
     {
         case ".sln":
         case ".paf":
         case ".gaf":
         case ".ewf":
             scanTarget = new ScanTarget_Paf();
             break;
         case ".java":
         case ".class":                
             scanTarget = new ScanTarget_Java();
             break;
         case ".dll":
         case ".exe":
             scanTarget = new ScanTarget_DotNet();
             break;
         case ".epf":
         case ".ppf":
         case ".gpf":
             scanTarget = new ScanTarget_Paf();
             fileToProcess = Utils.ScanSupport.createTempApplicationFileForProject(fileToProcess, true, workDirectory);
             break;
         default:
             DI.log.debug("in addFileToProcess, file type not supported: {0}:",
                          Path.GetExtension(fileToProcess));
             break;
     }
     if (scanTarget != null)
     {
         scanTarget.useFileNameOnWorkDirecory = autoAppendTargetName;
         scanTarget.WorkDirectory = workDirectory;
         scanTarget.Target = fileToProcess;
     }
     return scanTarget;
 }