Throw a FileNotFoundException in loadProperties() if we are unable to
locate the properties file in the classpath. git-svn-id: https://samskivert.googlecode.com/svn/trunk@326 6335cc39-0255-0410-8fd6-9bcaacd3b74c
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
//
|
//
|
||||||
// $Id: ConfigUtil.java,v 1.4 2001/08/11 22:43:29 mdb Exp $
|
// $Id: ConfigUtil.java,v 1.5 2001/09/20 20:39:49 mdb Exp $
|
||||||
//
|
//
|
||||||
// samskivert library - useful routines for java programs
|
// samskivert library - useful routines for java programs
|
||||||
// Copyright (C) 2001 Michael Bayne
|
// Copyright (C) 2001 Michael Bayne
|
||||||
@@ -20,12 +20,9 @@
|
|||||||
|
|
||||||
package com.samskivert.util;
|
package com.samskivert.util;
|
||||||
|
|
||||||
import java.io.InputStream;
|
import java.io.*;
|
||||||
import java.io.IOException;
|
|
||||||
import java.net.URL;
|
import java.net.URL;
|
||||||
import java.util.ArrayList;
|
import java.util.*;
|
||||||
import java.util.Enumeration;
|
|
||||||
import java.util.Properties;
|
|
||||||
|
|
||||||
import com.samskivert.Log;
|
import com.samskivert.Log;
|
||||||
|
|
||||||
@@ -70,12 +67,13 @@ public class ConfigUtil
|
|||||||
throws IOException
|
throws IOException
|
||||||
{
|
{
|
||||||
InputStream in = getStream(path, loader);
|
InputStream in = getStream(path, loader);
|
||||||
Properties props = null;
|
if (in == null) {
|
||||||
|
throw new FileNotFoundException(path);
|
||||||
|
}
|
||||||
|
|
||||||
if (in != null) {
|
Properties props = null;
|
||||||
props = new Properties();
|
props = new Properties();
|
||||||
props.load(in);
|
props.load(in);
|
||||||
}
|
|
||||||
|
|
||||||
return props;
|
return props;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user