jdk/src/share/classes/com/sun/java/util/jar/pack/DriverResource.java
author duke
Sat, 01 Dec 2007 00:00:00 +0000
changeset 2 90ce3da70b43
child 5506 202f599c92aa
permissions -rw-r--r--
Initial load
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     1
/*
90ce3da70b43 Initial load
duke
parents:
diff changeset
     2
 * Portions Copyright 2005 Sun Microsystems, Inc.  All Rights Reserved.
90ce3da70b43 Initial load
duke
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
90ce3da70b43 Initial load
duke
parents:
diff changeset
     4
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
90ce3da70b43 Initial load
duke
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
90ce3da70b43 Initial load
duke
parents:
diff changeset
     7
 * published by the Free Software Foundation.  Sun designates this
90ce3da70b43 Initial load
duke
parents:
diff changeset
     8
 * particular file as subject to the "Classpath" exception as provided
90ce3da70b43 Initial load
duke
parents:
diff changeset
     9
 * by Sun in the LICENSE file that accompanied this code.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    10
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    11
 * This code is distributed in the hope that it will be useful, but WITHOUT
90ce3da70b43 Initial load
duke
parents:
diff changeset
    12
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
90ce3da70b43 Initial load
duke
parents:
diff changeset
    13
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
90ce3da70b43 Initial load
duke
parents:
diff changeset
    14
 * version 2 for more details (a copy is included in the LICENSE file that
90ce3da70b43 Initial load
duke
parents:
diff changeset
    15
 * accompanied this code).
90ce3da70b43 Initial load
duke
parents:
diff changeset
    16
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    17
 * You should have received a copy of the GNU General Public License version
90ce3da70b43 Initial load
duke
parents:
diff changeset
    18
 * 2 along with this work; if not, write to the Free Software Foundation,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    19
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    20
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    21
 * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    22
 * CA 95054 USA or visit www.sun.com if you need additional information or
90ce3da70b43 Initial load
duke
parents:
diff changeset
    23
 * have any questions.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    24
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    25
90ce3da70b43 Initial load
duke
parents:
diff changeset
    26
package com.sun.java.util.jar.pack;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    27
90ce3da70b43 Initial load
duke
parents:
diff changeset
    28
import java.util.ListResourceBundle;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    29
90ce3da70b43 Initial load
duke
parents:
diff changeset
    30
public class DriverResource extends ListResourceBundle {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    31
        public static final String VERSION ="VERSION";
90ce3da70b43 Initial load
duke
parents:
diff changeset
    32
        public static final String BAD_ARGUMENT ="BAD_ARGUMENT";
90ce3da70b43 Initial load
duke
parents:
diff changeset
    33
        public static final String BAD_OPTION ="BAD_OPTION";
90ce3da70b43 Initial load
duke
parents:
diff changeset
    34
        public static final String BAD_REPACK_OUTPUT="BAD_REPACK_OUTPUT";
90ce3da70b43 Initial load
duke
parents:
diff changeset
    35
        public static final String DETECTED_ZIP_COMMENT="DETECTED_ZIP_COMMENT";
90ce3da70b43 Initial load
duke
parents:
diff changeset
    36
        public static final String SKIP_FOR_REPACKED ="SKIP_FOR_REPACKED";
90ce3da70b43 Initial load
duke
parents:
diff changeset
    37
        public static final String WRITE_PACK_FILE ="WRITE_PACK_FILE";
90ce3da70b43 Initial load
duke
parents:
diff changeset
    38
        public static final String WIRTE_PACKGZ_FILE="WIRTE_PACKGZ_FILE";
90ce3da70b43 Initial load
duke
parents:
diff changeset
    39
        public static final String SKIP_FOR_MOVE_FAILED="SKIP_FOR_MOVE_FAILED";
90ce3da70b43 Initial load
duke
parents:
diff changeset
    40
        public static final String PACK_HELP="PACK_HELP";
90ce3da70b43 Initial load
duke
parents:
diff changeset
    41
        public static final String UNPACK_HELP ="UNPACK_HELP";
90ce3da70b43 Initial load
duke
parents:
diff changeset
    42
        public static final String MORE_INFO = "MORE_INFO";
90ce3da70b43 Initial load
duke
parents:
diff changeset
    43
        public static final String DUPLICATE_OPTION = "DUPLICATE_OPTION";
90ce3da70b43 Initial load
duke
parents:
diff changeset
    44
        public static final String BAD_SPEC = "BAD_SPEC";
90ce3da70b43 Initial load
duke
parents:
diff changeset
    45
90ce3da70b43 Initial load
duke
parents:
diff changeset
    46
        //The following string is duplicate in PACK and UNPACK comment,which was draw out to ruduce translation work.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    47
        private static final String PARAMETER_V = "  -v, --verbose                   increase program verbosity";
90ce3da70b43 Initial load
duke
parents:
diff changeset
    48
        private static final String PARAMETER_Q = "  -q, --quiet                     set verbosity to lowest level";
90ce3da70b43 Initial load
duke
parents:
diff changeset
    49
        private static final String PARAMETER_LF = "  -l{F}, --log-file={F}           output to the given log file, or '-' for System.out";
90ce3da70b43 Initial load
duke
parents:
diff changeset
    50
        private static final String PARAMETER_H = "  -?, -h, --help                  print this message";
90ce3da70b43 Initial load
duke
parents:
diff changeset
    51
        private static final String PARAMETER_VER = "  -V, --version                   print program version";
90ce3da70b43 Initial load
duke
parents:
diff changeset
    52
        private static final String PARAMETER_J = "  -J{X}                           pass option X to underlying Java VM";
90ce3da70b43 Initial load
duke
parents:
diff changeset
    53
90ce3da70b43 Initial load
duke
parents:
diff changeset
    54
90ce3da70b43 Initial load
duke
parents:
diff changeset
    55
        //The following are outputs of command 'pack200' and 'unpack200'.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    56
        //Don't translate command arguments ,words with a prefix of '-' or '--'.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    57
        //
90ce3da70b43 Initial load
duke
parents:
diff changeset
    58
        private static final Object[][] resource= {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    59
                {VERSION,"{0} version {1}"},//parameter 0:class name;parameter 1: version value
90ce3da70b43 Initial load
duke
parents:
diff changeset
    60
                {BAD_ARGUMENT,"Bad argument: {0}"},
90ce3da70b43 Initial load
duke
parents:
diff changeset
    61
                {BAD_OPTION,"Bad option: {0}={1}"},//parameter 0:option name;parameter 1:option value
90ce3da70b43 Initial load
duke
parents:
diff changeset
    62
                {BAD_REPACK_OUTPUT,"Bad --repack output: {0}"},//parameter 0:filename
90ce3da70b43 Initial load
duke
parents:
diff changeset
    63
                {DETECTED_ZIP_COMMENT,"Detected ZIP comment: {0}"},//parameter 0:comment
90ce3da70b43 Initial load
duke
parents:
diff changeset
    64
                {SKIP_FOR_REPACKED,"Skipping because already repacked: {0}"},//parameter 0:filename
90ce3da70b43 Initial load
duke
parents:
diff changeset
    65
                {WRITE_PACK_FILE,"To write a *.pack file, specify --no-gzip: {0}"},//parameter 0:filename
90ce3da70b43 Initial load
duke
parents:
diff changeset
    66
                {WIRTE_PACKGZ_FILE,"To write a *.pack.gz file, specify --gzip: {0}"},//parameter 0:filename
90ce3da70b43 Initial load
duke
parents:
diff changeset
    67
                {SKIP_FOR_MOVE_FAILED,"Skipping unpack because move failed: {0}"},//parameter 0:filename
90ce3da70b43 Initial load
duke
parents:
diff changeset
    68
                {PACK_HELP,new String[]{
90ce3da70b43 Initial load
duke
parents:
diff changeset
    69
                                "Usage:  pack200 [-opt... | --option=value]... x.pack[.gz] y.jar",
90ce3da70b43 Initial load
duke
parents:
diff changeset
    70
                                "",
90ce3da70b43 Initial load
duke
parents:
diff changeset
    71
                                "Packing Options",
90ce3da70b43 Initial load
duke
parents:
diff changeset
    72
                                "  -g, --no-gzip                   output a plain *.pack file with no zipping",
90ce3da70b43 Initial load
duke
parents:
diff changeset
    73
                                "  --gzip                          (default) post-process the pack output with gzip",
90ce3da70b43 Initial load
duke
parents:
diff changeset
    74
                                "  -G, --strip-debug               remove debugging attributes while packing",
90ce3da70b43 Initial load
duke
parents:
diff changeset
    75
                                "  -O, --no-keep-file-order        do not transmit file ordering information",
90ce3da70b43 Initial load
duke
parents:
diff changeset
    76
                                "  --keep-file-order               (default) preserve input file ordering",
90ce3da70b43 Initial load
duke
parents:
diff changeset
    77
                                "  -S{N}, --segment-limit={N}      output segment limit (default N=1Mb)",
90ce3da70b43 Initial load
duke
parents:
diff changeset
    78
                                "  -E{N}, --effort={N}             packing effort (default N=5)",
90ce3da70b43 Initial load
duke
parents:
diff changeset
    79
                                "  -H{h}, --deflate-hint={h}       transmit deflate hint: true, false, or keep (default)",
90ce3da70b43 Initial load
duke
parents:
diff changeset
    80
                                "  -m{V}, --modification-time={V}  transmit modtimes: latest or keep (default)",
90ce3da70b43 Initial load
duke
parents:
diff changeset
    81
                                "  -P{F}, --pass-file={F}          transmit the given input element(s) uncompressed",
90ce3da70b43 Initial load
duke
parents:
diff changeset
    82
                                "  -U{a}, --unknown-attribute={a}  unknown attribute action: error, strip, or pass (default)",
90ce3da70b43 Initial load
duke
parents:
diff changeset
    83
                                "  -C{N}={L}, --class-attribute={N}={L}  (user-defined attribute)",
90ce3da70b43 Initial load
duke
parents:
diff changeset
    84
                                "  -F{N}={L}, --field-attribute={N}={L}  (user-defined attribute)",
90ce3da70b43 Initial load
duke
parents:
diff changeset
    85
                                "  -M{N}={L}, --method-attribute={N}={L} (user-defined attribute)",
90ce3da70b43 Initial load
duke
parents:
diff changeset
    86
                                "  -D{N}={L}, --code-attribute={N}={L}   (user-defined attribute)",
90ce3da70b43 Initial load
duke
parents:
diff changeset
    87
                                "  -f{F}, --config-file={F}        read file F for Pack200.Packer properties",
90ce3da70b43 Initial load
duke
parents:
diff changeset
    88
                                PARAMETER_V ,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    89
                                PARAMETER_Q ,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    90
                                PARAMETER_LF ,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    91
                                PARAMETER_H ,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    92
                                PARAMETER_VER ,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    93
                                PARAMETER_J,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    94
                                "",
90ce3da70b43 Initial load
duke
parents:
diff changeset
    95
                                "Notes:",
90ce3da70b43 Initial load
duke
parents:
diff changeset
    96
                                "  The -P, -C, -F, -M, and -D options accumulate.",
90ce3da70b43 Initial load
duke
parents:
diff changeset
    97
                                "  Example attribute definition:  -C SourceFile=RUH .",
90ce3da70b43 Initial load
duke
parents:
diff changeset
    98
                                "  Config. file properties are defined by the Pack200 API.",
90ce3da70b43 Initial load
duke
parents:
diff changeset
    99
                                "  For meaning of -S, -E, -H-, -m, -U values, see Pack200 API.",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   100
                                "  Layout definitions (like RUH) are defined by JSR 200.",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   101
                                "",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   102
                                "Repacking mode updates the JAR file with a pack/unpack cycle:",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   103
                                "    pack200 [-r|--repack] [-opt | --option=value]... [repackedy.jar] y.jar\n"
90ce3da70b43 Initial load
duke
parents:
diff changeset
   104
                                }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   105
                },
90ce3da70b43 Initial load
duke
parents:
diff changeset
   106
                {UNPACK_HELP,new String[]{
90ce3da70b43 Initial load
duke
parents:
diff changeset
   107
                                "Usage:  unpack200 [-opt... | --option=value]... x.pack[.gz] y.jar\n",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   108
                                "",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   109
                                "Unpacking Options",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   110
                                "  -H{h}, --deflate-hint={h}     override transmitted deflate hint: true, false, or keep (default)",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   111
                                "  -r, --remove-pack-file        remove input file after unpacking",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   112
                                PARAMETER_V ,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   113
                                PARAMETER_Q ,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   114
                                PARAMETER_LF ,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   115
                                PARAMETER_H ,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   116
                                PARAMETER_VER ,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   117
                                PARAMETER_J,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   118
                            }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   119
                },
90ce3da70b43 Initial load
duke
parents:
diff changeset
   120
90ce3da70b43 Initial load
duke
parents:
diff changeset
   121
                {MORE_INFO,"(For more information, run {0} --help .)"},//parameter 0:command name
90ce3da70b43 Initial load
duke
parents:
diff changeset
   122
                {DUPLICATE_OPTION,"duplicate option: {0}"},//parameter 0:option
90ce3da70b43 Initial load
duke
parents:
diff changeset
   123
                {BAD_SPEC,"bad spec for {0}: {1}"},//parameter 0:option;parameter 1:specifier
90ce3da70b43 Initial load
duke
parents:
diff changeset
   124
        };
90ce3da70b43 Initial load
duke
parents:
diff changeset
   125
90ce3da70b43 Initial load
duke
parents:
diff changeset
   126
        protected Object[][] getContents() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   127
                return resource;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   128
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   129
90ce3da70b43 Initial load
duke
parents:
diff changeset
   130
90ce3da70b43 Initial load
duke
parents:
diff changeset
   131
}