akarasulu 2003/11/11 18:50:58
Modified: repository/impl/src/java/org/apache/avalon/repository/impl
DefaultRepositoryFactory.java
Log:
Added code to get defaults from the
defaults.properties for the default Repository
implementation.
Revision Changes Path
1.4 +18 -2
avalon-sandbox/repository/impl/src/java/org/apache/avalon/repository/impl/DefaultRepositoryFactory.java
Index: DefaultRepositoryFactory.java
===================================================================
RCS file:
/home/cvs/avalon-sandbox/repository/impl/src/java/org/apache/avalon/repository/impl/DefaultRepositoryFactory.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- DefaultRepositoryFactory.java 11 Nov 2003 01:22:26 -0000 1.3
+++ DefaultRepositoryFactory.java 12 Nov 2003 02:50:58 -0000 1.4
@@ -52,6 +52,7 @@
import java.io.File ;
+import java.io.IOException;
import java.util.Properties ;
import java.net.Authenticator ;
@@ -77,6 +78,9 @@
*/
public class DefaultRepositoryFactory implements RepositoryFactory
{
+ /** context defaults to load */
+ public static final String DEFAULTS = "defaults.properties" ;
+
/** single valued properties */
private static final String [] s_singles = {
"cache.dir",
@@ -119,7 +123,19 @@
Properties l_bootstrap = new Properties() ;
ProxyContext l_proxy = null ;
RepositoryContext l_config = new DefaultRepositoryConfig() ;
-
+
+ try
+ {
+ l_bootstrap.load( DefaultRepositoryFactory.class
+ .getResourceAsStream( DEFAULTS ) ) ;
+ }
+ catch ( IOException e )
+ {
+ throw new RepositoryException(
+ "Failed to load implementation defaults from jar's "
+ + DEFAULTS, e ) ;
+ }
+
/*
* Create the finder (discovery policy), construct the defaults, and
* macro expand the values.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]