@SuppressWarnings("rawtypes") public static void createProjectConstraint(ZipFile zip,Project aProject,RepositoryService aRepository) throws IOException {
  for (Enumeration zipEnumerate=zip.entries(); zipEnumerate.hasMoreElements(); ) {
    ZipEntry entry=(ZipEntry)zipEnumerate.nextElement();
    String entryName=normalizeEntryName(entry);
    if (entryName.startsWith(CONSTRAINTS)) {
      String filename=FilenameUtils.getName(entry.getName());
      ConstraintSet constraintSet=new ConstraintSet();
      constraintSet.setProject(aProject);
      constraintSet.setName(filename);
      aRepository.createConstraintSet(constraintSet);
      aRepository.writeConstraintSet(constraintSet,zip.getInputStream(entry));
      LOG.info("Imported constraint [" + filename + "] for project ["+ aProject.getName()+ "] with id ["+ aProject.getId()+ "]");
    }
  }
}

@ SuppressWarnings ( "rawtypes" ) public static void createProjectConstraint ( ZipFile zip , Project aProject , RepositoryService aRepository ) throws IOException { for ( Enumeration zipEnumerate = zip . entries ( ) ; zipEnumerate . hasMoreElements ( ) ; ) { ZipEntry entry = ( ZipEntry ) zipEnumerate . nextElement ( ) ; String entryName = normalizeEntryName ( entry ) ; if ( entryName . startsWith ( CONSTRAINTS ) ) { String filename = FilenameUtils . getName ( entry . getName ( ) ) ; ConstraintSet constraintSet = new ConstraintSet ( ) ; constraintSet . setProject ( aProject ) ; constraintSet . setName ( filename ) ; aRepository . createConstraintSet ( constraintSet ) ; aRepository . writeConstraintSet ( constraintSet , zip . getInputStream ( entry ) ) ; LOG . info ( "Imported constraint [" + filename + "] for project [" + aProject . getName ( ) + "] with id [" + aProject . getId ( ) + "]" ) ; } } }
copy constraints from the exported project
