git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@270808 13f79535-47bb-0310-9956-ffa450edef68master
| @@ -15,6 +15,7 @@ import org.apache.myrmidon.api.TaskException; | |||||
| import org.apache.tools.ant.types.Commandline; | import org.apache.tools.ant.types.Commandline; | ||||
| import org.apache.tools.ant.types.Path; | import org.apache.tools.ant.types.Path; | ||||
| import org.apache.tools.ant.types.SysProperties; | import org.apache.tools.ant.types.SysProperties; | ||||
| import org.apache.tools.ant.types.PathUtil; | |||||
| /* | /* | ||||
| * @author thomas.haas@softwired-inc.com | * @author thomas.haas@softwired-inc.com | ||||
| @@ -63,7 +64,7 @@ public class ExecuteJava | |||||
| } | } | ||||
| else | else | ||||
| { | { | ||||
| final URL[] urls = m_classpath.toURLs(); | |||||
| final URL[] urls = PathUtil.toURLs( m_classpath ); | |||||
| final URLClassLoader classLoader = new URLClassLoader( urls ); | final URLClassLoader classLoader = new URLClassLoader( urls ); | ||||
| target = classLoader.loadClass( classname ); | target = classLoader.loadClass( classname ); | ||||
| } | } | ||||
| @@ -17,6 +17,7 @@ import java.util.Properties; | |||||
| import org.apache.myrmidon.api.TaskException; | import org.apache.myrmidon.api.TaskException; | ||||
| import org.apache.tools.ant.Task; | import org.apache.tools.ant.Task; | ||||
| import org.apache.tools.ant.types.Path; | import org.apache.tools.ant.types.Path; | ||||
| import org.apache.tools.ant.types.PathUtil; | |||||
| /** | /** | ||||
| * Will set a Project property. Used to be a hack in ProjectHelper Will not | * Will set a Project property. Used to be a hack in ProjectHelper Will not | ||||
| @@ -128,7 +129,7 @@ public class Property | |||||
| if( m_classpath != null ) | if( m_classpath != null ) | ||||
| { | { | ||||
| final URL[] urls = m_classpath.toURLs(); | |||||
| final URL[] urls = PathUtil.toURLs( m_classpath ); | |||||
| classLoader = new URLClassLoader( urls ); | classLoader = new URLClassLoader( urls ); | ||||
| } | } | ||||
| else | else | ||||
| @@ -10,6 +10,7 @@ package org.apache.tools.ant.taskdefs; | |||||
| import java.io.File; | import java.io.File; | ||||
| import java.io.IOException; | import java.io.IOException; | ||||
| import java.net.URLClassLoader; | import java.net.URLClassLoader; | ||||
| import java.net.URL; | |||||
| import java.rmi.Remote; | import java.rmi.Remote; | ||||
| import java.util.ArrayList; | import java.util.ArrayList; | ||||
| import org.apache.avalon.excalibur.io.FileUtil; | import org.apache.avalon.excalibur.io.FileUtil; | ||||
| @@ -20,6 +21,7 @@ import org.apache.tools.ant.taskdefs.rmic.RmicAdapterFactory; | |||||
| import org.apache.tools.ant.types.Path; | import org.apache.tools.ant.types.Path; | ||||
| import org.apache.tools.ant.util.mappers.FileNameMapper; | import org.apache.tools.ant.util.mappers.FileNameMapper; | ||||
| import org.apache.tools.ant.types.SourceFileScanner; | import org.apache.tools.ant.types.SourceFileScanner; | ||||
| import org.apache.tools.ant.types.PathUtil; | |||||
| /** | /** | ||||
| * Task to compile RMI stubs and skeletons. This task can take the following | * Task to compile RMI stubs and skeletons. This task can take the following | ||||
| @@ -484,7 +486,8 @@ public class Rmic extends MatchingTask | |||||
| adapter.setRmic( this ); | adapter.setRmic( this ); | ||||
| Path classpath = adapter.getClasspath(); | Path classpath = adapter.getClasspath(); | ||||
| loader = new URLClassLoader( classpath.toURLs() ); | |||||
| final URL[] urls = PathUtil.toURLs( classpath ); | |||||
| loader = new URLClassLoader( urls ); | |||||
| // scan base dirs to build up compile lists only if a | // scan base dirs to build up compile lists only if a | ||||
| // specific classname is not given | // specific classname is not given | ||||
| @@ -19,6 +19,7 @@ import java.io.PrintStream; | |||||
| import java.io.Reader; | import java.io.Reader; | ||||
| import java.io.StringReader; | import java.io.StringReader; | ||||
| import java.net.URLClassLoader; | import java.net.URLClassLoader; | ||||
| import java.net.URL; | |||||
| import java.sql.Connection; | import java.sql.Connection; | ||||
| import java.sql.DatabaseMetaData; | import java.sql.DatabaseMetaData; | ||||
| import java.sql.Driver; | import java.sql.Driver; | ||||
| @@ -37,6 +38,7 @@ import org.apache.tools.ant.Task; | |||||
| import org.apache.tools.ant.types.EnumeratedAttribute; | import org.apache.tools.ant.types.EnumeratedAttribute; | ||||
| import org.apache.tools.ant.types.FileSet; | import org.apache.tools.ant.types.FileSet; | ||||
| import org.apache.tools.ant.types.Path; | import org.apache.tools.ant.types.Path; | ||||
| import org.apache.tools.ant.types.PathUtil; | |||||
| /** | /** | ||||
| * Reads in a text file containing SQL statements seperated with semicolons and | * Reads in a text file containing SQL statements seperated with semicolons and | ||||
| @@ -428,7 +430,8 @@ public class SQLExec | |||||
| { | { | ||||
| getLogger().debug( "Loading " + driver + " using AntClassLoader with classpath " + classpath ); | getLogger().debug( "Loading " + driver + " using AntClassLoader with classpath " + classpath ); | ||||
| final ClassLoader classLoader = new URLClassLoader( classpath.toURLs() ); | |||||
| final URL[] urls = PathUtil.toURLs( classpath ); | |||||
| final ClassLoader classLoader = new URLClassLoader( urls ); | |||||
| dc = classLoader.loadClass( driver ); | dc = classLoader.loadClass( driver ); | ||||
| } | } | ||||
| else | else | ||||
| @@ -12,6 +12,7 @@ import java.net.URLClassLoader; | |||||
| import org.apache.myrmidon.api.TaskException; | import org.apache.myrmidon.api.TaskException; | ||||
| import org.apache.tools.ant.ProjectComponent; | import org.apache.tools.ant.ProjectComponent; | ||||
| import org.apache.tools.ant.types.Path; | import org.apache.tools.ant.types.Path; | ||||
| import org.apache.tools.ant.types.PathUtil; | |||||
| /** | /** | ||||
| * Element to define a FileNameMapper. | * Element to define a FileNameMapper. | ||||
| @@ -113,7 +114,7 @@ public class Mapper | |||||
| } | } | ||||
| else | else | ||||
| { | { | ||||
| final URL[] urls = m_classpath.toURLs(); | |||||
| final URL[] urls = PathUtil.toURLs( m_classpath ); | |||||
| final URLClassLoader classLoader = new URLClassLoader( urls ); | final URLClassLoader classLoader = new URLClassLoader( urls ); | ||||
| c = classLoader.loadClass( m_classname ); | c = classLoader.loadClass( m_classname ); | ||||
| } | } | ||||
| @@ -15,6 +15,7 @@ import org.apache.myrmidon.api.TaskException; | |||||
| import org.apache.tools.ant.types.Commandline; | import org.apache.tools.ant.types.Commandline; | ||||
| import org.apache.tools.ant.types.Path; | import org.apache.tools.ant.types.Path; | ||||
| import org.apache.tools.ant.types.SysProperties; | import org.apache.tools.ant.types.SysProperties; | ||||
| import org.apache.tools.ant.types.PathUtil; | |||||
| /* | /* | ||||
| * @author thomas.haas@softwired-inc.com | * @author thomas.haas@softwired-inc.com | ||||
| @@ -63,7 +64,7 @@ public class ExecuteJava | |||||
| } | } | ||||
| else | else | ||||
| { | { | ||||
| final URL[] urls = m_classpath.toURLs(); | |||||
| final URL[] urls = PathUtil.toURLs( m_classpath ); | |||||
| final URLClassLoader classLoader = new URLClassLoader( urls ); | final URLClassLoader classLoader = new URLClassLoader( urls ); | ||||
| target = classLoader.loadClass( classname ); | target = classLoader.loadClass( classname ); | ||||
| } | } | ||||
| @@ -17,6 +17,7 @@ import java.util.Properties; | |||||
| import org.apache.myrmidon.api.TaskException; | import org.apache.myrmidon.api.TaskException; | ||||
| import org.apache.tools.ant.Task; | import org.apache.tools.ant.Task; | ||||
| import org.apache.tools.ant.types.Path; | import org.apache.tools.ant.types.Path; | ||||
| import org.apache.tools.ant.types.PathUtil; | |||||
| /** | /** | ||||
| * Will set a Project property. Used to be a hack in ProjectHelper Will not | * Will set a Project property. Used to be a hack in ProjectHelper Will not | ||||
| @@ -128,7 +129,7 @@ public class Property | |||||
| if( m_classpath != null ) | if( m_classpath != null ) | ||||
| { | { | ||||
| final URL[] urls = m_classpath.toURLs(); | |||||
| final URL[] urls = PathUtil.toURLs( m_classpath ); | |||||
| classLoader = new URLClassLoader( urls ); | classLoader = new URLClassLoader( urls ); | ||||
| } | } | ||||
| else | else | ||||
| @@ -10,6 +10,7 @@ package org.apache.tools.ant.taskdefs; | |||||
| import java.io.File; | import java.io.File; | ||||
| import java.io.IOException; | import java.io.IOException; | ||||
| import java.net.URLClassLoader; | import java.net.URLClassLoader; | ||||
| import java.net.URL; | |||||
| import java.rmi.Remote; | import java.rmi.Remote; | ||||
| import java.util.ArrayList; | import java.util.ArrayList; | ||||
| import org.apache.avalon.excalibur.io.FileUtil; | import org.apache.avalon.excalibur.io.FileUtil; | ||||
| @@ -20,6 +21,7 @@ import org.apache.tools.ant.taskdefs.rmic.RmicAdapterFactory; | |||||
| import org.apache.tools.ant.types.Path; | import org.apache.tools.ant.types.Path; | ||||
| import org.apache.tools.ant.util.mappers.FileNameMapper; | import org.apache.tools.ant.util.mappers.FileNameMapper; | ||||
| import org.apache.tools.ant.types.SourceFileScanner; | import org.apache.tools.ant.types.SourceFileScanner; | ||||
| import org.apache.tools.ant.types.PathUtil; | |||||
| /** | /** | ||||
| * Task to compile RMI stubs and skeletons. This task can take the following | * Task to compile RMI stubs and skeletons. This task can take the following | ||||
| @@ -484,7 +486,8 @@ public class Rmic extends MatchingTask | |||||
| adapter.setRmic( this ); | adapter.setRmic( this ); | ||||
| Path classpath = adapter.getClasspath(); | Path classpath = adapter.getClasspath(); | ||||
| loader = new URLClassLoader( classpath.toURLs() ); | |||||
| final URL[] urls = PathUtil.toURLs( classpath ); | |||||
| loader = new URLClassLoader( urls ); | |||||
| // scan base dirs to build up compile lists only if a | // scan base dirs to build up compile lists only if a | ||||
| // specific classname is not given | // specific classname is not given | ||||
| @@ -19,6 +19,7 @@ import java.io.PrintStream; | |||||
| import java.io.Reader; | import java.io.Reader; | ||||
| import java.io.StringReader; | import java.io.StringReader; | ||||
| import java.net.URLClassLoader; | import java.net.URLClassLoader; | ||||
| import java.net.URL; | |||||
| import java.sql.Connection; | import java.sql.Connection; | ||||
| import java.sql.DatabaseMetaData; | import java.sql.DatabaseMetaData; | ||||
| import java.sql.Driver; | import java.sql.Driver; | ||||
| @@ -37,6 +38,7 @@ import org.apache.tools.ant.Task; | |||||
| import org.apache.tools.ant.types.EnumeratedAttribute; | import org.apache.tools.ant.types.EnumeratedAttribute; | ||||
| import org.apache.tools.ant.types.FileSet; | import org.apache.tools.ant.types.FileSet; | ||||
| import org.apache.tools.ant.types.Path; | import org.apache.tools.ant.types.Path; | ||||
| import org.apache.tools.ant.types.PathUtil; | |||||
| /** | /** | ||||
| * Reads in a text file containing SQL statements seperated with semicolons and | * Reads in a text file containing SQL statements seperated with semicolons and | ||||
| @@ -428,7 +430,8 @@ public class SQLExec | |||||
| { | { | ||||
| getLogger().debug( "Loading " + driver + " using AntClassLoader with classpath " + classpath ); | getLogger().debug( "Loading " + driver + " using AntClassLoader with classpath " + classpath ); | ||||
| final ClassLoader classLoader = new URLClassLoader( classpath.toURLs() ); | |||||
| final URL[] urls = PathUtil.toURLs( classpath ); | |||||
| final ClassLoader classLoader = new URLClassLoader( urls ); | |||||
| dc = classLoader.loadClass( driver ); | dc = classLoader.loadClass( driver ); | ||||
| } | } | ||||
| else | else | ||||
| @@ -12,6 +12,7 @@ import java.net.URLClassLoader; | |||||
| import org.apache.myrmidon.api.TaskException; | import org.apache.myrmidon.api.TaskException; | ||||
| import org.apache.tools.ant.ProjectComponent; | import org.apache.tools.ant.ProjectComponent; | ||||
| import org.apache.tools.ant.types.Path; | import org.apache.tools.ant.types.Path; | ||||
| import org.apache.tools.ant.types.PathUtil; | |||||
| /** | /** | ||||
| * Element to define a FileNameMapper. | * Element to define a FileNameMapper. | ||||
| @@ -113,7 +114,7 @@ public class Mapper | |||||
| } | } | ||||
| else | else | ||||
| { | { | ||||
| final URL[] urls = m_classpath.toURLs(); | |||||
| final URL[] urls = PathUtil.toURLs( m_classpath ); | |||||
| final URLClassLoader classLoader = new URLClassLoader( urls ); | final URLClassLoader classLoader = new URLClassLoader( urls ); | ||||
| c = classLoader.loadClass( m_classname ); | c = classLoader.loadClass( m_classname ); | ||||
| } | } | ||||