Author: painter
Date: Tue Nov  6 14:37:50 2018
New Revision: 1845926

URL: http://svn.apache.org/viewvc?rev=1845926&view=rev
Log:
Update javadoc, code cleanup and move StringUtils to commons-lang3

Removed:
    
turbine/fulcrum/trunk/resourcemanager/src/java/org/apache/fulcrum/resourcemanager/impl/StringUtils.java
Modified:
    turbine/fulcrum/trunk/resourcemanager/pom.xml
    
turbine/fulcrum/trunk/resourcemanager/src/java/org/apache/fulcrum/resourcemanager/ResourceManager.java
    
turbine/fulcrum/trunk/resourcemanager/src/java/org/apache/fulcrum/resourcemanager/impl/BaseResourceManager.java
    
turbine/fulcrum/trunk/resourcemanager/src/java/org/apache/fulcrum/resourcemanager/impl/FileResourceManager.java
    
turbine/fulcrum/trunk/resourcemanager/src/java/org/apache/fulcrum/resourcemanager/impl/ResourceManagerServiceImpl.java
    turbine/fulcrum/trunk/resourcemanager/src/test/TestRoleConfig.xml
    
turbine/fulcrum/trunk/resourcemanager/src/test/org/apache/fulcrum/resourcemanager/ResourceManagerServiceTest.java
    turbine/fulcrum/trunk/resourcemanager/xdocs/changes.xml

Modified: turbine/fulcrum/trunk/resourcemanager/pom.xml
URL: 
http://svn.apache.org/viewvc/turbine/fulcrum/trunk/resourcemanager/pom.xml?rev=1845926&r1=1845925&r2=1845926&view=diff
==============================================================================
--- turbine/fulcrum/trunk/resourcemanager/pom.xml (original)
+++ turbine/fulcrum/trunk/resourcemanager/pom.xml Tue Nov  6 14:37:50 2018
@@ -65,6 +65,11 @@
 
     <dependencies>
         <dependency>
+            <groupId>org.apache.commons</groupId>
+            <artifactId>commons-lang3</artifactId>
+            <version>3.8.1</version>
+        </dependency>    
+        <dependency>
             <groupId>org.apache.avalon.framework</groupId>
             <artifactId>avalon-framework-api</artifactId>
             <version>4.3.1</version>

Modified: 
turbine/fulcrum/trunk/resourcemanager/src/java/org/apache/fulcrum/resourcemanager/ResourceManager.java
URL: 
http://svn.apache.org/viewvc/turbine/fulcrum/trunk/resourcemanager/src/java/org/apache/fulcrum/resourcemanager/ResourceManager.java?rev=1845926&r1=1845925&r2=1845926&view=diff
==============================================================================
--- 
turbine/fulcrum/trunk/resourcemanager/src/java/org/apache/fulcrum/resourcemanager/ResourceManager.java
 (original)
+++ 
turbine/fulcrum/trunk/resourcemanager/src/java/org/apache/fulcrum/resourcemanager/ResourceManager.java
 Tue Nov  6 14:37:50 2018
@@ -70,7 +70,7 @@ public interface ResourceManager
      *
      * @param resourcePath the path of the resource
      * @param resourceContent the content of the resource
-     * @exception IOException accessing the resource failed
+     * @throws IOException accessing the resource failed
      */
     void create( String resourcePath, Object resourceContent )
         throws IOException;
@@ -80,7 +80,7 @@ public interface ResourceManager
      *
      * @param resourcePath the path of the resource
      * @return the content of the resource
-     * @exception IOException accessing the resource failed
+     * @throws IOException accessing the resource failed
      */
     byte[] read(  String resourcePath )
         throws IOException;
@@ -90,7 +90,7 @@ public interface ResourceManager
      *
      * @param resourcePath the path of the resource
      * @param resourceContent the content of resource
-     * @exception IOException accessing the resource failed
+     * @throws IOException accessing the resource failed
      */
     void update( String resourcePath, Object resourceContent )
         throws IOException;
@@ -100,7 +100,7 @@ public interface ResourceManager
      *
      * @param resourcePath the path of the resource
      * @return true if the resource was physically deleted
-     * @exception IOException accessing the resource failed
+     * @throws IOException accessing the resource failed
      */
     boolean delete( String resourcePath )
         throws IOException;
@@ -133,7 +133,7 @@ public interface ResourceManager
      * @param context the context to locate the resource
      * @param resourceName the name of the resource
      * @return the content of the resource
-     * @exception IOException accessing the resource failed
+     * @throws IOException accessing the resource failed
      */
     byte[] read( String[] context, String resourceName )
        throws IOException;

Modified: 
turbine/fulcrum/trunk/resourcemanager/src/java/org/apache/fulcrum/resourcemanager/impl/BaseResourceManager.java
URL: 
http://svn.apache.org/viewvc/turbine/fulcrum/trunk/resourcemanager/src/java/org/apache/fulcrum/resourcemanager/impl/BaseResourceManager.java?rev=1845926&r1=1845925&r2=1845926&view=diff
==============================================================================
--- 
turbine/fulcrum/trunk/resourcemanager/src/java/org/apache/fulcrum/resourcemanager/impl/BaseResourceManager.java
 (original)
+++ 
turbine/fulcrum/trunk/resourcemanager/src/java/org/apache/fulcrum/resourcemanager/impl/BaseResourceManager.java
 Tue Nov  6 14:37:50 2018
@@ -96,7 +96,7 @@ public abstract class BaseResourceManage
         // nothing to do
     }
 
-    /**
+    /* (non-Javadoc)
      * @see 
org.apache.avalon.framework.context.Contextualizable#contextualize(org.apache.avalon.framework.context.Context)
      */
     public void contextualize(Context context) throws ContextException
@@ -106,7 +106,7 @@ public abstract class BaseResourceManage
         this.tempDir        = (File) context.get("urn:avalon:temp");
     }
 
-    /**
+    /* (non-Javadoc)
      * @see 
org.apache.avalon.framework.service.Serviceable#service(org.apache.avalon.framework.service.ServiceManager)
      */
     public void service(ServiceManager serviceManager) throws ServiceException
@@ -114,7 +114,7 @@ public abstract class BaseResourceManage
         this.serviceManager = serviceManager;
     }
 
-    /**
+    /* (non-Javadoc)
      * @see 
org.apache.avalon.framework.configuration.Configurable#configure(org.apache.avalon.framework.configuration.Configuration)
      */
     public void configure(Configuration configuration) throws 
ConfigurationException
@@ -124,7 +124,7 @@ public abstract class BaseResourceManage
         this.seed = "resourcemanager";
     }
 
-    /**
+    /* (non-Javadoc)
      * @see org.apache.avalon.framework.activity.Initializable#initialize()
      */
     public void initialize() throws Exception
@@ -132,7 +132,7 @@ public abstract class BaseResourceManage
         // nothing to do
     }
 
-    /**
+    /* (non-Javadoc)
      * @see org.apache.avalon.framework.activity.Disposable#dispose()
      */
     public void dispose()
@@ -146,7 +146,7 @@ public abstract class BaseResourceManage
         this.tempDir = null;
     }
 
-    /**
+    /* (non-Javadoc)
      * @see 
org.apache.avalon.framework.configuration.Reconfigurable#reconfigure(org.apache.avalon.framework.configuration.Configuration)
      */
     public void reconfigure(Configuration configuration)
@@ -209,6 +209,9 @@ public abstract class BaseResourceManage
 
     /**
      * Get the content as byte[].
+     * @param content content to convert
+     * @return byte array representation of the object
+     * @throws IOException if unable to read
      */
     protected byte[] getContent( Object content )
        throws IOException
@@ -244,6 +247,9 @@ public abstract class BaseResourceManage
 
     /**
      * Extract a byte[] from the input stream.
+     * @param is input stream to read from
+     * @return byte array representation of the object
+     * @throws IOException if unable to read
      */
     protected byte[] getBytes( InputStream is )
        throws IOException
@@ -324,6 +330,7 @@ public abstract class BaseResourceManage
 
     /**
      * @return the password for the resource manager
+     * @throws Exception generic exception
      */
     private char[] getPassword() throws Exception
        {
@@ -334,6 +341,7 @@ public abstract class BaseResourceManage
      * Reads the given input stream and decrypts it if required
      * @param is the input stream to be read
      * @return the content of the input stream
+     * @throws IOException if unable to read
      */
     protected byte[] read( InputStream is )
        throws IOException
@@ -356,6 +364,7 @@ public abstract class BaseResourceManage
      * Reads from an unencrypted input stream
      * @param is the source input stream
      * @return the content of the input stream
+     * @throws IOException if unable to read
      */
     private byte[] readPlain( InputStream is )
        throws IOException
@@ -371,6 +380,7 @@ public abstract class BaseResourceManage
      * Reads a potentially encrypted input stream.
      * @param is the source input stream
      * @return the content of the input stream
+     * @throws IOException if unable to read
      */
     private byte[] readSmartEncrypted( InputStream is )
        throws IOException
@@ -404,6 +414,7 @@ public abstract class BaseResourceManage
      * Reads a potentially encrypted input stream.
      * @param is the source input stream
      * @return the content of the input stream
+     * @throws IOException if unable to read
      */
     private byte[] readEncrypted( InputStream is )
        throws IOException
@@ -439,6 +450,7 @@ public abstract class BaseResourceManage
      *
      * @param os the output stream to be written
      * @param content the content to be written
+     * @throws IOException if unable to read
      */
     protected void write( OutputStream os, byte[] content )
        throws IOException
@@ -461,7 +473,8 @@ public abstract class BaseResourceManage
      * Write the given content without encryption.
      *
      * @param os the output stream
-     * @parwm content the content to be written
+     * @param content the content to be written
+     * @throws IOException if unable to read
      */
     private void writePlain( OutputStream os, byte[] content )
        throws IOException
@@ -474,7 +487,8 @@ public abstract class BaseResourceManage
      * Write the given content and encrypt it.
      *
      * @param os the output stream
-     * @parwm content the content to be written
+     * @param content the content to be written
+     * @throws IOException if unable to read
      */
     private void writeEncrypted( OutputStream os, byte[] content )
        throws IOException

Modified: 
turbine/fulcrum/trunk/resourcemanager/src/java/org/apache/fulcrum/resourcemanager/impl/FileResourceManager.java
URL: 
http://svn.apache.org/viewvc/turbine/fulcrum/trunk/resourcemanager/src/java/org/apache/fulcrum/resourcemanager/impl/FileResourceManager.java?rev=1845926&r1=1845925&r2=1845926&view=diff
==============================================================================
--- 
turbine/fulcrum/trunk/resourcemanager/src/java/org/apache/fulcrum/resourcemanager/impl/FileResourceManager.java
 (original)
+++ 
turbine/fulcrum/trunk/resourcemanager/src/java/org/apache/fulcrum/resourcemanager/impl/FileResourceManager.java
 Tue Nov  6 14:37:50 2018
@@ -30,7 +30,7 @@ import java.util.Arrays;
 
 import org.apache.avalon.framework.configuration.Configuration;
 import org.apache.avalon.framework.configuration.ConfigurationException;
-
+import org.apache.commons.lang3.StringUtils;
 
 /**
  * Concrete implementation of a file-based resource service. The current
@@ -39,501 +39,486 @@ import org.apache.avalon.framework.confi
  *
  * @author <a href="mailto:[email protected]";>Siegfried Goeschl</a>
  */
-public class FileResourceManager
-       extends BaseResourceManager
-{
-    /** an optinal suffix to filter resources */
-    private String suffix;
-
-    /** try to locate a resource automagically? */
-    private boolean useLocator;
-
-    /** the location where all resources are located */
-    private File resourceDir;
-
-    /** the cached list of all available resources */
-    private String[] resourceFileNameList;
-
-    /** the directory names we usually want to exclude  */
-    private String[] defaultDirectoryExcludes;
-
-    /////////////////////////////////////////////////////////////////////////
-    // Avalon Service Lifecycle Implementation
-    /////////////////////////////////////////////////////////////////////////
-
-    /**
-     * Constructor
-     */
-    public FileResourceManager()
-    {
-        super();
-
-        this.useLocator = true;
-        this.defaultDirectoryExcludes =  new String[] { "CVS", ".svn" };
-    }
-
-    /**
-     * @see 
org.apache.avalon.framework.configuration.Configurable#configure(org.apache.avalon.framework.configuration.Configuration)
-     */
-    public void configure(Configuration cfg) throws ConfigurationException
-    {
-        super.configure( cfg );
-
-        // the optional suffix - "*" is the usual wildcard suffix
-
-        this.suffix = cfg.getChild(CONFIG_KEY_SUFFIX).getValue("*");
-
-        // try to locate a resources automagically  ?
-
-        this.useLocator = 
cfg.getChild(CONFIG_KEY_USELOCATOR).getValueAsBoolean(false);
-
-        // are we using encryption/decryption
-
-        this.setUseEncryption(
-            cfg.getChild(CONFIG_KEY_USEENCRYPTION).getValue("false")
-            );
-
-        // locate the directory where we the resources are located
-
-        String currLocationName = cfg.getChild(CONFIG_KEY_LOCATION).getValue();
-        File currLocation = new File( currLocationName );
-
-        if( currLocation.isAbsolute() )
-        {
-            this.resourceDir = currLocation;
-        }
-        else
-        {
-            this.resourceDir = new File( this.getApplicationDir(), 
currLocationName );
-        }
-
-        if( this.resourceDir.exists() )
-        {
-            this.getLogger().debug(
-                "Using the resource directory : " + 
this.resourceDir.getAbsolutePath()
-                );
-        }
-        else
-        {
-            String msg = "The following resource directory is not found : "
-                + this.resourceDir.getAbsolutePath();
-
-            throw new ConfigurationException( msg );
-        }
-
-
-        // load the file names of all resources and sort it
-
-        this.createResourceFileNameList();
-    }
-
-    /**
-     * @see org.apache.avalon.framework.activity.Disposable#dispose()
-     */
-    public void dispose()
-    {
-        super.dispose();
-
-        this.suffix = null;
-        this.useLocator = false;
-        this.resourceDir = null;
-        this.resourceFileNameList = null;
-    }
-
-    /**
-     * @see 
org.apache.avalon.framework.configuration.Reconfigurable#reconfigure(org.apache.avalon.framework.configuration.Configuration)
-     */
-    public void reconfigure(Configuration configuration)
-        throws ConfigurationException
-    {
-        super.reconfigure( configuration );
-        this.configure(configuration);
-    }
-
-    /////////////////////////////////////////////////////////////////////////
-    // Service interface implementation
-    /////////////////////////////////////////////////////////////////////////
-
-    /**
-     * @see 
org.apache.fulcrum.resourcemanager.ResourceManager#exists(java.lang.String)
-     */
-    public synchronized boolean exists(String resourceName)
-    {
-        File resourceFile = this.findResourceFile( resourceName, 
this.resourceFileNameList );
-        return resourceFile != null;
-       }
-
-    /**
-     * @see org.apache.fulcrum.resourcemanager.ResourceManager#listResources()
-     */
-    public synchronized String[] listResources()
-    {
-        String resourceDirName = this.getResourceDir().getAbsolutePath();
-        String[] fileList = this.resourceFileNameList;
-        String[] result = new String[fileList.length];
-
-        // remove the resource directory name
-
-        for( int i=0; i< result.length; i++ )
-        {
-            String relativeName = fileList[i].substring(
-                resourceDirName.length()+1,
-                fileList[i].length()
-                );
-
-            result[i] = relativeName;
-        }
-
-        return result;
-    }
-
-    /**
-     * @see 
org.apache.fulcrum.resourcemanager.ResourceManager#create(java.lang.String, 
java.lang.Object)
-     */
-    public synchronized void create(String resourcePath, Object 
resourceContent)
-        throws IOException
-    {
-        File resourceFile = new File( this.getResourceDir(), resourcePath );
-        this.getLogger().debug( "Creating resource : " + 
resourceFile.getAbsolutePath() );
-        byte[] byteContent = this.getContent( resourceContent);
-        FileOutputStream fos = new FileOutputStream(resourceFile);
-        this.write( fos, byteContent );
-        fos.flush();
-        fos.close();
-        this.createResourceFileNameList();
-    }
-
-    /**
-     * @see 
org.apache.fulcrum.resourcemanager.ResourceManager#read(java.lang.String)
-     */
-    public synchronized byte[] read( String resourcePath )
-        throws IOException
-    {
-        byte[] result;
-
-        File resourceFile = this.findResourceFile( resourcePath, 
this.resourceFileNameList );
-
-        if( resourceFile != null )
-        {
-            this.getLogger().debug( "Loading the resource : " + 
resourceFile.getAbsolutePath() );
-            FileInputStream fis = new FileInputStream(resourceFile);
-            result = this.read( fis );
-            fis.close();
-               return result;
-        }
-        else
-        {
-            String msg = "Unable to find the resource : " + resourcePath;
-            this.getLogger().error( msg );
-            throw new IOException( msg );
-        }
-    }
-
-    /**
-     * @see 
org.apache.fulcrum.resourcemanager.ResourceManager#update(java.lang.String, 
java.lang.Object)
-     */
-    public synchronized void update( String resourcePath, Object 
resourceContent)
-       throws IOException
-    {
-        this.create( resourcePath, resourceContent );
-    }
-
-    /**
-     * @see 
org.apache.fulcrum.resourcemanager.ResourceManager#delete(java.lang.String)
-     */
-    public synchronized boolean delete( String resourcePath )
-       throws IOException
-    {
-        boolean result = false;
-        File file = new File( this.getResourceDir(), resourcePath );
-
-        // if a resource was deleted we have to update our resource list
-        // to avoid a stale entry
-
-        if(file.delete())
-        {
-            this.createResourceFileNameList();
-            result = true;
-        }
-
-        return result;
-    }
-
-    /**
-     * @see org.apache.fulcrum.resourcemanager.ResourceManager#exists(, 
java.lang.String)
-     */
-    public synchronized boolean exists( String[] context, String resourceName )
-    {
-        return(this.locate(context, resourceName) != null);
-    }
-
-    /**
-     * @see 
org.apache.fulcrum.resourcemanager.ResourceManager#read(java.lang.String[], 
java.lang.String)
-     */
-    public synchronized byte[] read( String[] context, String resourceName )
-        throws IOException
-    {
-        String resourceFileName = this.createResourceFileName( context, 
resourceName );
-        return this.read( resourceFileName );
-    }
-
-    /**
-     * @see 
org.apache.fulcrum.resourcemanager.ResourceManager#locate(java.lang.String[], 
java.lang.String)
-     */
-    public synchronized String locate( String[] context, String resourceName )
-    {
-        String result = null;
-        String resourceDirName = this.getResourceDir().getAbsolutePath();
-        String resourceFileName = this.createResourceFileName( context, 
resourceName );
-        File resourceFile = this.findResourceFile( resourceFileName, 
this.resourceFileNameList );
-
-        if( resourceFile != null )
-        {
-            String temp = resourceFile.getAbsolutePath();
-
-               result = temp.substring(
-                   resourceDirName.length()+1,
-                   temp.length()
-                   );
-
-               result = result.replace( '\\', '/' );
-        }
-
-        return result;
-    }
-
-    /**
-     * @see 
org.apache.fulcrum.resourcemanager.ResourceManager#getResourceURL(java.lang.String[],
 java.lang.String)
-     */
-    public synchronized URL getResourceURL(String [] context, String 
resourceName)
-    {
-        String resourceFileName = this.createResourceFileName( context, 
resourceName );
-        File resourceFile = this.findResourceFile( resourceFileName, 
this.resourceFileNameList );
-
-        if( resourceFile != null )
-        {
-            try
-            {
-                return resourceFile.toURI().toURL();
-            }
-            catch( MalformedURLException e )
-            {
-                throw new RuntimeException( e.getMessage() );
-            }
-        }
-        else
-        {
-            return null;
-        }
-    }
-
-    /////////////////////////////////////////////////////////////////////////
-    // Service Implementation
-    /////////////////////////////////////////////////////////////////////////
-
-    /**
-     * Check if the given directory name is excluded from the search.
-     *
-     * @param directory the directory
-     * @return true if the directory name is excluded
-     */
-    private boolean isDirectoryExcluded( File directory )
-    {
-        String directoryName = directory.getName();
-
-        for( int i=0; i<this.defaultDirectoryExcludes.length; i++ )
-        {
-            if(this.defaultDirectoryExcludes[i].equals(directoryName))
-            {
-                return true;
-            }
-        }
-
-        return false;
-    }
-
-    /**
-     * Creates a sorted list of resource file names using the user-supplied
-     * suffix.
-     */
-    private void createResourceFileNameList()
-    {
-        ArrayList resourceList = new ArrayList();
-        this.findAllResources( this.getResourceDir(), this.suffix, 
resourceList );
-        this.resourceFileNameList = (String[]) resourceList.toArray( new 
String[resourceList.size()] );
-        Arrays.sort( this.resourceFileNameList );
-    }
-
-    /**
-     * @return Returns the useLocator.
-     */
-    private boolean isUseLocator()
-    {
-        return useLocator;
-    }
-
-    /**
-     * @return Returns the resource directory.
-     */
-    private File getResourceDir()
-    {
-        return this.resourceDir;
-    }
-
-    /**
-     * Finds the resource file for the given name.
-     * @param resourceName the script name
-     * @param resourceList the list of available resources
-     * @return the resource file or <b>null</b> if it wasn't found
-     */
-    private File findResourceFile( String resourceName, String[] resourceList )
-    {
-        File result = null;
-        String tempFileName;
-        String resourceFileName = new File( this.getResourceDir(), 
resourceName).getAbsolutePath();
-
-        boolean wasFound = (Arrays.binarySearch(resourceList, 
resourceFileName) >= 0);
-
-        if(wasFound)
-        {
-            result = new File( resourceFileName );
-        }
-        else if( this.isUseLocator() )
-        {
-            // create a String[] with the directories contained in the 
resourceName
-            // e.g. [0]=foor [1]=bar resourceName=empty.groovy
-
-            String[] parts = StringUtils.split( resourceName, "/\\", -1 );
-            String[] context = new String[parts.length-1];
-            String scriptBaseName = parts[parts.length-1];
-
-            System.arraycopy(parts, 0, context, 0, context.length);
-
-            // create a list of files stepping up the directories
-            // [0]=./foo/bar/empty.groovy
-            // [1]=./foo/empty.groovy
-            // [2] ./empty.groovy
-
-            String baseFileName = null;
-            File[] fileList = new File[context.length+1];
-            fileList[0] = new File( this.getResourceDir(), scriptBaseName );
-
-            for(int i=1; i<context.length+1; i++ )
-            {
-                if( i == 1 )
-                {
-                    baseFileName = context[i-1];
-                }
-                else
-                {
-                    baseFileName = baseFileName + File.separator + 
context[i-1];
-                }
-
-                tempFileName = baseFileName + File.separator + scriptBaseName;
-
-                fileList[i] = new File( this.getResourceDir(), tempFileName );
-            }
-
-            // search for the resource using the generated file list
-
-            for( int i=fileList.length; i>0; i-- )
-            {
-                if( this.getLogger().isDebugEnabled() )
-                {
-                       this.getLogger().debug(
-                           "Searching for the following file : "
-                           + fileList[i-1].getAbsolutePath()
-                           );
-                }
-
-                if( Arrays.binarySearch( resourceList, 
fileList[i-1].getAbsolutePath() ) >= 0 )
-                {
-                    result = fileList[i-1];
-                    break;
-                }
-            }
-        }
-        else
-        {
-            result = null;
-        }
-
-        return result;
-    }
-
-    /**
-     * Find all resources recursively.
-     *
-     * @param startDir the start directory of the search
-     * @param suffix an optional suffix to filter the result
-     * @param result list of all matching resources
-     */
-    private void findAllResources( File startDir, String suffix, ArrayList 
result )
-    {
-        if( startDir.isDirectory() && startDir.canRead() )
-        {
-            File[] list = startDir.listFiles();
-
-            for( int i=0; i<list.length; i++ )
-            {
-                // recursive search for all subdirectories
-
-                if( list[i].isDirectory() )
-                {
-                    // check that the subdirectory is not excluded from the 
seach
-
-                    if( !this.isDirectoryExcluded(list[i]) )
-                    {
-                        this.findAllResources( list[i], suffix, result );
-                    }
-                }
-                else
-                {
-                    if(!suffix.equals("*"))
-                    {
-                           if( list[i].getName().endsWith(suffix) )
-                           {
-                               result.add( list[i].getAbsolutePath() );
-                           }
-                    }
-                    else
-                    {
-                        result.add( list[i].getAbsolutePath() );
-                    }
-                }
-            }
-        }
-    }
-
-    /**
-     * Build a file name using the context and resource name.
-     * @param context the context to locate the resource
-     * @param resourceName the name of the resource
-     * @return a file name
-     */
-    private String createResourceFileName( String[] context, String 
resourceName )
-    {
-        StringBuilder result = new StringBuilder();
-
-        if( ( context != null ) && ( context.length > 0 ) )
-        {
-            for( int i=0; i<context.length; i++ )
-            {
-                if( context[i] != null )
-                {
-                       result.append( context[i] );
-                       result.append( File.separator  );
-                }
-                else
-                {
-                    String msg = "Don't know how to handle <null> in the 
context";
-                    throw new IllegalArgumentException( msg );
-                }
-            }
-        }
+public class FileResourceManager extends BaseResourceManager {
+       /** an optinal suffix to filter resources */
+       private String suffix;
+
+       /** try to locate a resource automagically? */
+       private boolean useLocator;
+
+       /** the location where all resources are located */
+       private File resourceDir;
+
+       /** the cached list of all available resources */
+       private String[] resourceFileNameList;
+
+       /** the directory names we usually want to exclude */
+       private String[] defaultDirectoryExcludes;
+
+       
/////////////////////////////////////////////////////////////////////////
+       // Avalon Service Lifecycle Implementation
+       
/////////////////////////////////////////////////////////////////////////
+
+       /**
+        * Constructor
+        */
+       public FileResourceManager() {
+               super();
+
+               this.useLocator = true;
+               this.defaultDirectoryExcludes = new String[] { "CVS", ".svn" };
+       }
+
+       /*
+        * (non-Javadoc)
+        * 
+        * @see
+        * 
org.apache.fulcrum.resourcemanager.impl.BaseResourceManager#configure(org.
+        * apache.avalon.framework.configuration.Configuration)
+        */
+       public void configure(Configuration cfg) throws ConfigurationException {
+               super.configure(cfg);
+
+               // the optional suffix - "*" is the usual wildcard suffix
+
+               this.suffix = cfg.getChild(CONFIG_KEY_SUFFIX).getValue("*");
+
+               // try to locate a resources automagically ?
+
+               this.useLocator = 
cfg.getChild(CONFIG_KEY_USELOCATOR).getValueAsBoolean(false);
+
+               // are we using encryption/decryption
 
-        result.append( resourceName );
+               
this.setUseEncryption(cfg.getChild(CONFIG_KEY_USEENCRYPTION).getValue("false"));
+
+               // locate the directory where we the resources are located
+
+               String currLocationName = 
cfg.getChild(CONFIG_KEY_LOCATION).getValue();
+               File currLocation = new File(currLocationName);
+
+               if (currLocation.isAbsolute()) {
+                       this.resourceDir = currLocation;
+               } else {
+                       this.resourceDir = new File(this.getApplicationDir(), 
currLocationName);
+               }
+
+               if (this.resourceDir.exists()) {
+                       this.getLogger().debug("Using the resource directory : 
" + this.resourceDir.getAbsolutePath());
+               } else {
+                       String msg = "The following resource directory is not 
found : " + this.resourceDir.getAbsolutePath();
+
+                       throw new ConfigurationException(msg);
+               }
+
+               // load the file names of all resources and sort it
+
+               this.createResourceFileNameList();
+       }
 
-        return result.toString();
-    }
+       /*
+        * (non-Javadoc)
+        * 
+        * @see 
org.apache.fulcrum.resourcemanager.impl.BaseResourceManager#dispose()
+        */
+       public void dispose() {
+               super.dispose();
+
+               this.suffix = null;
+               this.useLocator = false;
+               this.resourceDir = null;
+               this.resourceFileNameList = null;
+       }
+
+       /*
+        * (non-Javadoc)
+        * 
+        * @see
+        * 
org.apache.fulcrum.resourcemanager.impl.BaseResourceManager#reconfigure(org.
+        * apache.avalon.framework.configuration.Configuration)
+        */
+       public void reconfigure(Configuration configuration) throws 
ConfigurationException {
+               super.reconfigure(configuration);
+               this.configure(configuration);
+       }
+
+       
/////////////////////////////////////////////////////////////////////////
+       // Service interface implementation
+       
/////////////////////////////////////////////////////////////////////////
+
+       /*
+        * (non-Javadoc)
+        * 
+        * @see
+        * 
org.apache.fulcrum.resourcemanager.ResourceManager#exists(java.lang.String)
+        */
+       public synchronized boolean exists(String resourceName) {
+               File resourceFile = this.findResourceFile(resourceName, 
this.resourceFileNameList);
+               return resourceFile != null;
+       }
+
+       /*
+        * (non-Javadoc)
+        * 
+        * @see 
org.apache.fulcrum.resourcemanager.ResourceManager#listResources()
+        */
+       public synchronized String[] listResources() {
+               String resourceDirName = 
this.getResourceDir().getAbsolutePath();
+               String[] fileList = this.resourceFileNameList;
+               String[] result = new String[fileList.length];
+
+               // remove the resource directory name
+
+               for (int i = 0; i < result.length; i++) {
+                       String relativeName = 
fileList[i].substring(resourceDirName.length() + 1, fileList[i].length());
+
+                       result[i] = relativeName;
+               }
+
+               return result;
+       }
+
+       /*
+        * (non-Javadoc)
+        * 
+        * @see
+        * 
org.apache.fulcrum.resourcemanager.ResourceManager#create(java.lang.String,
+        * java.lang.Object)
+        */
+       public synchronized void create(String resourcePath, Object 
resourceContent) throws IOException {
+
+               File resourceFile = new File(this.getResourceDir(), 
resourcePath);
+               this.getLogger().debug("Creating resource : " + 
resourceFile.getAbsolutePath());
+               byte[] byteContent = this.getContent(resourceContent);
+
+               // Try to prevent any leak from the outputstream
+               FileOutputStream fos = null;
+               try {
+                       fos = new FileOutputStream(resourceFile);
+                       this.write(fos, byteContent);
+                       fos.flush();
+                       this.createResourceFileNameList();
+                       
+               } finally {
+                       try {
+                               if ( fos != null )
+                                       fos.close();
+                       } catch (IOException warn) {
+                               throw warn;
+                       }
+               }
+       }
+
+       /*
+        * (non-Javadoc)
+        * 
+        * @see
+        * 
org.apache.fulcrum.resourcemanager.ResourceManager#read(java.lang.String)
+        */
+       public synchronized byte[] read(String resourcePath) throws IOException 
{
+
+               // Result byte array
+               byte[] result = null;
+               File resourceFile = this.findResourceFile(resourcePath, 
this.resourceFileNameList);
+
+               if (resourceFile != null) {
+                       this.getLogger().debug("Loading the resource : " + 
resourceFile.getAbsolutePath());
+                       FileInputStream fis = null;
+
+                       try {
+                               fis = new FileInputStream(resourceFile);
+                               result = this.read(fis);
+
+                       } finally {
+                               try {
+                                       if ( fis != null )
+                                               fis.close();
+                               } catch (IOException warn) {
+                                       throw warn;
+                               }
+                       }
+
+                       return result;
+               } else {
+                       String msg = "Unable to find the resource : " + 
resourcePath;
+                       this.getLogger().error(msg);
+                       throw new IOException(msg);
+               }
+       }
+
+       /*
+        * (non-Javadoc)
+        * 
+        * @see
+        * 
org.apache.fulcrum.resourcemanager.ResourceManager#update(java.lang.String,
+        * java.lang.Object)
+        */
+       public synchronized void update(String resourcePath, Object 
resourceContent) throws IOException {
+               this.create(resourcePath, resourceContent);
+       }
+
+       /*
+        * (non-Javadoc)
+        * 
+        * @see
+        * 
org.apache.fulcrum.resourcemanager.ResourceManager#delete(java.lang.String)
+        */
+       public synchronized boolean delete(String resourcePath) throws 
IOException {
+               boolean result = false;
+               File file = new File(this.getResourceDir(), resourcePath);
+
+               // if a resource was deleted we have to update our resource list
+               // to avoid a stale entry
+
+               if (file.delete()) {
+                       this.createResourceFileNameList();
+                       result = true;
+               }
+
+               return result;
+       }
+
+       /*
+        * (non-Javadoc)
+        * 
+        * @see
+        * 
org.apache.fulcrum.resourcemanager.ResourceManager#exists(java.lang.String[],
+        * java.lang.String)
+        */
+       public synchronized boolean exists(String[] context, String 
resourceName) {
+               return (this.locate(context, resourceName) != null);
+       }
+
+       /*
+        * (non-Javadoc)
+        * 
+        * @see
+        * 
org.apache.fulcrum.resourcemanager.ResourceManager#read(java.lang.String[],
+        * java.lang.String)
+        */
+       public synchronized byte[] read(String[] context, String resourceName) 
throws IOException {
+               String resourceFileName = this.createResourceFileName(context, 
resourceName);
+               return this.read(resourceFileName);
+       }
+
+       /*
+        * (non-Javadoc)
+        * 
+        * @see
+        * 
org.apache.fulcrum.resourcemanager.ResourceManager#locate(java.lang.String[],
+        * java.lang.String)
+        */
+       public synchronized String locate(String[] context, String 
resourceName) {
+               String result = null;
+               String resourceDirName = 
this.getResourceDir().getAbsolutePath();
+               String resourceFileName = this.createResourceFileName(context, 
resourceName);
+               File resourceFile = this.findResourceFile(resourceFileName, 
this.resourceFileNameList);
+
+               if (resourceFile != null) {
+                       String temp = resourceFile.getAbsolutePath();
+
+                       result = temp.substring(resourceDirName.length() + 1, 
temp.length());
+
+                       result = result.replace('\\', '/');
+               }
+
+               return result;
+       }
+
+       /*
+        * (non-Javadoc)
+        * 
+        * @see
+        * 
org.apache.fulcrum.resourcemanager.ResourceManager#getResourceURL(java.lang.
+        * String[], java.lang.String)
+        */
+       public synchronized URL getResourceURL(String[] context, String 
resourceName) {
+               String resourceFileName = this.createResourceFileName(context, 
resourceName);
+               File resourceFile = this.findResourceFile(resourceFileName, 
this.resourceFileNameList);
+
+               if (resourceFile != null) {
+                       try {
+                               return resourceFile.toURI().toURL();
+                       } catch (MalformedURLException e) {
+                               throw new RuntimeException(e.getMessage());
+                       }
+               } else {
+                       return null;
+               }
+       }
+
+       
/////////////////////////////////////////////////////////////////////////
+       // Service Implementation
+       
/////////////////////////////////////////////////////////////////////////
+
+       /**
+        * Check if the given directory name is excluded from the search.
+        *
+        * @param directory the directory
+        * @return true if the directory name is excluded
+        */
+       private boolean isDirectoryExcluded(File directory) {
+               String directoryName = directory.getName();
+
+               for (int i = 0; i < this.defaultDirectoryExcludes.length; i++) {
+                       if 
(this.defaultDirectoryExcludes[i].equals(directoryName)) {
+                               return true;
+                       }
+               }
+
+               return false;
+       }
+
+       /**
+        * Creates a sorted list of resource file names using the user-supplied 
suffix.
+        */
+       private void createResourceFileNameList() {
+               ArrayList<String> resourceList = new ArrayList<>();
+               this.findAllResources(this.getResourceDir(), this.suffix, 
resourceList);
+               this.resourceFileNameList = (String[]) resourceList.toArray(new 
String[resourceList.size()]);
+               Arrays.sort(this.resourceFileNameList);
+       }
+
+       /**
+        * @return Returns the useLocator.
+        */
+       private boolean isUseLocator() {
+               return useLocator;
+       }
+
+       /**
+        * @return Returns the resource directory.
+        */
+       private File getResourceDir() {
+               return this.resourceDir;
+       }
+
+       /**
+        * Finds the resource file for the given name.
+        * 
+        * @param resourceName the script name
+        * @param resourceList the list of available resources
+        * @return the resource file or <b>null</b> if it wasn't found
+        */
+       private File findResourceFile(String resourceName, String[] 
resourceList) {
+               File result = null;
+               String tempFileName;
+               String resourceFileName = new File(this.getResourceDir(), 
resourceName).getAbsolutePath();
+
+               boolean wasFound = (Arrays.binarySearch(resourceList, 
resourceFileName) >= 0);
+
+               if (wasFound) {
+                       result = new File(resourceFileName);
+               } else if (this.isUseLocator()) {
+                       // create a String[] with the directories contained in 
the resourceName
+                       // e.g. [0]=foor [1]=bar resourceName=empty.groovy
+
+                       String[] parts = StringUtils.split(resourceName, "/\\", 
-1);
+                       String[] context = new String[parts.length - 1];
+                       String scriptBaseName = parts[parts.length - 1];
+
+                       System.arraycopy(parts, 0, context, 0, context.length);
+
+                       // create a list of files stepping up the directories
+                       // [0]=./foo/bar/empty.groovy
+                       // [1]=./foo/empty.groovy
+                       // [2] ./empty.groovy
+
+                       String baseFileName = null;
+                       File[] fileList = new File[context.length + 1];
+                       fileList[0] = new File(this.getResourceDir(), 
scriptBaseName);
+
+                       for (int i = 1; i < context.length + 1; i++) {
+                               if (i == 1) {
+                                       baseFileName = context[i - 1];
+                               } else {
+                                       baseFileName = baseFileName + 
File.separator + context[i - 1];
+                               }
+
+                               tempFileName = baseFileName + File.separator + 
scriptBaseName;
+
+                               fileList[i] = new File(this.getResourceDir(), 
tempFileName);
+                       }
+
+                       // search for the resource using the generated file list
+
+                       for (int i = fileList.length; i > 0; i--) {
+                               if (this.getLogger().isDebugEnabled()) {
+                                       this.getLogger().debug("Searching for 
the following file : " + fileList[i - 1].getAbsolutePath());
+                               }
+
+                               if (Arrays.binarySearch(resourceList, 
fileList[i - 1].getAbsolutePath()) >= 0) {
+                                       result = fileList[i - 1];
+                                       break;
+                               }
+                       }
+               } else {
+                       result = null;
+               }
+
+               return result;
+       }
+
+       /**
+        * Find all resources recursively.
+        *
+        * @param startDir the start directory of the search
+        * @param suffix   an optional suffix to filter the result
+        * @param result   list of all matching resources
+        */
+       private void findAllResources(File startDir, String suffix, 
ArrayList<String> result) {
+               if (startDir.isDirectory() && startDir.canRead()) {
+
+                       // listFiles could return null
+                       File[] list = startDir.listFiles();
+
+                       if (list != null) {
+
+                               for (int i = 0; i < list.length; i++) {
+                                       // recursive search for all 
subdirectories
+
+                                       if (list[i].isDirectory()) {
+                                               // check that the subdirectory 
is not excluded from the seach
+                                               if 
(!this.isDirectoryExcluded(list[i])) {
+                                                       
this.findAllResources(list[i], suffix, result);
+                                               }
+                                       } else {
+                                               if (!suffix.equals("*")) {
+                                                       if 
(list[i].getName().endsWith(suffix)) {
+                                                               
result.add(list[i].getAbsolutePath());
+                                                       }
+                                               } else {
+                                                       
result.add(list[i].getAbsolutePath());
+                                               }
+                                       }
+                               }
+                       }
+               }
+       }
+
+       /**
+        * Build a file name using the context and resource name.
+        * 
+        * @param context      the context to locate the resource
+        * @param resourceName the name of the resource
+        * @return a file name
+        */
+       private String createResourceFileName(String[] context, String 
resourceName) {
+               StringBuilder result = new StringBuilder();
+
+               if ((context != null) && (context.length > 0)) {
+                       for (int i = 0; i < context.length; i++) {
+                               if (context[i] != null) {
+                                       result.append(context[i]);
+                                       result.append(File.separator);
+                               } else {
+                                       String msg = "Don't know how to handle 
<null> in the context";
+                                       throw new IllegalArgumentException(msg);
+                               }
+                       }
+               }
+
+               result.append(resourceName);
+
+               return result.toString();
+       }
 }

Modified: 
turbine/fulcrum/trunk/resourcemanager/src/java/org/apache/fulcrum/resourcemanager/impl/ResourceManagerServiceImpl.java
URL: 
http://svn.apache.org/viewvc/turbine/fulcrum/trunk/resourcemanager/src/java/org/apache/fulcrum/resourcemanager/impl/ResourceManagerServiceImpl.java?rev=1845926&r1=1845925&r2=1845926&view=diff
==============================================================================
--- 
turbine/fulcrum/trunk/resourcemanager/src/java/org/apache/fulcrum/resourcemanager/impl/ResourceManagerServiceImpl.java
 (original)
+++ 
turbine/fulcrum/trunk/resourcemanager/src/java/org/apache/fulcrum/resourcemanager/impl/ResourceManagerServiceImpl.java
 Tue Nov  6 14:37:50 2018
@@ -60,7 +60,7 @@ public class ResourceManagerServiceImpl
     private Configuration[] domainConfigurationList;
 
     /** The list of registered domains */
-    private Hashtable domainList;
+    private Hashtable<String, ResourceManager> domainList;
 
     /////////////////////////////////////////////////////////////////////////
     // Avalon Service Lifecycle Implementation
@@ -71,10 +71,10 @@ public class ResourceManagerServiceImpl
      */
     public ResourceManagerServiceImpl()
     {
-        this.domainList = new Hashtable();
+        this.domainList = new Hashtable<String, ResourceManager>();
     }
 
-    /**
+    /* (non-Javadoc)
      * @see 
org.apache.avalon.framework.context.Contextualizable#contextualize(org.apache.avalon.framework.context.Context)
      */
     public void contextualize(Context context) throws ContextException
@@ -82,7 +82,7 @@ public class ResourceManagerServiceImpl
         this.context = context;
     }
 
-    /**
+    /* (non-Javadoc)
      * @see 
org.apache.avalon.framework.service.Serviceable#service(org.apache.avalon.framework.service.ServiceManager)
      */
     public void service(ServiceManager serviceManager) throws ServiceException
@@ -90,7 +90,7 @@ public class ResourceManagerServiceImpl
         this.serviceManager = serviceManager;
     }
 
-    /**
+    /* (non-Javadoc)
      * @see 
org.apache.avalon.framework.configuration.Configurable#configure(org.apache.avalon.framework.configuration.Configuration)
      */
     public void configure(Configuration cfg) throws ConfigurationException
@@ -98,7 +98,7 @@ public class ResourceManagerServiceImpl
         this.domainConfigurationList = cfg.getChildren();
     }
 
-    /**
+    /* (non-Javadoc)
      * @see org.apache.avalon.framework.activity.Initializable#initialize()
      */
     public void initialize() throws Exception
@@ -112,7 +112,7 @@ public class ResourceManagerServiceImpl
         }
     }
 
-    /**
+    /* (non-Javadoc)
      * @see org.apache.avalon.framework.activity.Disposable#dispose()
      */
     public void dispose()
@@ -142,7 +142,7 @@ public class ResourceManagerServiceImpl
     // Service interface implementation
     /////////////////////////////////////////////////////////////////////////
 
-    /**
+    /* (non-Javadoc)
      * @see 
org.apache.fulcrum.resourcemanager.ResourceManagerService#create(java.lang.String,
 java.lang.String, java.lang.Object)
      */
     public void create(String domain, String resourcePath, Object 
resourceContent) throws IOException
@@ -151,7 +151,7 @@ public class ResourceManagerServiceImpl
         resourceManager.create( resourcePath, resourceContent );
     }
 
-    /**
+    /* (non-Javadoc)
      * @see 
org.apache.fulcrum.resourcemanager.ResourceManagerService#delete(java.lang.String,
 java.lang.String)
      */
     public boolean delete(String domain, String resourcePath)
@@ -161,7 +161,7 @@ public class ResourceManagerServiceImpl
         return resourceManager.delete( resourcePath );
     }
 
-    /**
+    /* (non-Javadoc)
      * @see 
org.apache.fulcrum.resourcemanager.ResourceManagerService#exists(java.lang.String)
      */
     public boolean exists(String domain)
@@ -169,7 +169,7 @@ public class ResourceManagerServiceImpl
         return this.getDomainList().containsKey( domain );
     }
 
-    /**
+    /* (non-Javadoc)
      * @see 
org.apache.fulcrum.resourcemanager.ResourceManagerService#exists(java.lang.String,
 java.lang.String)
      */
     public boolean exists(String domain, String resourceName)
@@ -178,7 +178,7 @@ public class ResourceManagerServiceImpl
         return resourceManager.exists( resourceName );
     }
 
-    /**
+    /* (non-Javadoc)
      * @see 
org.apache.fulcrum.resourcemanager.ResourceManagerService#exists(java.lang.String,
 java.lang.String[], java.lang.String)
      */
     public boolean exists(String domain, String[]context, String resourceName)
@@ -187,14 +187,14 @@ public class ResourceManagerServiceImpl
         return resourceManager.exists( context, resourceName );
     }
 
-    /**
+    /* (non-Javadoc)
      * @see 
org.apache.fulcrum.resourcemanager.ResourceManagerService#listDomains()
      */
     public String[] listDomains()
     {
         String key;
-        Enumeration keys = this.getDomainList().keys();
-        ArrayList result = new ArrayList();
+        Enumeration<String> keys = this.getDomainList().keys();
+        ArrayList<String> result = new ArrayList<String>();
 
         while( keys.hasMoreElements() )
         {
@@ -205,7 +205,7 @@ public class ResourceManagerServiceImpl
         return (String[]) result.toArray( new String[result.size()] );
     }
 
-    /**
+    /* (non-Javadoc)
      * @see 
org.apache.fulcrum.resourcemanager.ResourceManagerService#listResources(java.lang.String)
      */
     public String[] listResources(String domain)
@@ -214,7 +214,7 @@ public class ResourceManagerServiceImpl
         return resourceManager.listResources();
     }
 
-    /**
+    /* (non-Javadoc)
      * @see 
org.apache.fulcrum.resourcemanager.ResourceManagerService#read(java.lang.String,
 java.lang.String)
      */
     public byte[] read(String domain, String resourcePath)
@@ -224,7 +224,7 @@ public class ResourceManagerServiceImpl
         return resourceManager.read( resourcePath );
     }
 
-    /**
+    /* (non-Javadoc)
      * @see 
org.apache.fulcrum.resourcemanager.ResourceManagerService#update(java.lang.String,
 java.lang.String, java.lang.Object)
      */
     public void update(String domain, String resourcePath, Object 
resourceContent)
@@ -234,7 +234,7 @@ public class ResourceManagerServiceImpl
         resourceManager.update( resourcePath, resourceContent );
     }
 
-    /**
+    /* (non-Javadoc)
      * @see 
org.apache.fulcrum.resourcemanager.ResourceManagerService#getResourceURL(java.lang.String,
 java.lang.String[], java.lang.String)
      */
     public URL getResourceURL(String domain, String[] context, String 
resourceName)
@@ -243,7 +243,7 @@ public class ResourceManagerServiceImpl
         return resourceManager.getResourceURL( context, resourceName );
     }
 
-    /**
+    /* (non-Javadoc)
      * @see 
org.apache.fulcrum.resourcemanager.ResourceManagerService#read(java.lang.String,
 java.lang.String[], java.lang.String)
      */
     public byte [] read(String domain, String[] context, String resourceName)
@@ -253,7 +253,7 @@ public class ResourceManagerServiceImpl
         return resourceManager.read( context, resourceName );
     }
 
-    /**
+    /* (non-Javadoc)
      * @see 
org.apache.fulcrum.resourcemanager.ResourceManagerService#locate(java.lang.String,
 java.lang.String[], java.lang.String)
      */
     public String locate(String domain, String[] context, String resourceName)
@@ -269,7 +269,7 @@ public class ResourceManagerServiceImpl
     /**
      * @return Returns the domainList.
      */
-    protected Hashtable getDomainList()
+    protected Hashtable<String, ResourceManager> getDomainList()
     {
         return domainList;
     }

Modified: turbine/fulcrum/trunk/resourcemanager/src/test/TestRoleConfig.xml
URL: 
http://svn.apache.org/viewvc/turbine/fulcrum/trunk/resourcemanager/src/test/TestRoleConfig.xml?rev=1845926&r1=1845925&r2=1845926&view=diff
==============================================================================
--- turbine/fulcrum/trunk/resourcemanager/src/test/TestRoleConfig.xml (original)
+++ turbine/fulcrum/trunk/resourcemanager/src/test/TestRoleConfig.xml Tue Nov  
6 14:37:50 2018
@@ -19,14 +19,14 @@
 -->
 
 <role-list>
-   <role
-     name="org.apache.fulcrum.pbe.PBEService"
-     shorthand="PBEService"
-     default-class="org.apache.fulcrum.pbe.PBEServiceImpl"
-     early-init="true"
-     component-type="merlin"
-     description="Provides Password Based Encyrption using JCA/JCE"
-   />
+  <role
+    name="org.apache.fulcrum.pbe.PBEService"
+    shorthand="PBEService"
+    default-class="org.apache.fulcrum.pbe.PBEServiceImpl"
+    early-init="true"
+    component-type="merlin"
+    description="Provides Password Based Encyrption using JCA/JCE"
+  />
   <role
     name="org.apache.fulcrum.resourcemanager.ResourceManagerService"
     
default-class="org.apache.fulcrum.resourcemanager.impl.ResourceManagerServiceImpl"

Modified: 
turbine/fulcrum/trunk/resourcemanager/src/test/org/apache/fulcrum/resourcemanager/ResourceManagerServiceTest.java
URL: 
http://svn.apache.org/viewvc/turbine/fulcrum/trunk/resourcemanager/src/test/org/apache/fulcrum/resourcemanager/ResourceManagerServiceTest.java?rev=1845926&r1=1845925&r2=1845926&view=diff
==============================================================================
--- 
turbine/fulcrum/trunk/resourcemanager/src/test/org/apache/fulcrum/resourcemanager/ResourceManagerServiceTest.java
 (original)
+++ 
turbine/fulcrum/trunk/resourcemanager/src/test/org/apache/fulcrum/resourcemanager/ResourceManagerServiceTest.java
 Tue Nov  6 14:37:50 2018
@@ -46,6 +46,9 @@ public class ResourceManagerServiceTest
         super(name);
     }
 
+    /* (non-Javadoc)
+     * @see junit.framework.TestCase#setUp()
+     */
     protected void setUp() throws Exception
     {
         super.setUp();
@@ -57,6 +60,7 @@ public class ResourceManagerServiceTest
 
     /**
      * Test basic CRUD for the domain "script"
+     * @throws Exception generic exception
      */
     public void testResourceCRUD() throws Exception
     {
@@ -105,6 +109,7 @@ public class ResourceManagerServiceTest
 
     /**
      * Test getting a list of domains
+     * @throws Exception generic exception
      */
     public void testListDomains() throws Exception
     {
@@ -122,6 +127,7 @@ public class ResourceManagerServiceTest
 
     /**
      * Test the locator
+     * @throws Exception generic exception
      */
     public void testLocator() throws Exception
     {
@@ -199,6 +205,7 @@ public class ResourceManagerServiceTest
 
     /**
      * Try to access an unknown domain
+     * @throws Exception generic exception
      */
     public void testUnknownDomain() throws Exception
     {
@@ -218,6 +225,7 @@ public class ResourceManagerServiceTest
 
     /**
      * Create a resource file using the various input data types
+     * @throws Exception generic exception
      */
     public void testCreateResources() throws Exception
     {
@@ -274,7 +282,7 @@ public class ResourceManagerServiceTest
 
     /**
      * Get the URL of the underlying resource.
-     * @throws Exception
+     * @throws Exception generic exception
      */
     public void testGetResourceURL() throws Exception
     {
@@ -293,6 +301,7 @@ public class ResourceManagerServiceTest
 
     /**
      * Create a resource file using the various input data types
+     * @throws Exception generic exception
      */
     public void testAutoDecrytpion() throws Exception
     {
@@ -325,6 +334,7 @@ public class ResourceManagerServiceTest
      * Use a proper limit and run the test in a seperate VM to find
      * instabilities. Don't use this in Maven since it blows up due
      * to the caching of the JUNIT reports and output onstdout.
+     * @throws Exception generic exception
      */
     public void _testLongRunningBehaviour() throws Exception
     {

Modified: turbine/fulcrum/trunk/resourcemanager/xdocs/changes.xml
URL: 
http://svn.apache.org/viewvc/turbine/fulcrum/trunk/resourcemanager/xdocs/changes.xml?rev=1845926&r1=1845925&r2=1845926&view=diff
==============================================================================
--- turbine/fulcrum/trunk/resourcemanager/xdocs/changes.xml (original)
+++ turbine/fulcrum/trunk/resourcemanager/xdocs/changes.xml Tue Nov  6 14:37:50 
2018
@@ -24,6 +24,11 @@
   </properties>
 
   <body>
+    <release version="1.0.2" date="in SVN">
+      <action dev="painter" type="update">
+        JavaDoc update, use commons-lang3
+      </action>
+    </release>  
     <release version="1.0.1" date="2011-09-20">
         <action dev="sgoeschl" type="update">
           Cleaned up the code.


Reply via email to