- throw FileNotFoundException
git-svn-id: https://svn.code.sf.net/p/libusbjava/code/trunk@181 94ad28fe-ef68-46b1-9651-e7ae4fcf1c4c
This commit is contained in:
@@ -1,6 +1,7 @@
|
|||||||
package ch.ntb.usb.logger;
|
package ch.ntb.usb.logger;
|
||||||
|
|
||||||
import java.io.FileInputStream;
|
import java.io.FileInputStream;
|
||||||
|
import java.io.FileNotFoundException;
|
||||||
import java.net.URL;
|
import java.net.URL;
|
||||||
import java.util.Properties;
|
import java.util.Properties;
|
||||||
import java.util.logging.ConsoleHandler;
|
import java.util.logging.ConsoleHandler;
|
||||||
@@ -56,6 +57,9 @@ public class LogUtil {
|
|||||||
private static void createLoggersFromProperties() {
|
private static void createLoggersFromProperties() {
|
||||||
try {
|
try {
|
||||||
URL url = ClassLoader.getSystemResource(PROPERTIES_FILE);
|
URL url = ClassLoader.getSystemResource(PROPERTIES_FILE);
|
||||||
|
if (url == null)
|
||||||
|
throw new FileNotFoundException(PROPERTIES_FILE
|
||||||
|
+ " not found -> file must be on classpath");
|
||||||
FileInputStream fis = new FileInputStream(url.getFile());
|
FileInputStream fis = new FileInputStream(url.getFile());
|
||||||
Properties prop = new Properties();
|
Properties prop = new Properties();
|
||||||
prop.load(fis);
|
prop.load(fis);
|
||||||
|
|||||||
Reference in New Issue
Block a user