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

net.java.truevfs.samples.raes.Encrypt Maven / Gradle / Ivy

Go to download

Sample applications to demonstrate the usage of TrueVFS modules to support many, even esoteric use cases.

There is a newer version: 0.14.0
Show newest version
/*
 * 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()); } }





© 2015 - 2024 Weber Informatics LLC | Privacy Policy