diff --git a/java/src/ch/ntb/usb/logger/LogUtil.java b/java/src/ch/ntb/usb/logger/LogUtil.java index 159f45d..b501cc2 100644 --- a/java/src/ch/ntb/usb/logger/LogUtil.java +++ b/java/src/ch/ntb/usb/logger/LogUtil.java @@ -1,9 +1,6 @@ package ch.ntb.usb.logger; -import java.io.FileInputStream; -import java.io.FileNotFoundException; -import java.net.URL; -import java.net.URLDecoder; +import java.io.InputStream; import java.util.Properties; import java.util.logging.ConsoleHandler; import java.util.logging.Handler; @@ -57,14 +54,11 @@ public class LogUtil { private static void createLoggersFromProperties() { try { - URL url = ClassLoader.getSystemResource(PROPERTIES_FILE); - if (url == null) - throw new FileNotFoundException(PROPERTIES_FILE - + " not found -> file must be on classpath"); - String filename = URLDecoder.decode(url.getPath(), "UTF-8"); - FileInputStream fis = new FileInputStream(filename); + InputStream is = LogUtil.class.getClassLoader() + .getResourceAsStream(PROPERTIES_FILE); + // FileInputStream fis = new FileInputStream(); Properties prop = new Properties(); - prop.load(fis); + prop.load(is); // get global debug enable flag debugEnabled = Boolean.parseBoolean(prop.getProperty(PLUGIN_ID + "/debug")); diff --git a/java/test/ch/ntb/usb/test/DeviceTest.java b/java/test/ch/ntb/usb/test/DeviceTest.java index dbf8ada..c202192 100644 --- a/java/test/ch/ntb/usb/test/DeviceTest.java +++ b/java/test/ch/ntb/usb/test/DeviceTest.java @@ -43,7 +43,7 @@ public class DeviceTest { String devInfoClazzName = devInfoProp.getProperty(deviceInfoKey); if (devInfoClazzName == null) { throw new IllegalArgumentException("property " + deviceInfoKey - + "not found in file " + testdevicePropertiesFile); + + " not found in file " + testdevicePropertiesFile); } Class devInfoClazz = Class.forName(devInfoClazzName); devinfo = (AbstractDeviceInfo) devInfoClazz.newInstance(); diff --git a/java/testdevice.properties b/java/testdevice.properties index 55b86fe..8ae9da0 100644 --- a/java/testdevice.properties +++ b/java/testdevice.properties @@ -4,6 +4,6 @@ ################################################################ # Atmel AVR AT90USB1287 -testdeviceInfo=ch.ntb.usb.AT90USB1287 +testdeviceInfo=ch.ntb.usb.test.AT90USB1287 # Cypress FX2 CY7C68013A -# testdeviceInfo=ch.ntb.usb.CY7C68013A +# testdeviceInfo=ch.ntb.usb.test.CY7C68013A