Package de.schlichtherle.io

Examples of de.schlichtherle.io.ArchiveDetector


    }

    @Override
    public DescriptorData create(java.io.File jitterpack) throws IOException, IllegalDataFormatException {
        boolean isEncrypted = EncryptionChecker.isPossibleEncryptedJitterPack(jitterpack);
        ArchiveDetector detector = TrueZipUtils.getArchiveDetector(password);
        File source = new File(jitterpack, detector);
        java.io.File[] topLevelFiles = source.listFiles();
        if (topLevelFiles != null) {
            int length = topLevelFiles.length;
            if (length == 1) {
View Full Code Here


    public abstract DescriptorData create(java.io.File jitterpack) throws IOException, IllegalDataFormatException;
   
    public static DescriptorDataFactory newInstance(java.io.File jitterpack, char[] password, String headerFilename)
                                                throws IllegalDataFormatException {
        if (password == null) {
            ArchiveDetector detector = TrueZipUtils.getArchiveDetector(null);
            File source = new File(jitterpack, detector);
            java.io.File[] topLevelFiles = source.listFiles();
            if (topLevelFiles != null) {
                int length = topLevelFiles.length;
                if (length == 1) {
View Full Code Here

        if (target.exists()) {
            if (!target.delete()) {
                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.");
        }
View Full Code Here

        return target.archiveCopyFrom(new File(toArchive.getCanonicalPath()));
    }
   
    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.ArchiveDetector

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.