01: package org.libtiff.jai.util;
02:
03: /*
04: * XTIFF: eXtensible TIFF libraries for JAI.
05: *
06: * The contents of this file are subject to the JAVA ADVANCED IMAGING
07: * SAMPLE INPUT-OUTPUT CODECS AND WIDGET HANDLING SOURCE CODE License
08: * Version 1.0 (the "License"); You may not use this file except in
09: * compliance with the License. You may obtain a copy of the License at
10: * http://www.sun.com/software/imaging/JAI/index.html
11: *
12: * Software distributed under the License is distributed on an "AS IS"
13: * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
14: * the License for the specific language governing rights and limitations
15: * under the License.
16: *
17: * The Original Code is JAVA ADVANCED IMAGING SAMPLE INPUT-OUTPUT CODECS
18: * AND WIDGET HANDLING SOURCE CODE.
19: * The Initial Developer of the Original Code is: Sun Microsystems, Inc..
20: * Portions created by: Niles Ritter
21: * are Copyright (C): Niles Ritter, GeoTIFF.org, 1999,2000.
22: * All Rights Reserved.
23: * Contributor(s): Niles Ritter
24: */
25:
26: import java.io.FileInputStream;
27: import java.io.InputStream;
28: import java.util.PropertyResourceBundle;
29: import java.util.ResourceBundle;
30: import java.util.Locale;
31:
32: public class PropertyUtil {
33:
34: private static ResourceBundle b;
35:
36: /** Get bundle from .properties files in the package path*/
37: private static ResourceBundle getBundle() {
38: ResourceBundle bundle = null;
39:
40: try {
41: bundle = ResourceBundle.getBundle("xtiff", Locale.US);
42: return bundle;
43: } catch (Exception e) {
44: e.printStackTrace();
45: }
46:
47: return null;
48: }
49:
50: public static String getString(String key) {
51: if (b == null) {
52: b = getBundle();
53: }
54: return b.getString(key);
55: }
56: }
|