diff options
author | Lyubomir Marinov <lyubomir.marinov@jitsi.org> | 2009-10-08 09:44:35 +0000 |
---|---|---|
committer | Lyubomir Marinov <lyubomir.marinov@jitsi.org> | 2009-10-08 09:44:35 +0000 |
commit | 2f8b4304f21676487399641eccc8c18db2f5824c (patch) | |
tree | dc4525f6118780f7bc540b7c7c8f036b4db003f4 /src/net/java/sip/communicator/plugin/otr/OtrConfigurator.java | |
parent | ff808e4616797dab6bd0296fe19adcc70cbc753a (diff) | |
download | jitsi-2f8b4304f21676487399641eccc8c18db2f5824c.zip jitsi-2f8b4304f21676487399641eccc8c18db2f5824c.tar.gz jitsi-2f8b4304f21676487399641eccc8c18db2f5824c.tar.bz2 |
Renames the .plugin.otr.Configurator class which is stored in OtrConfigurator.java to OtrConfigurator because NetBeans chokes on it at times with compile-time resolution errors. Besides, the naming does not seem to follow our way of writing.
Also moves the fields of the modified classes at the top of the class definitions instead of having them spread all over because it also seems to be our way of writing.
Diffstat (limited to 'src/net/java/sip/communicator/plugin/otr/OtrConfigurator.java')
-rwxr-xr-x | src/net/java/sip/communicator/plugin/otr/OtrConfigurator.java | 27 |
1 files changed, 13 insertions, 14 deletions
diff --git a/src/net/java/sip/communicator/plugin/otr/OtrConfigurator.java b/src/net/java/sip/communicator/plugin/otr/OtrConfigurator.java index c9711fe..00f3a3e 100755 --- a/src/net/java/sip/communicator/plugin/otr/OtrConfigurator.java +++ b/src/net/java/sip/communicator/plugin/otr/OtrConfigurator.java @@ -17,7 +17,7 @@ import org.bouncycastle.util.encoders.*; *
* @author George Politis
*/
-class Configurator
+public class OtrConfigurator
{
/**
* Gets an XML tag friendly {@link String} from a {@link String}.
@@ -36,10 +36,12 @@ class Configurator s = "p" + s;
char[] cId = new char[s.length()];
+
for (int i = 0; i < cId.length; i++)
{
char c = s.charAt(i);
- cId[i] = (Character.isLetterOrDigit(c)) ? c : '_';
+
+ cId[i] = Character.isLetterOrDigit(c) ? c : '_';
}
return new String(cId);
@@ -54,8 +56,8 @@ class Configurator */
private String getID(String id)
{
- return "net.java.sip.communicator.plugin.otr."
- + getXmlFriendlyString(id);
+ return
+ "net.java.sip.communicator.plugin.otr." + getXmlFriendlyString(id);
}
/**
@@ -69,12 +71,9 @@ class Configurator */
public byte[] getPropertyBytes(String id)
{
- String value =
- (String) OtrActivator.configService.getProperty(this.getID(id));
- if (value == null)
- return null;
+ String value = OtrActivator.configService.getString(getID(id));
- return Base64.decode(value.getBytes());
+ return (value == null) ? null : Base64.decode(value.getBytes());
}
/**
@@ -89,8 +88,8 @@ class Configurator */
public boolean getPropertyBoolean(String id, boolean defaultValue)
{
- return OtrActivator.configService.getBoolean(this.getID(id),
- defaultValue);
+ return
+ OtrActivator.configService.getBoolean(getID(id), defaultValue);
}
/**
@@ -105,7 +104,7 @@ class Configurator {
String valueToStore = new String(Base64.encode(value));
- OtrActivator.configService.setProperty(this.getID(id), valueToStore);
+ OtrActivator.configService.setProperty(getID(id), valueToStore);
}
/**
@@ -117,7 +116,7 @@ class Configurator */
public void setProperty(String id, Object value)
{
- OtrActivator.configService.setProperty(this.getID(id), value);
+ OtrActivator.configService.setProperty(getID(id), value);
}
/**
@@ -128,7 +127,7 @@ class Configurator */
public void removeProperty(String id)
{
- OtrActivator.configService.removeProperty(this.getID(id));
+ OtrActivator.configService.removeProperty(getID(id));
}
/**
|