protected void load ( ) { properties = new Properties ( ) ; String filename = getFilename ( ) ; try { URL url = ClassHelper . getResource ( filename ) ; if ( url == null ) { url = ( new File ( filename ) ) . toURL ( ) ; } logger . info ( "Loading OJB's properties: " + url ) ; URLConnection conn = url . openConnection ( ) ; conn . setUseCaches ( false ) ; conn . connect ( ) ; InputStream strIn = conn . getInputStream ( ) ; properties . load ( strIn ) ; strIn . close ( ) ; } catch ( FileNotFoundException ex ) { // [tomdz] If the filename is explicitly reset (null or empty string) then we'll // output an info message because the user did this on purpose // Otherwise, we'll output a warning if ( ( filename == null ) || ( filename . length ( ) == 0 ) ) { logger . info ( "Starting OJB without a properties file. OJB is using default settings instead." ) ; } else { logger . warn ( "Could not load properties file '" + filename + "'. Using default settings!" , ex ) ; } // [tomdz] There seems to be no use of this setting ? //properties.put("valid", "false"); } catch ( Exception ex ) { throw new MetadataException ( "An error happend while loading the properties file '" + filename + "'" , ex ) ; } }
Loads the Configuration from the properties file .