Skip to Content.
Sympa Menu

notify-dpml - svn commit: r2096 - in development/main: magic/core/src/main/net/dpml/magic/model magic/core/src/main/net/dpml/magic/tasks transit/core/handler/src/main/net/dpml/transit/artifact

notify-dpml AT lists.ibiblio.org

Subject: DPML Notify

List archive

Chronological Thread  
  • From: mcconnell AT dpml.net
  • To: notify-dpml AT lists.ibiblio.org
  • Subject: svn commit: r2096 - in development/main: magic/core/src/main/net/dpml/magic/model magic/core/src/main/net/dpml/magic/tasks transit/core/handler/src/main/net/dpml/transit/artifact
  • Date: Sun, 20 Mar 2005 18:02:23 -0500

Author: mcconnell AT dpml.net
Date: Sun Mar 20 18:02:23 2005
New Revision: 2096

Modified:
development/main/magic/core/src/main/net/dpml/magic/model/Resource.java
development/main/magic/core/src/main/net/dpml/magic/tasks/FeatureTask.java

development/main/transit/core/handler/src/main/net/dpml/transit/artifact/Handler.java
Log:
Update the Handler class to be non-final so that the IDE plugins can extend
from it and include a couple of magic updates.

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
Sun Mar 20 18:02:23 2005
@@ -224,7 +224,7 @@

/**
* Returns a path of artifact filenames relative to the supplied scope.
- * The mode may be one of ANY, BUILD, TEST or RUNTIME.
+ * The mode may be one of Policy.ANY, Policy.BUILD, Policy.TEST or
Policy.RUNTIME.
*/
public Path getPath( final Project project, final int mode )
{
@@ -235,7 +235,7 @@
* Returns a path of artifact filenames relative to the supplied scope.
* The mode may be one of ANY, BUILD, TEST or RUNTIME.
* @param project the current project
- * @param mode one of ANY, BUILD, TEST or RUNTIME
+ * @param mode one of Policy.ANY, Policy.BUILD, Policy.TEST or
Policy.RUNTIME
* @param filter a value of "*" for any or a type identifier such as "jar"
* @exception NullArgumentException if the supplied project argument is
null.
*/

Modified:
development/main/magic/core/src/main/net/dpml/magic/tasks/FeatureTask.java
==============================================================================
---
development/main/magic/core/src/main/net/dpml/magic/tasks/FeatureTask.java
(original)
+++
development/main/magic/core/src/main/net/dpml/magic/tasks/FeatureTask.java
Sun Mar 20 18:02:23 2005
@@ -42,6 +42,7 @@
private String m_prefix;
private boolean m_windows = true;
private boolean m_flag = false; // os not set
+ private String m_type; // optional - used to select type when resolving
uris

public void setKey( final String key )
{
@@ -71,6 +72,11 @@
}
}

+ public void setType( final String type )
+ {
+ m_type = type;
+ }
+
protected String getFeature()
{
return m_feature;
@@ -116,7 +122,14 @@
}
else if( m_feature.equals( "uri" ) )
{
- return resource.getInfo().getURI();
+ if( null == m_type )
+ {
+ return resource.getInfo().getURI();
+ }
+ else
+ {
+ return resource.getInfo().getURI( m_type );
+ }
}
else if( m_feature.equals( "plugin" ) )
{

Modified:
development/main/transit/core/handler/src/main/net/dpml/transit/artifact/Handler.java
==============================================================================
---
development/main/transit/core/handler/src/main/net/dpml/transit/artifact/Handler.java
(original)
+++
development/main/transit/core/handler/src/main/net/dpml/transit/artifact/Handler.java
Sun Mar 20 18:02:23 2005
@@ -23,6 +23,8 @@
import java.net.URL;
import java.net.URLConnection;
import java.net.URLStreamHandler;
+import java.security.AccessController;
+import java.security.PrivilegedAction;

import net.dpml.transit.Transit;
import net.dpml.transit.TransitException;
@@ -30,7 +32,7 @@
/**
* Repository artifact: URL protocol handler.
*/
-public final class Handler extends URLStreamHandler
+public class Handler extends URLStreamHandler
{
//
------------------------------------------------------------------------
// static
@@ -190,12 +192,12 @@
* @param start the starting position
* @param limit the limit
*/
- protected void parseURL( URL dest, String spec, int start, int limit )
+ protected void parseURL( final URL dest, String spec, int start, int
limit )
{
try
{
// Niclas: Improve the parsing algorithm and have some more
checks.
- String protocol = dest.getProtocol();
+ final String protocol = dest.getProtocol();

String specPath = spec.substring( start, limit );
String path = dest.getPath();
@@ -241,14 +243,23 @@
}
}

- String user = version;
- String authority = null;
- int port = -1;
- String host = null;
- String query = null;
- String ref = null;
-
- setURL( dest, protocol, host, port, authority, user, path,
query, ref );
+ final String user = version;
+ final String authority = null;
+ final int port = -1;
+ final String host = null;
+ final String query = null;
+ final String ref = null;
+ final String finalPath = path;
+
+ AccessController.doPrivileged( new PrivilegedAction()
+ {
+ public Object run()
+ {
+ setURL( dest, protocol, host, port,
authority, user, finalPath, query, ref );
+ return null;
+ }
+ });
+

}
catch( Throwable e )



  • svn commit: r2096 - in development/main: magic/core/src/main/net/dpml/magic/model magic/core/src/main/net/dpml/magic/tasks transit/core/handler/src/main/net/dpml/transit/artifact, mcconnell, 03/20/2005

Archive powered by MHonArc 2.6.24.

Top of Page