@SuppressWarnings("rawtypes") public static void createSourceDocumentContent(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(SOURCE)) {
      String fileName=FilenameUtils.getName(entryName);
      de.tudarmstadt.ukp.clarin.webanno.model.SourceDocument sourceDocument=aRepository.getSourceDocument(aProject,fileName);
      File sourceFilePath=aRepository.getSourceDocumentFile(sourceDocument);
      FileUtils.copyInputStreamToFile(zip.getInputStream(entry),sourceFilePath);
      LOG.info("Imported source document content for source document [" + sourceDocument.getId() + "] in project ["+ aProject.getName()+ "] with id ["+ aProject.getId()+ "]");
    }
  }
}

@ SuppressWarnings ( "rawtypes" ) public static void createSourceDocumentContent ( 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 ( SOURCE ) ) { String fileName = FilenameUtils . getName ( entryName ) ; de . tudarmstadt . ukp . clarin . webanno . model . SourceDocument sourceDocument = aRepository . getSourceDocument ( aProject , fileName ) ; File sourceFilePath = aRepository . getSourceDocumentFile ( sourceDocument ) ; FileUtils . copyInputStreamToFile ( zip . getInputStream ( entry ) , sourceFilePath ) ; LOG . info ( "Imported source document content for source document [" + sourceDocument . getId ( ) + "] in project [" + aProject . getName ( ) + "] with id [" + aProject . getId ( ) + "]" ) ; } } }
copy source document files from the exported source documents
