Package com.denimgroup.threadfix.data.entities

Examples of com.denimgroup.threadfix.data.entities.EmptyScan


        } else if (!ApplicationChannel.matchesFileHandleFormat(fileName)) {
            String message = "Bad file name (" + fileName + ") passed into addFileToQueue. Exiting.";
            LOG.error(message);
            throw new IllegalArgumentException(message);
    } else {
      EmptyScan emptyScan = new EmptyScan();
      emptyScan.setApplicationChannel(applicationChannelDao.retrieveById(channelId));
      emptyScan.setAlreadyProcessed(false);
      emptyScan.setDateUploaded(Calendar.getInstance());
      emptyScan.setFileName(fileName);
      emptyScanDao.saveOrUpdate(emptyScan);
      return emptyScan.getId();
    }
  }
View Full Code Here


    }
  }
 
  @Override
  public void addEmptyScanToQueue(Integer emptyScanId) {
    EmptyScan emptyScan = emptyScanDao.retrieveById(emptyScanId);
   
    if (emptyScan.getAlreadyProcessed() ||
        emptyScan.getApplicationChannel() == null ||
        emptyScan.getApplicationChannel().getId() == null ||
        emptyScan.getApplicationChannel().getApplication() == null ||
        emptyScan.getApplicationChannel().getApplication().getId() == null ||
        emptyScan.getApplicationChannel().getApplication().getOrganization() == null ||
        emptyScan.getApplicationChannel().getApplication().getOrganization().getId() == null ||
        emptyScan.getFileName() == null) {
      LOG.warn("The empty scan was not added to the queue. It was either already processed or incorrectly configured.");
      return;
    }
   
    ApplicationChannel applicationChannel = emptyScan.getApplicationChannel();
   
    Integer appId = applicationChannel.getApplication().getId();
    Integer orgId = applicationChannel.getApplication()
        .getOrganization().getId();

    String fileName = emptyScan.getFileName();
   
    queueSender.addScanToQueue(fileName, applicationChannel.getId(), orgId, appId, null, applicationChannel);
 
    emptyScan.setAlreadyProcessed(true);
    emptyScanDao.saveOrUpdate(emptyScan);
  }
View Full Code Here

    emptyScanDao.saveOrUpdate(emptyScan);
  }
 
  @Override
  public void deleteEmptyScan(Integer emptyScanId) {
    EmptyScan emptyScan = emptyScanDao.retrieveById(emptyScanId);
   
    if (emptyScan != null) {
      emptyScan.setAlreadyProcessed(true);
      File file = new File(emptyScan.getFileName());
      if (file.exists()) {
        if (!file.delete())
          file.deleteOnExit();
      }
     
View Full Code Here

TOP

Related Classes of com.denimgroup.threadfix.data.entities.EmptyScan

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.