All Downloads are FREE. Search and download functionalities are using the official Maven repository.

de.schlichtherle.truezip.sample.file.app.Decrypt Maven / Gradle / Ivy

Go to download

Sample applications to demonstrate the usage of various TrueZIP module APIs. Some of these samples use rather advanced or exotic features which makes them more complex than necessary for a typical application. By design, the sample applications use all file system drivers which can be located at runtime. Location of the available file system drivers is performed by scanning the class path - see the Javaodoc for the TrueZIP Kernel class de.schlichtherle.truezip.fs.sl.FsDriverLocator for more information.

There is a newer version: 7.7.10
Show newest version
/*
 * Copyright (C) 2007-2011 Schlichtherle IT Services
 *
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 */
package de.schlichtherle.truezip.sample.file.app;

import de.schlichtherle.truezip.sample.file.RaesFiles;
import de.schlichtherle.truezip.fs.FsSyncException;
import java.io.IOException;
import java.util.ResourceBundle;

/**
 * Decrypts the contents of the RAES file provided as the first argument
 * into the file provided as the second argument for the main method.
 * 

* Please note that you should not use this utility to decrypt an RAES * encrypted ZIP file (usually a file with a {@code ".tzp"} or * {@code ".zip.rae"} suffix) back to a plain ZIP file. * This is because RAES encrypted ZIP files use the "UTF-8" * as their character set, whereas plain ZIP files use "IBM437", * a.k.a. "CP437". * To decrypt an RAES encrypted ZIP file to a plain ZIP file, use the * {@code cp} command of the {@link Nzip} class instead. * This class knows about the correct character set charsets for the * various flavours of ZIP compatible files. * * @author Christian Schlichtherle * @version $Id$ */ public class Decrypt extends Application { private static final String CLASS_NAME = Decrypt.class.getName(); private static final ResourceBundle resources = ResourceBundle.getBundle(CLASS_NAME); /** Equivalent to {@code System.exit(new Decrypt().run(args));}. */ public static void main(final String[] args) throws FsSyncException { System.exit(new Decrypt().run(args)); } @Override protected int runChecked(final String[] args) throws IllegalUsageException, IOException { if (args.length != 2) throw new IllegalUsageException(resources.getString("usage")); RaesFiles.decrypt(args[0], args[1], true); return 0; } }





© 2015 - 2024 Weber Informatics LLC | Privacy Policy