Index: src/main/java/org/apache/jackrabbit/core/data/db/DbDataStore.java =================================================================== --- src/main/java/org/apache/jackrabbit/core/data/db/DbDataStore.java (revision 620699) +++ src/main/java/org/apache/jackrabbit/core/data/db/DbDataStore.java (working copy) @@ -23,6 +23,7 @@ import org.apache.jackrabbit.core.persistence.bundle.util.ConnectionRecoveryManager; import org.apache.jackrabbit.core.persistence.bundle.util.TrackingInputStream; import org.apache.jackrabbit.core.persistence.bundle.util.ConnectionRecoveryManager.StreamWrapper; +import org.apache.jackrabbit.core.util.Closer; import org.apache.jackrabbit.util.Text; import org.apache.jackrabbit.uuid.UUID; import org.slf4j.Logger; @@ -533,12 +534,15 @@ } } Properties prop = new Properties(); + try { prop.load(new BufferedInputStream(in)); } catch (IOException e) { String msg = "Configuration error: Could not read properties '" + databaseType + ".properties'"; log.debug(msg); throw new DataStoreException(msg); + } finally { + Closer.close(in); } if (driver == null) { driver = getProperty(prop, "driver", driver); Index: src/main/java/org/apache/jackrabbit/core/util/Closer.java =================================================================== --- src/main/java/org/apache/jackrabbit/core/util/Closer.java (revision 0) +++ src/main/java/org/apache/jackrabbit/core/util/Closer.java (revision 0) @@ -0,0 +1,65 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.jackrabbit.core.util; + +import java.io.IOException; +import java.io.InputStream; +import java.io.OutputStream; +import java.io.Reader; +import java.io.Writer; + +public class Closer { + + private Closer() { + } + + public static void close(InputStream is) { + try { + if (is != null) + is.close(); + } catch (IOException ioe) { + //ignore + } + } + + public static void close(OutputStream os) { + try { + if (os != null) + os.close(); + } catch (IOException ioe) { + //ignore + } + } + + public static void close(Reader r) { + try { + if (r != null) + r.close(); + } catch (IOException ioe) { + //ignore + } + } + + public static void close(Writer w) { + try { + if (w != null) + w.close(); + } catch (IOException ioe) { + //ignore + } + } +}