You are viewing a plain text version of this content. The canonical link for it is here.
Posted to ivy-commits@incubator.apache.org by xa...@apache.org on 2007/10/29 11:04:21 UTC

svn commit: r589579 - /incubator/ivy/core/trunk/src/java/org/apache/ivy/Main.java

Author: xavier
Date: Mon Oct 29 04:04:19 2007
New Revision: 589579

URL: http://svn.apache.org/viewvc?rev=589579&view=rev
Log:
improve getExtraClasspathFileList (IVY-543)

Modified:
    incubator/ivy/core/trunk/src/java/org/apache/ivy/Main.java

Modified: incubator/ivy/core/trunk/src/java/org/apache/ivy/Main.java
URL: http://svn.apache.org/viewvc/incubator/ivy/core/trunk/src/java/org/apache/ivy/Main.java?rev=589579&r1=589578&r2=589579&view=diff
==============================================================================
--- incubator/ivy/core/trunk/src/java/org/apache/ivy/Main.java (original)
+++ incubator/ivy/core/trunk/src/java/org/apache/ivy/Main.java Mon Oct 29 04:04:19 2007
@@ -296,10 +296,21 @@
         }
     }
 
-    private static List getExtraClasspathFileList(CommandLine line) {
+    /**
+     * Parses the <code>cp</code> option from the command line, and returns a list of {@link File}.
+     * <p>
+     * All the files contained in the returned List exist, non existing files are simply skipped
+     * with a warning.
+     * 
+     * @param line
+     *            the command line in which the cp option shold be parsed
+     * @return a List of files to include as extra classpath entries, or <code>null</code> if no
+     *         cp option was provided.
+     */
+    private static List/*<File>*/ getExtraClasspathFileList(CommandLine line) {
         List fileList = null;
         if (line.hasOption("cp")) {
-            fileList = new ArrayList();
+            fileList = new ArrayList/*<File>*/();
             String[] cpArray = line.getOptionValues("cp");
             for (int index = 0; index < cpArray.length; index++) {
                 StringTokenizer tokenizer = new StringTokenizer(cpArray[index], 
@@ -310,7 +321,8 @@
                     if (file.exists()) {
                         fileList.add(file);
                     } else {
-                        Message.warn("The extra classpath '" + file + "' does not exist.");
+                        Message.warn(
+                            "Skipping extra classpath '" + file + "' as it does not exist.");
                     }
                 }
             }