net.java.truevfs.samples.raes.Encrypt Maven / Gradle / Ivy
Show all versions of truevfs-samples Show documentation
/*
* Copyright (C) 2005-2013 Schlichtherle IT Services.
* All rights reserved. Use is subject to license terms.
*/
package net.java.truevfs.samples.raes;
import java.io.IOException;
import net.java.truevfs.access.TPath;
/**
* Encrypts the contents of the file provided as the first argument
* into the RAES file provided as the second argument for the main method.
*
* Please note that you should not use this utility to encrypt a plain
* ZIP file to an RAES encrypted ZIP file (usually a file with a
* {@code ".zip.rae"} or {@code ".zip.raes"} extension).
* 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".
*
* @author Christian Schlichtherle
*/
public class Encrypt extends Application {
public static void main(String[] args) throws IOException {
System.exit(new Encrypt().run(args));
}
@Override
void runChecked(final String[] args) throws IOException {
if (2 != args.length) throw new IllegalArgumentException();
Raes.encrypt( new TPath(args[0]).toNonArchivePath(),
new TPath(args[1]).toNonArchivePath());
}
}