Examples of ZipFileExtractor


Examples of edu.stanford.bmir.protege.web.server.util.ZipFileExtractor

    }


    private RawProjectSources extractZipFile(File zipFile) throws IOException {
        File tempDirectory = tempFileFactory.createTempDirectory();
        ZipFileExtractor extractor = new ZipFileExtractor();
        extractor.extractFileToDirectory(zipFile, tempDirectory);
        Optional<File> rootOntologyDocument = getRootOntologyDocumentFile(tempDirectory);
        if(!rootOntologyDocument.isPresent()) {
            throw new FileNotFoundException(rootOntologyDocumentFileMatcher.getErrorMessage());
        }
        return new ExtractedZipArchiveProjectSources(rootOntologyDocument.get(), tempDirectory);
View Full Code Here

Examples of edu.stanford.bmir.protege.web.server.util.ZipFileExtractor

        zipOutputStream.write(bytes);
        ZipEntry entryC = new ZipEntry("/EmptyDirectory/");
        zipOutputStream.putNextEntry(entryC);
        zipOutputStream.close();

        ZipFileExtractor extractor = new ZipFileExtractor();
        File outputDirectory = folder.newFolder("out");
        extractor.extractFileToDirectory(zipFile, outputDirectory);
        File extractedFileA = new File(outputDirectory, "FileA");
        assertTrue(extractedFileA.exists());
        assertEquals(extractedFileA.length(), 100);
        File extractedFileB = new File(outputDirectory, "/Directory/FileB");
        assertTrue(extractedFileB.exists());
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.