summaryrefslogtreecommitdiff
path: root/javainstaller2/src/JavaSetup/org/openoffice/setup/SetupData/ProductDescription.java
diff options
context:
space:
mode:
Diffstat (limited to 'javainstaller2/src/JavaSetup/org/openoffice/setup/SetupData/ProductDescription.java')
-rwxr-xr-xjavainstaller2/src/JavaSetup/org/openoffice/setup/SetupData/ProductDescription.java54
1 files changed, 27 insertions, 27 deletions
diff --git a/javainstaller2/src/JavaSetup/org/openoffice/setup/SetupData/ProductDescription.java b/javainstaller2/src/JavaSetup/org/openoffice/setup/SetupData/ProductDescription.java
index e5933a996834..f2bdc6161964 100755
--- a/javainstaller2/src/JavaSetup/org/openoffice/setup/SetupData/ProductDescription.java
+++ b/javainstaller2/src/JavaSetup/org/openoffice/setup/SetupData/ProductDescription.java
@@ -1,7 +1,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -40,31 +40,31 @@ import java.util.regex.Pattern;
* @author Christof Pintaske
*/
public class ProductDescription {
-
+
private class Pair {
public Pattern search;
public String replacement;
-
+
public Pair(Pattern key, String value) {
search = key;
replacement = value;
}
}
-
+
private Vector macro; /* macro list with precompiled regex patterns */
private HashMap map; /* conventional key-value pairs */
private String backslashText = "THIS_IS_A_BACKSLASH";
-
- /**
+
+ /**
* read properties from package description data
*/
-
+
protected ProductDescription(XMLPackageDescription descriptionData) {
macro = new Vector();
map = new HashMap();
parse(descriptionData);
}
-
+
/**
* retrieve information about general installation properties
*/
@@ -104,21 +104,21 @@ public class ProductDescription {
System.out.println("Key: " + pair.search.pattern() + " Value: " + pair.replacement );
}
}
-
+
public String get(String key) {
return (String) map.get(key);
}
private boolean doMaskBackslash(String[] arr) {
boolean changed = false;
-
+
int index = arr[0].indexOf('\\');
if ( index >= 0 ) {
arr[0] = arr[0].replaceAll("\\", backslashText);
// arr[0] = arr[0].replace("\\", backslashText);
changed = true;
}
-
+
return changed;
}
@@ -129,9 +129,9 @@ public class ProductDescription {
}
public String replaceMacros(String s) {
-
+
String result = s;
-
+
for (int i = 0; i < macro.size(); i++) {
Pair pair = (Pair) macro.get(i);
Pattern pattern = pair.search;
@@ -152,13 +152,13 @@ public class ProductDescription {
return result;
}
-
+
/**
* parse the wrapped package description
*/
-
+
private void parse(XMLPackageDescription data) {
-
+
XMLPackageDescription section;
/* product description is a leaf at the root */
@@ -167,7 +167,7 @@ public class ProductDescription {
if (section != null) {
parse(section);
}
- } else {
+ } else {
InstallData installData = InstallData.getInstance();
/* check for a default installation directory */
@@ -176,8 +176,8 @@ public class ProductDescription {
String value = section.getValue();
if (value != null) {
installData.setDefaultDir(value);
- // installData.setInstallDir(value);
- }
+ // installData.setInstallDir(value);
+ }
}
/* check for a default product directory */
@@ -186,7 +186,7 @@ public class ProductDescription {
String value = section.getValue();
if (value != null) {
installData.setProductDir(value);
- }
+ }
}
/* check for the package format of this installation set */
@@ -195,7 +195,7 @@ public class ProductDescription {
String value = section.getValue();
if (value != null) {
installData.setPackageFormat(value);
- }
+ }
}
/* check for the package directory of this installation set */
@@ -204,7 +204,7 @@ public class ProductDescription {
String value = section.getValue();
if ((value != null) && (! value.equals(""))) {
installData.setPackageSubdir(value);
- }
+ }
}
/* check for the architecture of this installation set */
@@ -213,7 +213,7 @@ public class ProductDescription {
String value = section.getValue();
if ((value != null) && (! value.equals(""))) {
installData.setArchitecture(value);
- }
+ }
}
section = data.getElement("multilingual");
@@ -222,7 +222,7 @@ public class ProductDescription {
if ((value != null) && (! value.equals(""))) {
boolean multilingualValue = Parser.parseBoolean(value);
installData.setIsMultiLingual(multilingualValue);
- }
+ }
}
/* check for the update behaviour of this installation set */
@@ -243,7 +243,7 @@ public class ProductDescription {
if (value != null) {
int intValue = Integer.parseInt(value);
installData.setProductMinor(intValue);
- }
+ }
}
section = data.getElement("hideeula");
@@ -252,7 +252,7 @@ public class ProductDescription {
if ((value != null) && (! value.equals(""))) {
boolean hideeulaValue = Parser.parseBoolean(value);
installData.setHideEula(hideeulaValue);
- }
+ }
}
/* check for any macro definitions */
@@ -261,7 +261,7 @@ public class ProductDescription {
if (p.getKey().equals("macro")) {
String key = p.getAttribute("key");
String value = p.getValue();
-
+
if ((key != null) && (value != null)) {
String match = "\\$\\{" + key + "\\}";
Pattern pattern = Pattern.compile(match, Pattern.CASE_INSENSITIVE);