notify-dpml AT lists.ibiblio.org
Subject: DPML Notify
List archive
r1774 - trunk/main/transit/tools/src/main/net/dpml/transit/tools
- From: mcconnell at BerliOS <mcconnell AT mail.berlios.de>
- To: notify-dpml AT lists.ibiblio.org
- Subject: r1774 - trunk/main/transit/tools/src/main/net/dpml/transit/tools
- Date: Mon, 9 Oct 2006 01:56:24 +0200
Author: mcconnell
Date: 2006-10-09 01:56:23 +0200 (Mon, 09 Oct 2006)
New Revision: 1774
Modified:
trunk/main/transit/tools/src/main/net/dpml/transit/tools/GetTask.java
Log:
Updates to the Transit get task to force a handler connection resulting in
forced downloading of the underlying resource.
Modified:
trunk/main/transit/tools/src/main/net/dpml/transit/tools/GetTask.java
===================================================================
--- trunk/main/transit/tools/src/main/net/dpml/transit/tools/GetTask.java
2006-10-08 23:55:14 UTC (rev 1773)
+++ trunk/main/transit/tools/src/main/net/dpml/transit/tools/GetTask.java
2006-10-08 23:56:23 UTC (rev 1774)
@@ -21,8 +21,9 @@
import java.io.File;
import java.net.URI;
import java.net.URL;
+import java.net.URLConnection;
-import net.dpml.transit.artifact.Handler;
+import net.dpml.transit.Artifact;
import org.apache.tools.ant.BuildException;
import org.apache.tools.ant.Project;
@@ -129,11 +130,15 @@
try
{
+ URI uri = getURI();
String spec = getURI().toString();
log( "artifact: " + spec );
- URL url = new URL( (URL) null, spec, new Handler() );
- File file = (File) url.getContent( new Class[]{File.class} );
- getProject().setNewProperty( name, file.getAbsolutePath() );
+ URL url = Artifact.toURL( uri );
+ URLConnection connection = url.openConnection();
+ connection.connect();
+ File file = (File) connection.getContent( new
Class[]{File.class} );
+ String path = file.getCanonicalPath();
+ getProject().setNewProperty( name, path );
}
catch( Throwable e )
{
- r1774 - trunk/main/transit/tools/src/main/net/dpml/transit/tools, mcconnell at BerliOS, 10/08/2006
Archive powered by MHonArc 2.6.24.