Commit b1645b79 authored by Matt Tucker's avatar Matt Tucker Committed by matt

Code cleanup and tweaks.

git-svn-id: http://svn.igniterealtime.org/svn/repos/messenger/trunk@3186 b35dd754-fafc-0310-a699-88a17e54d16e
parent 7b583b08
......@@ -170,7 +170,7 @@ public class AuditorImpl implements Auditor {
}
}
writer = new OutputStreamWriter(new FileOutputStream(currentAuditFile), "UTF-8");
writer = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(currentAuditFile), "UTF-8"));
writer.write("<jive xmlns=\"http://www.jivesoftware.org\">");
xmlWriter = new org.jivesoftware.util.XMLWriter(writer);
}
......
......@@ -396,7 +396,7 @@ public class JiveGlobals {
*
* @param propertyMap a map of properties, keyed on property name.
*/
public static void setXMLProperties(Map propertyMap) {
public static void setXMLProperties(Map<String, String> propertyMap) {
if (xmlProperties == null) {
loadSetupProperties();
}
......
......@@ -117,7 +117,7 @@ public class XMLProperties {
* @return the value of the specified property.
*/
public synchronized String getProperty(String name) {
String value = (String)propertyCache.get(name);
String value = propertyCache.get(name);
if (value != null) {
return value;
}
......@@ -182,7 +182,7 @@ public class XMLProperties {
}
// We found matching property, return names of children.
Iterator iter = element.elementIterator(propName[propName.length - 1]);
ArrayList props = new ArrayList();
List<String> props = new ArrayList<String>();
String value;
while (iter.hasNext()) {
// Empty strings are skipped.
......@@ -192,7 +192,7 @@ public class XMLProperties {
}
}
String[] childrenNames = new String[props.size()];
return (String[])props.toArray(childrenNames);
return props.toArray(childrenNames);
}
/**
......@@ -318,9 +318,9 @@ public class XMLProperties {
saveProperties();
// Generate event.
Map params = new HashMap();
Map<String, Object> params = new HashMap<String, Object>();
params.put("value", values);
PropertyEventDispatcher.dispatchEvent((String)name,
PropertyEventDispatcher.dispatchEvent(name,
PropertyEventDispatcher.EventType.xml_property_set, params);
}
......@@ -387,9 +387,9 @@ public class XMLProperties {
saveProperties();
// Generate event.
Map params = new HashMap();
Map<String, String> params = new HashMap<String,String>();
params.put("value", value);
PropertyEventDispatcher.dispatchEvent((String)name,
PropertyEventDispatcher.dispatchEvent(name,
PropertyEventDispatcher.EventType.xml_property_set, params);
}
......@@ -418,7 +418,7 @@ public class XMLProperties {
saveProperties();
// Generate event.
PropertyEventDispatcher.dispatchEvent((String)name,
PropertyEventDispatcher.dispatchEvent(name,
PropertyEventDispatcher.EventType.xml_property_deleted, Collections.emptyMap());
}
......@@ -452,8 +452,9 @@ public class XMLProperties {
Writer writer = null;
try {
tempFile = new File(file.getParentFile(), file.getName() + ".tmp");
writer = new FileWriter(tempFile);
writer = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(tempFile), "UTF-8"));
OutputFormat prettyPrinter = OutputFormat.createPrettyPrint();
prettyPrinter.setEncoding("UTF-8");
XMLWriter xmlWriter = new XMLWriter(writer, prettyPrinter);
xmlWriter.write(document);
}
......@@ -506,20 +507,18 @@ public class XMLProperties {
* @return an array representation of the given Jive property.
*/
private String[] parsePropertyName(String name) {
List propName = new ArrayList(5);
List<String> propName = new ArrayList<String>(5);
// Use a StringTokenizer to tokenize the property name.
StringTokenizer tokenizer = new StringTokenizer(name, ".");
while (tokenizer.hasMoreTokens()) {
propName.add(tokenizer.nextToken());
}
return (String[])propName.toArray(new String[propName.size()]);
return propName.toArray(new String[propName.size()]);
}
public void setProperties(Map propertyMap) {
Iterator iter = propertyMap.keySet().iterator();
while (iter.hasNext()) {
String propertyName = (String) iter.next();
String propertyValue = (String) propertyMap.get(propertyName);
public void setProperties(Map<String, String> propertyMap) {
for (String propertyName : propertyMap.keySet()) {
String propertyValue = propertyMap.get(propertyName);
setProperty(propertyName, propertyValue);
}
}
......
......@@ -212,7 +212,7 @@
<fmt:message key="audit.policy.log_directory" />
</td>
<td width="99%">
<input type="text" size="30" maxlength="150" name="logDir"
<input type="text" size="50" maxlength="150" name="logDir"
value="<%= ((logDir != null) ? logDir : "") %>">
<% if (errors.get("logDir") != null) { %>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment