Package de.schlichtherle.io

Examples of de.schlichtherle.io.File


                throw new IOException("Failed to overwrite existing file.");
            }
        }
        ArchiveDetector detector = getArchiveDetector(params.getPassword());
        java.io.File target2 = new java.io.File(target, projectFolder.getName());
        File zipTmp = new File(target2, detector);
        if (!zipTmp.mkdirs()) {
            throw new IOException("Failed to create the file.");
        }
        PackingFileFilter filter = params.getFileFilter();
        for(java.io.File f : projectFolder.listFiles(FileUtils.DIRECTORIES)) {
            zipFolderImpl(zipTmp, detector, f, filter);
View Full Code Here


                                      PackingFileFilter filter) throws IOException {
        PackingFileFilter.Result res = filter.evaluateDirectory(toCopy);
        if (res == PackingFileFilter.EXCLUDE) {
            return;
        }
        File f2 = new File(toCopy.getCanonicalPath());
        File newParent = new File(currentFolder, toCopy.getName(), detector);
        newParent.mkdirs();
        if (res == PackingFileFilter.INCLUDE) {
            newParent.archiveCopyAllFrom(f2);
        } else if (res == PackingFileFilter.INCLUDE_SELECTIVELY) {
            newParent.archiveCopyFrom(f2);
            for (java.io.File child : toCopy.listFiles(FileUtils.DIRECTORIES)) {
                zipFolderImpl(newParent, detector, child, filter);
            }
            for (java.io.File f : toCopy.listFiles(FILES_ONLY)) {
                if (filter.evaluateFile(f) == PackingFileFilter.INCLUDE) {
View Full Code Here

            }
        }
    }

    private static boolean archiveFile(File destinationDir, java.io.File toArchive) throws IOException {
        File target = new File(destinationDir, toArchive.getName());
        return target.archiveCopyFrom(new File(toArchive.getCanonicalPath()));
    }
View Full Code Here

    }
   
    static void unzip(java.io.File jitterPack, java.io.File destination, char[] password)
                                        throws ArchiveException, InvalidPasswordException {
        ArchiveDetector detector = getArchiveDetector(password);
        File source = new File(jitterPack, detector);
        // TODO: This method seems to return false even if the zip-file
        // was unpacked successfully. Find out why:
        source.archiveCopyAllTo(destination);
        File.update();
    }
View Full Code Here

    static InputStream getInputStream(java.io.File folder, String fileToExtract, char[] password)
                                        throws IOException, InvalidPasswordException {
        // Note that if this method is called, the password is guaranteed to be correct
        // (otherwise we would have failed earlier on).
        ArchiveDetector detector = getArchiveDetector(password);
        File file = new File(folder, fileToExtract, detector);
        return new FileInputStream(file);
    }
View Full Code Here

    static InputStream getInputStream(java.io.File inputFile, char[] password)
                                        throws IOException, InvalidPasswordException {
        // Note that if this method is called, the password is  guaranteed to be correct
        // (otherwise we would have failed earlier on).
        ArchiveDetector detector = getArchiveDetector(password);
        File file = new File(inputFile, detector);
        return new FileInputStream(file);
    }
View Full Code Here

TOP

Related Classes of de.schlichtherle.io.File

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.