mirror of
https://github.com/igniterealtime/Spark.git
synced 2025-10-29 11:47:01 +00:00
Compare commits
4 Commits
629353c6e2
...
834a6fe8a7
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
834a6fe8a7 | ||
|
|
9c888f4fef | ||
|
|
5349f7b519 | ||
|
|
0d4987dc9b |
@ -40,7 +40,9 @@ public class ConfigurationRes {
|
||||
try
|
||||
{
|
||||
InputStream resourceAsStream = cl.getResourceAsStream( "configuration.properties" );
|
||||
prb.load( resourceAsStream );
|
||||
if (resourceAsStream != null) {
|
||||
prb.load( resourceAsStream );
|
||||
}
|
||||
}
|
||||
catch ( IOException e )
|
||||
{
|
||||
|
||||
@ -155,7 +155,9 @@ public class Default {
|
||||
try
|
||||
{
|
||||
InputStream resourceAsStream = cl.getResourceAsStream( "default.properties" );
|
||||
prb.load( resourceAsStream );
|
||||
if (resourceAsStream != null) {
|
||||
prb.load( resourceAsStream );
|
||||
}
|
||||
}
|
||||
catch ( IOException e )
|
||||
{
|
||||
@ -181,7 +183,8 @@ public class Default {
|
||||
}
|
||||
|
||||
public static boolean getBoolean(String propertyName) {
|
||||
return getString(propertyName).replace(" ","").equals("true");
|
||||
String prop = getString(propertyName);
|
||||
return prop != null && Boolean.parseBoolean(prop.trim());
|
||||
}
|
||||
|
||||
public static ImageIcon getImageIcon(String imageName) {
|
||||
|
||||
@ -37,7 +37,9 @@ public class SoundsRes {
|
||||
try
|
||||
{
|
||||
InputStream resourceAsStream = cl.getResourceAsStream( "sounds.properties" );
|
||||
prb.load( resourceAsStream );
|
||||
if (resourceAsStream != null) {
|
||||
prb.load( resourceAsStream );
|
||||
}
|
||||
}
|
||||
catch ( IOException e )
|
||||
{
|
||||
|
||||
@ -338,7 +338,9 @@ public class SparkRes {
|
||||
prb = new Properties();
|
||||
try {
|
||||
InputStream resourceAsStream = cl.getResourceAsStream("spark.properties");
|
||||
prb.load(resourceAsStream);
|
||||
if (resourceAsStream != null) {
|
||||
prb.load(resourceAsStream);
|
||||
}
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
@ -377,7 +379,7 @@ public class SparkRes {
|
||||
while (enumeration.hasMoreElements()) {
|
||||
String token = enumeration.nextElement();
|
||||
String value = prb.getProperty(token).toLowerCase();
|
||||
if (value.endsWith(".gif") || value.endsWith(".png") || value.endsWith(".jpg") || value.endsWith("jpeg")) {
|
||||
if (value.endsWith(".gif") || value.endsWith(".png") || value.endsWith(".jpg") || value.endsWith(".jpeg")) {
|
||||
SparkRes.getImageIcon(token);
|
||||
}
|
||||
String str = "public static final String " + token + " = \"" + token + "\";\n";
|
||||
|
||||
@ -51,7 +51,7 @@ final public class FormUtils {
|
||||
* otherwise.
|
||||
*/
|
||||
public static boolean isTrue(String str) {
|
||||
return (str != null && str.equalsIgnoreCase("true"));
|
||||
return Boolean.parseBoolean(str);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -19,18 +19,9 @@ package net.java.sipmack.common;
|
||||
/**
|
||||
* Creates and writes out messages.
|
||||
*/
|
||||
|
||||
public class Log {
|
||||
|
||||
private static boolean debugger = false;
|
||||
|
||||
static {
|
||||
|
||||
if (System.getProperty("debugger") != null
|
||||
&& System.getProperty("debugger").equals("true"))
|
||||
debugger = true;
|
||||
|
||||
}
|
||||
private static boolean debugger = Boolean.parseBoolean(System.getProperty("debugger"));
|
||||
|
||||
public static void debug(String message) {
|
||||
if (debugger)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user