commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d...@apache.org
Subject cvs commit: jakarta-commons/latka/src/java/org/apache/commons/latka LatkaProperties.java
Date Sat, 02 Feb 2002 11:37:54 GMT
dion        02/02/02 03:37:54

  Modified:    latka/src/java/org/apache/commons/latka LatkaProperties.java
  Log:
  More javadoc and formatting changes
  
  Revision  Changes    Path
  1.10      +20 -7     jakarta-commons/latka/src/java/org/apache/commons/latka/LatkaProperties.java
  
  Index: LatkaProperties.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/latka/src/java/org/apache/commons/latka/LatkaProperties.java,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- LatkaProperties.java	2 Feb 2002 11:29:41 -0000	1.9
  +++ LatkaProperties.java	2 Feb 2002 11:37:54 -0000	1.10
  @@ -106,7 +106,7 @@
        * @return Latka Properties object 
        */
       public static Properties getProperties() {
  -        return(Properties) _propsThreadLocal.get();
  +        return (Properties) _propsThreadLocal.get();
       }
   
       /**
  @@ -134,7 +134,8 @@
           Properties properties  = new Properties();
       
           try {
  -            properties.putAll(loadPropsFromClasspath("latka.properties.internal"));
  +            properties.putAll(
  +                       loadPropsFromClasspath("latka.properties.internal"));
           } catch (IOException e) {
               _log.error(
                   "Couldn't find latka.properties.internal file in the classpath",
  @@ -145,6 +146,10 @@
   
       }
   
  +    /**
  +     * Load <em>latka.properties</em> from classpath
  +     * @return loaded properties
  +     */
       protected static Properties loadUserProps() {
   
           Properties properties  = new Properties();
  @@ -153,15 +158,22 @@
               properties.putAll(loadPropsFromClasspath("latka.properties"));
           } catch (IOException e) {
               _log.debug(e);
  -            _log.warn("No user-defined latka.properties file in the classpath (optional)");
  +            _log.warn(
  +             "No user-defined latka.properties file in the classpath (optional)"
  +                     );
           }
   
           return properties;
      
       }
   
  -    protected static Properties loadPropsFromClasspath(String classpathLocation) 
  -                                throws IOException {
  +    /**
  +     * Load properties specified from context class path
  +     * @param classpathLocation Resource name to load
  +     */
  +    protected static Properties
  +                     loadPropsFromClasspath(String classpathLocation)
  +                     throws IOException {
           Properties properties  = new Properties();
       
           ClassLoader loader = Thread.currentThread().getContextClassLoader();
  @@ -169,7 +181,8 @@
           InputStream stream = loader.getResourceAsStream(classpathLocation);
   
           if (stream == null) {
  -            throw new IOException("Could not find this file in classpath: " + classpathLocation);
  +            throw new IOException("Could not find this file in classpath: " +
  +                                  classpathLocation);
           }
   
           properties.load(stream);
  @@ -184,7 +197,7 @@
        * @author Morgan Delagrange
        */
       private static class LatkaThreadLocal extends ThreadLocal {
  -
  +        /** default properties for the thread */
           protected Properties _initProps = null;
   
           /**
  
  
  

--
To unsubscribe, e-mail:   <mailto:commons-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:commons-dev-help@jakarta.apache.org>


Mime
View raw message