- loading of .configure file fixed for eclipse
- testdevice.properties updated for new package names git-svn-id: https://svn.code.sf.net/p/libusbjava/code/trunk@197 94ad28fe-ef68-46b1-9651-e7ae4fcf1c4c
This commit is contained in:
@@ -1,9 +1,6 @@
|
|||||||
package ch.ntb.usb.logger;
|
package ch.ntb.usb.logger;
|
||||||
|
|
||||||
import java.io.FileInputStream;
|
import java.io.InputStream;
|
||||||
import java.io.FileNotFoundException;
|
|
||||||
import java.net.URL;
|
|
||||||
import java.net.URLDecoder;
|
|
||||||
import java.util.Properties;
|
import java.util.Properties;
|
||||||
import java.util.logging.ConsoleHandler;
|
import java.util.logging.ConsoleHandler;
|
||||||
import java.util.logging.Handler;
|
import java.util.logging.Handler;
|
||||||
@@ -57,14 +54,11 @@ public class LogUtil {
|
|||||||
|
|
||||||
private static void createLoggersFromProperties() {
|
private static void createLoggersFromProperties() {
|
||||||
try {
|
try {
|
||||||
URL url = ClassLoader.getSystemResource(PROPERTIES_FILE);
|
InputStream is = LogUtil.class.getClassLoader()
|
||||||
if (url == null)
|
.getResourceAsStream(PROPERTIES_FILE);
|
||||||
throw new FileNotFoundException(PROPERTIES_FILE
|
// FileInputStream fis = new FileInputStream();
|
||||||
+ " not found -> file must be on classpath");
|
|
||||||
String filename = URLDecoder.decode(url.getPath(), "UTF-8");
|
|
||||||
FileInputStream fis = new FileInputStream(filename);
|
|
||||||
Properties prop = new Properties();
|
Properties prop = new Properties();
|
||||||
prop.load(fis);
|
prop.load(is);
|
||||||
// get global debug enable flag
|
// get global debug enable flag
|
||||||
debugEnabled = Boolean.parseBoolean(prop.getProperty(PLUGIN_ID
|
debugEnabled = Boolean.parseBoolean(prop.getProperty(PLUGIN_ID
|
||||||
+ "/debug"));
|
+ "/debug"));
|
||||||
|
|||||||
@@ -43,7 +43,7 @@ public class DeviceTest {
|
|||||||
String devInfoClazzName = devInfoProp.getProperty(deviceInfoKey);
|
String devInfoClazzName = devInfoProp.getProperty(deviceInfoKey);
|
||||||
if (devInfoClazzName == null) {
|
if (devInfoClazzName == null) {
|
||||||
throw new IllegalArgumentException("property " + deviceInfoKey
|
throw new IllegalArgumentException("property " + deviceInfoKey
|
||||||
+ "not found in file " + testdevicePropertiesFile);
|
+ " not found in file " + testdevicePropertiesFile);
|
||||||
}
|
}
|
||||||
Class devInfoClazz = Class.forName(devInfoClazzName);
|
Class devInfoClazz = Class.forName(devInfoClazzName);
|
||||||
devinfo = (AbstractDeviceInfo) devInfoClazz.newInstance();
|
devinfo = (AbstractDeviceInfo) devInfoClazz.newInstance();
|
||||||
|
|||||||
@@ -4,6 +4,6 @@
|
|||||||
################################################################
|
################################################################
|
||||||
|
|
||||||
# Atmel AVR AT90USB1287
|
# Atmel AVR AT90USB1287
|
||||||
testdeviceInfo=ch.ntb.usb.AT90USB1287
|
testdeviceInfo=ch.ntb.usb.test.AT90USB1287
|
||||||
# Cypress FX2 CY7C68013A
|
# Cypress FX2 CY7C68013A
|
||||||
# testdeviceInfo=ch.ntb.usb.CY7C68013A
|
# testdeviceInfo=ch.ntb.usb.test.CY7C68013A
|
||||||
|
|||||||
Reference in New Issue
Block a user