01: /* *****************************************************************************
02: * gunzip.java
03: * ****************************************************************************/
04:
05: /* J_LZ_COPYRIGHT_BEGIN *******************************************************
06: * Copyright 2001-2004 Laszlo Systems, Inc. All Rights Reserved. *
07: * Use is subject to license terms. *
08: * J_LZ_COPYRIGHT_END *********************************************************/
09:
10: package org.openlaszlo.test;
11:
12: import java.io.*;
13: import org.openlaszlo.utils.FileUtils;
14:
15: public class gunzip {
16: static public void main(String args[]) {
17: try {
18: if (!args[0].endsWith(".gz")) {
19: System.err.println("filename must end with .gz");
20: System.exit(-1);
21: }
22: File src = new File(args[0]);
23: String out = args[0].substring(0, args[0].length() - 3);
24: File dest = new File(out);
25: long then = System.currentTimeMillis();
26: FileUtils.decode(src, dest, "gzip");
27: long now = System.currentTimeMillis();
28: System.out.println("wrote " + out + " in " + (now - then)
29: + " msecs");
30: } catch (Exception e) {
31: e.printStackTrace();
32: }
33: }
34: }
|