axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d...@apache.org
Subject cvs commit: ws-axis/java/src/org/apache/axis/configuration FileProvider.java EngineConfigurationFactoryEJB.java
Date Tue, 25 Jan 2005 18:15:40 GMT
dims        2005/01/25 10:15:40

  Modified:    java/src/org/apache/axis/utils ClassUtils.java
               java/src/org/apache/axis/configuration FileProvider.java
  Removed:     java/src/org/apache/axis/configuration
                        EngineConfigurationFactoryEJB.java
  Log:
  Fix for AXIS-1776 - Client configuration '.wsdd' files not found when packaged in an ejb-jar
file.
  
  Revision  Changes    Path
  1.11      +30 -0     ws-axis/java/src/org/apache/axis/utils/ClassUtils.java
  
  Index: ClassUtils.java
  ===================================================================
  RCS file: /home/cvs/ws-axis/java/src/org/apache/axis/utils/ClassUtils.java,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- ClassUtils.java	25 Feb 2004 14:02:48 -0000	1.10
  +++ ClassUtils.java	25 Jan 2005 18:15:40 -0000	1.11
  @@ -214,6 +214,36 @@
        * </ol>
        * @param clazz class to use in the lookups
        * @param resource resource string to look for
  +     * @param checkThreadContextFirst check the thread context first?
  +     * @return input stream if found, or null
  +     */
  +    public static InputStream getResourceAsStream(Class clazz, String resource, boolean
checkThreadContextFirst) {
  +        InputStream myInputStream = null;
  +
  +        if (checkThreadContextFirst &&
  +                Thread.currentThread().getContextClassLoader() != null) {
  +            // try the context class loader.
  +            myInputStream =
  +                    Thread.currentThread().getContextClassLoader()
  +                    .getResourceAsStream(resource);
  +        }
  +        if (myInputStream == null) {
  +            // if not found in context class loader fall back to default
  +            myInputStream = getResourceAsStream(clazz, resource);
  +        }
  +        return myInputStream;
  +    }
  +    
  +    /**
  +     * Get an input stream from a named resource.
  +     * Tries
  +     * <ol>
  +     * <li>the classloader that loaded "clazz" first,
  +     * <li>the system classloader
  +     * <li>the class "clazz" itself
  +     * </ol>
  +     * @param clazz class to use in the lookups
  +     * @param resource resource string to look for
        * @return input stream if found, or null
        */
       public static InputStream getResourceAsStream(Class clazz, String resource) {
  
  
  
  1.55      +1 -1      ws-axis/java/src/org/apache/axis/configuration/FileProvider.java
  
  Index: FileProvider.java
  ===================================================================
  RCS file: /home/cvs/ws-axis/java/src/org/apache/axis/configuration/FileProvider.java,v
  retrieving revision 1.54
  retrieving revision 1.55
  diff -u -r1.54 -r1.55
  --- FileProvider.java	2 Dec 2004 13:04:17 -0000	1.54
  +++ FileProvider.java	25 Jan 2005 18:15:40 -0000	1.55
  @@ -167,7 +167,7 @@
                       setInputStream(new FileInputStream(configFile));
                   } catch (Exception e) {
                       if (searchClasspath)
  -                        setInputStream(ClassUtils.getResourceAsStream(engine.getClass(),
filename));
  +                        setInputStream(ClassUtils.getResourceAsStream(engine.getClass(),
filename, true));
                   }
               }
   
  
  
  

Mime
View raw message