aboutsummaryrefslogtreecommitdiffstats
path: root/src/org/apache/fop/viewer/LoadableProperties.java
diff options
context:
space:
mode:
authorKeiron Liddle <keiron@apache.org>2002-11-06 14:30:16 +0000
committerKeiron Liddle <keiron@apache.org>2002-11-06 14:30:16 +0000
commitf33f5714492bf951c227cbd278dc2fe28ea59b83 (patch)
tree363795fb88884c3214a911f61c6e6dc292332085 /src/org/apache/fop/viewer/LoadableProperties.java
parent30ff9bc7407bd62a7d2be0e1529991f1ed940720 (diff)
downloadxmlgraphics-fop-f33f5714492bf951c227cbd278dc2fe28ea59b83.tar.gz
xmlgraphics-fop-f33f5714492bf951c227cbd278dc2fe28ea59b83.zip
awt viewer improvements
uses java PropertyResourceBundle for locale strings cleaned up code and removed old classes other small improvements Submitted by: Oleg Tkachenko <olegt@multiconn.com> git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@195433 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/org/apache/fop/viewer/LoadableProperties.java')
-rw-r--r--src/org/apache/fop/viewer/LoadableProperties.java86
1 files changed, 0 insertions, 86 deletions
diff --git a/src/org/apache/fop/viewer/LoadableProperties.java b/src/org/apache/fop/viewer/LoadableProperties.java
deleted file mode 100644
index 92be4ed9e..000000000
--- a/src/org/apache/fop/viewer/LoadableProperties.java
+++ /dev/null
@@ -1,86 +0,0 @@
-/*
- * $Id$
- * Copyright (C) 2001 The Apache Software Foundation. All rights reserved.
- * For details on use and redistribution please refer to the
- * LICENSE file included with these sources.
- */
-
-package org.apache.fop.viewer;
-
-import java.io.*;
-import java.util.*;
-
-/**
- * Erweitert Hashtable um die Methode load.
- * Die Zeilen der Textdatei, die mit # oder ! anfangen sind Kommentarzeilen.
- * Eine gültige Zeile ist entweder eine Kommentarzeile oder eine Zeile mit dem
- * Gleichheitszeichen "in der Mitte".
- * Die Klasse LoadableProperties lässt im Gegensatz zu der Klasse Properties die
- * Schlüsselwerte mit Leerzeichen zu.
- *
- * @version 02.12.99
- * @author Stanislav.Gorkhover@jCatalog.com
- *
- */
-public class LoadableProperties extends Hashtable {
-
- public LoadableProperties() {
- super();
- }
-
-
- public void load(InputStream inStream) throws IOException {
-
- BufferedReader in = new BufferedReader(new InputStreamReader(inStream,
- "8859_1"));
-
- String aKey;
- String aValue;
- int index;
- String line = getNextLine(in);
- while (line != null) {
- line = line.trim();
- if (isValid(line)) {
- index = line.indexOf("=");
- aKey = line.substring(0, index);
- aValue = line.substring(index + 1);
- put(aKey, aValue);
- }
- line = getNextLine(in);
- }
- }
-
-
- private boolean isValid(String str) {
- if (str == null)
- return false;
- if (str.length() > 0) {
- if (str.startsWith("#") || str.startsWith("!")) {
- return false;
- }
- } else {
- return false;
- }
-
- int index = str.indexOf("=");
- if (index > 0 && str.length() > index) {
- return true;
- } else {
- //log.debug(getClass().getName()
- // + ": load(): invalid line " + str + "."
- // + " Character '=' missed.");
- return false;
- }
- }
-
- private String getNextLine(BufferedReader br) {
- try {
- return br.readLine();
- } catch (Exception e) {
- return null;
- }
-
- }
-
-
-}