@Override
 public void processItem(CopyToEnvironmentItem item) throws DeploymentException {
   String liveEnvironment = _contentRepository.getLiveEnvironmentName(item.getSite());
   boolean isLive = false;
   if (StringUtils.isNotEmpty(liveEnvironment)) {
     if (liveEnvironment.equals(item.getEnvironment())) {
       isLive = true;
     }
   } else if (LIVE_ENVIRONMENT.equalsIgnoreCase(item.getEnvironment())
       || PRODUCTION_ENVIRONMENT.equalsIgnoreCase(item.getEnvironment())) {
     isLive = true;
   }
   if (item.getAction() == CopyToEnvironmentItem.Action.DELETE) {
     if (item.getOldPath() != null && item.getOldPath().length() > 0) {
       _contentRepository.deleteContent(item.getSite(), item.getEnvironment(), item.getOldPath());
       _contentRepository.clearRenamed(item.getSite(), item.getPath());
     }
     _contentRepository.deleteContent(item.getSite(), item.getEnvironment(), item.getPath());
     if (isLive) {
       _contentRepository.deleteContent(item);
     }
   } else {
     _contentRepository.setSystemProcessing(item.getSite(), item.getPath(), true);
     if (isLive) {
       if (!_importModeEnabled) {
         _contentRepository.createNewVersion(
             item.getSite(), item.getPath(), item.getSubmissionComment(), true);
       } else {
         LOGGER.debug(
             "Import mode is ON. Create new version is skipped for [{0}] site \"{1}\"",
             item.getPath(), item.getSite());
       }
     }
     if (item.getAction() == CopyToEnvironmentItem.Action.MOVE) {
       if (item.getOldPath() != null && item.getOldPath().length() > 0) {
         _contentRepository.deleteContent(
             item.getSite(), item.getEnvironment(), item.getOldPath());
         if (isLive) {
           _contentRepository.clearRenamed(item.getSite(), item.getPath());
         }
       }
     }
     _contentRepository.copyToEnvironment(item.getSite(), item.getEnvironment(), item.getPath());
     if (isLive) {
       _contentRepository.stateTransition(
           item.getSite(), item.getPath(), TransitionEvent.DEPLOYMENT);
     }
     _contentRepository.setSystemProcessing(item.getSite(), item.getPath(), false);
   }
 }