- 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;
|
||||
|
||||
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"));
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user