sdeboy 2004/07/26 23:48:52
Modified: src/java/org/apache/log4j/chainsaw/version
VersionManager.java
src/java/org/apache/log4j/chainsaw LogPanel.java
src/java/org/apache/log4j/chainsaw/prefs
SettingsManager.java
src/java/org/apache/log4j/chainsaw/help release-notes.html
Log:
Tab settings file names are now URL encoded. In order to preserve the usefulness of
existing settings files, if the URL-encoded files don't exist, Chainsaw will attempt
to load the tab's non-URL-encoded files.
Revision Changes Path
1.9 +1 -1
logging-log4j/src/java/org/apache/log4j/chainsaw/version/VersionManager.java
Index: VersionManager.java
===================================================================
RCS file:
/home/cvs/logging-log4j/src/java/org/apache/log4j/chainsaw/version/VersionManager.java,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- VersionManager.java 20 Jul 2004 22:22:27 -0000 1.8
+++ VersionManager.java 27 Jul 2004 06:48:51 -0000 1.9
@@ -10,7 +10,7 @@
private static final VersionManager instance = new VersionManager();
- private static final String VERSION_INFO = "1.99.99 (21 June 2004 19:00
GMT+10)";
+ private static final String VERSION_INFO = "1.99.99 (26 July 2004)";
public static final VersionManager getInstance() {
return instance;
1.84 +29 -26 logging-log4j/src/java/org/apache/log4j/chainsaw/LogPanel.java
Index: LogPanel.java
===================================================================
RCS file: /home/cvs/logging-log4j/src/java/org/apache/log4j/chainsaw/LogPanel.java,v
retrieving revision 1.83
retrieving revision 1.84
diff -u -r1.83 -r1.84
--- LogPanel.java 24 Jul 2004 07:20:34 -0000 1.83
+++ LogPanel.java 27 Jul 2004 06:48:51 -0000 1.84
@@ -50,6 +50,7 @@
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.io.Serializable;
+import java.net.URLEncoder;
import java.text.DateFormat;
import java.text.NumberFormat;
import java.text.SimpleDateFormat;
@@ -1404,24 +1405,36 @@
logTreePanel.ignore(event.getSettingsStartingWith("Logger.Ignore."));
+ //first attempt to load encoded file
File f =
new File(
- SettingsManager.getInstance().getSettingsDirectory() + File.separator
- + identifier + COLUMNS_EXTENSION);
+ SettingsManager.getInstance().getSettingsDirectory(),
URLEncoder.encode(identifier) + COLUMNS_EXTENSION);
+
+ if (!f.exists()) {
+ f =
+ new File(
+ SettingsManager.getInstance().getSettingsDirectory(), identifier +
COLUMNS_EXTENSION);
+ }
if (f.exists()) {
- loadColumnSettings();
+ loadColumnSettings(f);
} else {
loadDefaultColumnSettings(event);
}
+ //first attempt to load encoded file
File f2 =
new File(
- SettingsManager.getInstance().getSettingsDirectory() + File.separator
- + identifier + COLORS_EXTENSION);
+ SettingsManager.getInstance().getSettingsDirectory(),
URLEncoder.encode(identifier) + COLORS_EXTENSION);
+
+ if (!f2.exists()) {
+ f2 =
+ new File(
+ SettingsManager.getInstance().getSettingsDirectory(), identifier +
COLORS_EXTENSION);
+ }
if (f2.exists()) {
- loadColorSettings();
+ loadColorSettings(f2);
}
}
@@ -2050,10 +2063,10 @@
ObjectOutputStream o = null;
try {
- File f =
- new File(
- SettingsManager.getInstance().getSettingsDirectory()
- + File.separator + getIdentifier() + COLUMNS_EXTENSION);
+ File f = new File(SettingsManager.getInstance().getSettingsDirectory(),
+ URLEncoder.encode(getIdentifier() + COLUMNS_EXTENSION));
+ LogLog.debug("writing columns to file: " + f);
+
o = new ObjectOutputStream(
new BufferedOutputStream(new FileOutputStream(f)));
@@ -2096,10 +2109,10 @@
ObjectOutputStream o = null;
try {
- File f =
- new File(
- SettingsManager.getInstance().getSettingsDirectory()
- + File.separator + getIdentifier() + COLORS_EXTENSION);
+ File f = new File(SettingsManager.getInstance().getSettingsDirectory(),
+ URLEncoder.encode(getIdentifier() + COLORS_EXTENSION));
+ LogLog.debug("writing colors to file: " + f);
+
o = new ObjectOutputStream(
new BufferedOutputStream(new FileOutputStream(f)));
@@ -2123,12 +2136,7 @@
/**
* Load panel column settings
*/
- private void loadColumnSettings() {
- File f =
- new File(
- SettingsManager.getInstance().getSettingsDirectory() + File.separator
- + identifier + COLUMNS_EXTENSION);
-
+ private void loadColumnSettings(File f) {
if (f.exists()) {
ArrayList newColumns = new ArrayList();
@@ -2259,12 +2267,7 @@
/**
* Load panel color settings
*/
- private void loadColorSettings() {
- File f =
- new File(
- SettingsManager.getInstance().getSettingsDirectory() + File.separator
- + identifier + COLORS_EXTENSION);
-
+ private void loadColorSettings(File f) {
if (f.exists()) {
ObjectInputStream s = null;
1.6 +8 -3
logging-log4j/src/java/org/apache/log4j/chainsaw/prefs/SettingsManager.java
Index: SettingsManager.java
===================================================================
RCS file:
/home/cvs/logging-log4j/src/java/org/apache/log4j/chainsaw/prefs/SettingsManager.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- SettingsManager.java 27 Feb 2004 16:47:31 -0000 1.5
+++ SettingsManager.java 27 Jul 2004 06:48:51 -0000 1.6
@@ -23,7 +23,7 @@
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
-
+import java.net.URLEncoder;
import java.util.EventListener;
import java.util.Properties;
@@ -152,7 +152,12 @@
InputStream is = null;
File f = new File(getSettingsDirectory(),
- p.getNamespace() + ".properties");
+ URLEncoder.encode(p.getNamespace() + ".properties"));
+
+ if (!f.exists()) {
+ f = new File(getSettingsDirectory(),
+ p.getNamespace() + ".properties");
+ }
if (f.exists()) {
try {
@@ -239,7 +244,7 @@
try {
os = new BufferedOutputStream(new FileOutputStream(
new File(settingsDir,
- profileable.getNamespace() + ".properties")));
+
URLEncoder.encode(profileable.getNamespace()) + ".properties")));
event.getProperties().store(os, HEADER);
} catch (Exception e) {
e.printStackTrace();
1.35 +4 -0
logging-log4j/src/java/org/apache/log4j/chainsaw/help/release-notes.html
Index: release-notes.html
===================================================================
RCS file:
/home/cvs/logging-log4j/src/java/org/apache/log4j/chainsaw/help/release-notes.html,v
retrieving revision 1.34
retrieving revision 1.35
diff -u -r1.34 -r1.35
--- release-notes.html 26 Jul 2004 07:39:32 -0000 1.34
+++ release-notes.html 27 Jul 2004 06:48:52 -0000 1.35
@@ -8,6 +8,10 @@
<h1>Release Notes</h2>
<h1>1.99.99</h2>
+<h2>26 July 2004</h2>
+<ul>
+<li>Tab settings file names are now URL encoded. In order to preserve the
usefulness of existing settings files, if the URL-encoded files don't exist, Chainsaw
will attempt to load the tab's non-URL-encoded files.</li>
+</ul>
<h2>25 July 2004</h2>
<ul>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]