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