You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@avalon.apache.org by mc...@apache.org on 2003/05/26 19:51:52 UTC
cvs commit: avalon-sandbox/merlin/assembly/src/java/org/apache/avalon/assembly/repository/impl FileRepository.java
mcconnell 2003/05/26 10:51:52
Modified: merlin/assembly/src/java/org/apache/avalon/assembly/engine/impl
EngineConfigurationHelper.java
merlin/assembly/src/java/org/apache/avalon/assembly/repository/impl
FileRepository.java
Log:
Applied patch from David Bernard enabling jar files in the repository without a version identifier.
Revision Changes Path
1.2 +2 -2 avalon-sandbox/merlin/assembly/src/java/org/apache/avalon/assembly/engine/impl/EngineConfigurationHelper.java
Index: EngineConfigurationHelper.java
===================================================================
RCS file: /home/cvs/avalon-sandbox/merlin/assembly/src/java/org/apache/avalon/assembly/engine/impl/EngineConfigurationHelper.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- EngineConfigurationHelper.java 29 Apr 2003 14:24:37 -0000 1.1
+++ EngineConfigurationHelper.java 26 May 2003 17:51:52 -0000 1.2
@@ -109,7 +109,7 @@
{
Configuration resource = resources[i];
String id = resource.getAttribute( "id" );
- String version = resource.getAttribute( "version" );
+ String version = resource.getAttribute( "version", null );
res.add( new ResourceDescriptor( id, version ) );
}
ResourceDescriptor[] descriptors =
1.4 +14 -2 avalon-sandbox/merlin/assembly/src/java/org/apache/avalon/assembly/repository/impl/FileRepository.java
Index: FileRepository.java
===================================================================
RCS file: /home/cvs/avalon-sandbox/merlin/assembly/src/java/org/apache/avalon/assembly/repository/impl/FileRepository.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- FileRepository.java 1 May 2003 10:45:23 -0000 1.3
+++ FileRepository.java 26 May 2003 17:51:52 -0000 1.4
@@ -75,6 +75,7 @@
* an underlying file system.
*
* @author <a href="mailto:mcconnell@osm.net">Stephen McConnell</a>
+ * @author <a href="mailto:dwayne@java-fan.com">David Bernard</a>
* @version $Revision$ $Date$
*/
public class FileRepository implements Repository, Contextualizable
@@ -213,7 +214,18 @@
throw new RepositoryException( error );
}
- File resource = new File( types, name + "-" + version + "." + type );
+ //
+ // we only append the version identifier if the version
+ // value is not null and at least more than 0 characters
+ //
+
+ String resourceName = name;
+ if( ( version != null ) && ( version.length() != 0 ) )
+ {
+ resourceName = resourceName + "-" + version;
+ }
+ File resource = new File( types, resourceName + "." + type );
+
if( !resource.exists() )
{
final String error =
---------------------------------------------------------------------
To unsubscribe, e-mail: cvs-unsubscribe@avalon.apache.org
For additional commands, e-mail: cvs-help@avalon.apache.org