notify-dpml AT lists.ibiblio.org
Subject: DPML Notify
List archive
r1387 - in trunk/main: depot/tools/builder/src/main/net/dpml/tools/tasks station/builder transit/core/src/main/net/dpml/transit/link
- From: mcconnell at BerliOS <mcconnell AT mail.berlios.de>
- To: notify-dpml AT lists.ibiblio.org
- Subject: r1387 - in trunk/main: depot/tools/builder/src/main/net/dpml/tools/tasks station/builder transit/core/src/main/net/dpml/transit/link
- Date: Wed, 19 Apr 2006 12:37:16 +0200
Author: mcconnell
Date: 2006-04-19 12:37:10 +0200 (Wed, 19 Apr 2006)
New Revision: 1387
Removed:
trunk/main/station/builder/build.xml
Modified:
trunk/main/depot/tools/builder/src/main/net/dpml/tools/tasks/InstallTask.java
trunk/main/transit/core/src/main/net/dpml/transit/link/ArtifactLinkManager.java
Log:
housekeeping
Modified:
trunk/main/depot/tools/builder/src/main/net/dpml/tools/tasks/InstallTask.java
===================================================================
---
trunk/main/depot/tools/builder/src/main/net/dpml/tools/tasks/InstallTask.java
2006-04-19 07:28:35 UTC (rev 1386)
+++
trunk/main/depot/tools/builder/src/main/net/dpml/tools/tasks/InstallTask.java
2006-04-19 10:37:10 UTC (rev 1387)
@@ -23,12 +23,14 @@
import java.io.FileOutputStream;
import java.io.OutputStreamWriter;
import java.io.Writer;
+import java.net.URI;
import net.dpml.library.Module;
import net.dpml.library.Resource;
import net.dpml.library.Type;
import net.dpml.transit.Artifact;
+import net.dpml.transit.link.ArtifactLinkManager;
import org.apache.tools.ant.BuildException;
import org.apache.tools.ant.Project;
@@ -100,15 +102,30 @@
Artifact artifact = resource.getArtifact( type.getID() );
String uri = artifact.toURI().toASCIIString();
String link = resource.getName() + "." + name + ".link";
- log( link.toString() );
- log( uri.toString() );
File out = new File( group, link );
- out.createNewFile();
- final OutputStream output = new FileOutputStream( out );
- final Writer writer = new OutputStreamWriter( output );
- writer.write( uri );
- writer.close();
- output.close();
+
+ boolean flag = true;
+ if( out.exists() )
+ {
+ ArtifactLinkManager manager = new
ArtifactLinkManager();
+ URI enclosed = manager.getTargetURI( new URI(
out.toURL().toString() ) );
+ if( artifact.toURI().equals( enclosed ) )
+ {
+ flag = false;
+ }
+ }
+
+ if( flag )
+ {
+ log( link.toString() );
+ log( uri.toString() );
+ out.createNewFile();
+ final OutputStream output = new FileOutputStream(
out );
+ final Writer writer = new OutputStreamWriter( output
);
+ writer.write( uri );
+ writer.close();
+ output.close();
+ }
}
catch( Exception e )
{
Deleted: trunk/main/station/builder/build.xml
===================================================================
--- trunk/main/station/builder/build.xml 2006-04-19 07:28:35 UTC (rev
1386)
+++ trunk/main/station/builder/build.xml 2006-04-19 10:37:10 UTC (rev
1387)
@@ -1,16 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" ?>
-
-<project name="dpml-station-builder" default="install" basedir="."
- xmlns:transit="antlib:net.dpml.transit"
- xmlns:x="dpml:depot" >
-
- <transit:import uri="local:template:dpml/tools/standard"/>
-
- <target name="init" depends="standard.init">
- <x:filter token="COMMON-XSD-URI" ref="dpml/lang/dpml-common" type="xsd"
feature="uri" />
- <x:filter token="PART-XSD-URI" ref="dpml/lang/dpml-part" type="xsd"
feature="uri" />
- <x:filter token="COMPONENT-XSD-URI" ref="dpml/lang/dpml-component"
type="xsd" feature="uri" />
- <x:filter token="APPLICATION-XSD-URI" ref="dpml/lang/dpml-application"
type="xsd" feature="uri" />
- </target>
-
-</project>
Modified:
trunk/main/transit/core/src/main/net/dpml/transit/link/ArtifactLinkManager.java
===================================================================
---
trunk/main/transit/core/src/main/net/dpml/transit/link/ArtifactLinkManager.java
2006-04-19 07:28:35 UTC (rev 1386)
+++
trunk/main/transit/core/src/main/net/dpml/transit/link/ArtifactLinkManager.java
2006-04-19 10:37:10 UTC (rev 1387)
@@ -32,6 +32,7 @@
import java.security.PrivilegedActionException;
import java.security.PrivilegedExceptionAction;
+import net.dpml.transit.Artifact;
import net.dpml.transit.NullArgumentException;
import net.dpml.transit.artifact.ArtifactNotFoundException;
import net.dpml.util.PropertyResolver;
@@ -115,8 +116,17 @@
public Object run()
throws IOException
{
- String artifact = linkUri.toASCIIString();
- URL store = new URL( null, artifact, new
net.dpml.transit.artifact.Handler() );
+ URL store = null;
+ if( Artifact.isRecognized( linkUri ) )
+ {
+ String artifact = linkUri.toASCIIString();
+ store = new URL( null, artifact, new
net.dpml.transit.artifact.Handler() );
+ }
+ else
+ {
+ store = linkUri.toURL();
+ }
+
ByteArrayOutputStream out = new ByteArrayOutputStream();
InputStream in = store.openConnection().getInputStream();
StreamUtils.copyStream( in, out, true );
- r1387 - in trunk/main: depot/tools/builder/src/main/net/dpml/tools/tasks station/builder transit/core/src/main/net/dpml/transit/link, mcconnell at BerliOS, 04/19/2006
Archive powered by MHonArc 2.6.24.