src/java.base/share/classes/com/sun/java/util/jar/pack/PropMap.java

Print this page


   1 /*
   2  * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.  Oracle designates this
   8  * particular file as subject to the "Classpath" exception as provided
   9  * by Oracle in the LICENSE file that accompanied this code.
  10  *
  11  * This code is distributed in the hope that it will be useful, but WITHOUT
  12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  13  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  14  * version 2 for more details (a copy is included in the LICENSE file that
  15  * accompanied this code).
  16  *
  17  * You should have received a copy of the GNU General Public License version
  18  * 2 along with this work; if not, write to the Free Software Foundation,
  19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20  *
  21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22  * or visit www.oracle.com if you need additional information or have any


  52     public String put(String key, String value) {
  53         String oldValue = theMap.put(key, value);
  54         return oldValue;
  55     }
  56 
  57     // All this other stuff is private to the current package.
  58     // Outide clients of Pack200 do not need to use it; they can
  59     // get by with generic SortedMap functionality.
  60     private static Map<String, String> defaultProps;
  61     static {
  62         Properties props = new Properties();
  63 
  64         // Allow implementation selected via -Dpack.disable.native=true
  65         props.put(Utils.DEBUG_DISABLE_NATIVE,
  66                   String.valueOf(Boolean.getBoolean(Utils.DEBUG_DISABLE_NATIVE)));
  67 
  68         // Set the DEBUG_VERBOSE from system
  69         props.put(Utils.DEBUG_VERBOSE,
  70                   String.valueOf(Integer.getInteger(Utils.DEBUG_VERBOSE,0)));
  71 
  72         // Set the PACK_TIMEZONE_NO_UTC
  73         props.put(Utils.PACK_DEFAULT_TIMEZONE,
  74                   String.valueOf(Boolean.getBoolean(Utils.PACK_DEFAULT_TIMEZONE)));
  75 
  76         // The segment size is unlimited
  77         props.put(Pack200.Packer.SEGMENT_LIMIT, "-1");
  78 
  79         // Preserve file ordering by default.
  80         props.put(Pack200.Packer.KEEP_FILE_ORDER, Pack200.Packer.TRUE);
  81 
  82         // Preserve all modification times by default.
  83         props.put(Pack200.Packer.MODIFICATION_TIME, Pack200.Packer.KEEP);
  84 
  85         // Preserve deflation hints by default.
  86         props.put(Pack200.Packer.DEFLATE_HINT, Pack200.Packer.KEEP);
  87 
  88         // Pass through files with unrecognized attributes by default.
  89         props.put(Pack200.Packer.UNKNOWN_ATTRIBUTE, Pack200.Packer.PASS);
  90 
  91         // Pass through files with unrecognized format by default, also
  92         // allow system property to be set
  93         props.put(Utils.CLASS_FORMAT_ERROR,
  94                 System.getProperty(Utils.CLASS_FORMAT_ERROR, Pack200.Packer.PASS));
  95 


   1 /*
   2  * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.  Oracle designates this
   8  * particular file as subject to the "Classpath" exception as provided
   9  * by Oracle in the LICENSE file that accompanied this code.
  10  *
  11  * This code is distributed in the hope that it will be useful, but WITHOUT
  12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  13  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  14  * version 2 for more details (a copy is included in the LICENSE file that
  15  * accompanied this code).
  16  *
  17  * You should have received a copy of the GNU General Public License version
  18  * 2 along with this work; if not, write to the Free Software Foundation,
  19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20  *
  21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22  * or visit www.oracle.com if you need additional information or have any


  52     public String put(String key, String value) {
  53         String oldValue = theMap.put(key, value);
  54         return oldValue;
  55     }
  56 
  57     // All this other stuff is private to the current package.
  58     // Outide clients of Pack200 do not need to use it; they can
  59     // get by with generic SortedMap functionality.
  60     private static Map<String, String> defaultProps;
  61     static {
  62         Properties props = new Properties();
  63 
  64         // Allow implementation selected via -Dpack.disable.native=true
  65         props.put(Utils.DEBUG_DISABLE_NATIVE,
  66                   String.valueOf(Boolean.getBoolean(Utils.DEBUG_DISABLE_NATIVE)));
  67 
  68         // Set the DEBUG_VERBOSE from system
  69         props.put(Utils.DEBUG_VERBOSE,
  70                   String.valueOf(Integer.getInteger(Utils.DEBUG_VERBOSE,0)));
  71 




  72         // The segment size is unlimited
  73         props.put(Pack200.Packer.SEGMENT_LIMIT, "-1");
  74 
  75         // Preserve file ordering by default.
  76         props.put(Pack200.Packer.KEEP_FILE_ORDER, Pack200.Packer.TRUE);
  77 
  78         // Preserve all modification times by default.
  79         props.put(Pack200.Packer.MODIFICATION_TIME, Pack200.Packer.KEEP);
  80 
  81         // Preserve deflation hints by default.
  82         props.put(Pack200.Packer.DEFLATE_HINT, Pack200.Packer.KEEP);
  83 
  84         // Pass through files with unrecognized attributes by default.
  85         props.put(Pack200.Packer.UNKNOWN_ATTRIBUTE, Pack200.Packer.PASS);
  86 
  87         // Pass through files with unrecognized format by default, also
  88         // allow system property to be set
  89         props.put(Utils.CLASS_FORMAT_ERROR,
  90                 System.getProperty(Utils.CLASS_FORMAT_ERROR, Pack200.Packer.PASS));
  91