notify-dpml AT lists.ibiblio.org
Subject: DPML Notify
List archive
svn commit: r1969 - development/main/magic/core/src/main/net/dpml/magic/model
- From: mcconnell AT dpml.net
- To: notify-dpml AT lists.ibiblio.org
- Subject: svn commit: r1969 - development/main/magic/core/src/main/net/dpml/magic/model
- Date: Mon, 07 Mar 2005 17:52:59 -0500
Author: mcconnell AT dpml.net
Date: Mon Mar 7 17:52:59 2005
New Revision: 1969
Modified:
development/main/magic/core/src/main/net/dpml/magic/model/Resource.java
Log:
Update the generation of path objects to use artifact uris instead of local
files. This change will impact the codesource associated with all clases in
magic claspaths which is projected to be a requirement for component model
serialization.
Modified:
development/main/magic/core/src/main/net/dpml/magic/model/Resource.java
==============================================================================
--- development/main/magic/core/src/main/net/dpml/magic/model/Resource.java
(original)
+++ development/main/magic/core/src/main/net/dpml/magic/model/Resource.java
Mon Mar 7 17:52:59 2005
@@ -30,6 +30,7 @@
import java.io.File;
import java.net.URL;
+import java.net.URI;
import java.util.ArrayList;
import java.util.List;
@@ -267,8 +268,10 @@
String type = types[j];
if( !"theme".equals( type ) )
{
- final File file = resource.getArtifact(
project, type );
- path.createPathElement().setLocation( file );
+ //final File file = resource.getArtifact(
project, type );
+ //path.createPathElement().setLocation( file
);
+ final URI uri = resource.getArtifactURI(
type );
+ path.createPathElement().setPath(
uri.toString() );
}
}
}
@@ -402,6 +405,27 @@
}
}
+ private URI getArtifactURI( String type ) throws BuildException
+ {
+ final String path = getInfo().getURI( type );
+ try
+ {
+ return new URI( path );
+ }
+ catch( BuildException e )
+ {
+ throw e;
+ }
+ catch( Throwable e )
+ {
+ final String error =
+ "Unable to resolve artifact uri for the resource: "
+ + this;
+ throw new BuildException( error, e );
+ }
+ }
+
+
public String getFilename()
{
return getFilename( getInfo().getType() );
- svn commit: r1969 - development/main/magic/core/src/main/net/dpml/magic/model, mcconnell, 03/07/2005
Archive powered by MHonArc 2.6.24.