You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by se...@apache.org on 2011/02/26 03:34:44 UTC

svn commit: r1074781 - /commons/proper/net/trunk/src/main/java/org/apache/commons/net/ftp/parser/DefaultFTPFileEntryParserFactory.java

Author: sebb
Date: Sat Feb 26 02:34:44 2011
New Revision: 1074781

URL: http://svn.apache.org/viewvc?rev=1074781&view=rev
Log:
NET-360 Don't allow default package otherwise UNIX, VMS, etc are treated as potential class names

Modified:
    commons/proper/net/trunk/src/main/java/org/apache/commons/net/ftp/parser/DefaultFTPFileEntryParserFactory.java

Modified: commons/proper/net/trunk/src/main/java/org/apache/commons/net/ftp/parser/DefaultFTPFileEntryParserFactory.java
URL: http://svn.apache.org/viewvc/commons/proper/net/trunk/src/main/java/org/apache/commons/net/ftp/parser/DefaultFTPFileEntryParserFactory.java?rev=1074781&r1=1074780&r2=1074781&view=diff
==============================================================================
--- commons/proper/net/trunk/src/main/java/org/apache/commons/net/ftp/parser/DefaultFTPFileEntryParserFactory.java (original)
+++ commons/proper/net/trunk/src/main/java/org/apache/commons/net/ftp/parser/DefaultFTPFileEntryParserFactory.java Sat Feb 26 02:34:44 2011
@@ -40,8 +40,8 @@ public class DefaultFTPFileEntryParserFa
 
     // Match a plain Java Identifier
     private static final String JAVA_IDENTIFIER = "\\p{javaJavaIdentifierStart}(\\p{javaJavaIdentifierPart})*";
-    // Match a qualified name, e.g. a.b.c.Name
-    private static final String JAVA_QUALIFIED_NAME  = "("+JAVA_IDENTIFIER+"\\.)*"+JAVA_IDENTIFIER;
+    // Match a qualified name, e.g. a.b.c.Name - but don't allow the default package as that would allow "VMS"/"UNIX" etc.
+    private static final String JAVA_QUALIFIED_NAME  = "("+JAVA_IDENTIFIER+"\\.)+"+JAVA_IDENTIFIER;
     // Create the pattern, as it will be reused many times
     private static final Pattern JAVA_QUALIFIED_NAME_PATTERN = Pattern.compile(JAVA_QUALIFIED_NAME);
 
@@ -49,7 +49,7 @@ public class DefaultFTPFileEntryParserFa
      * This default implementation of the FTPFileEntryParserFactory
      * interface works according to the following logic:
      * First it attempts to interpret the supplied key as a fully
-     * qualified classname of a class implementing the
+     * qualified classname (default package is not allowed) of a class implementing the
      * FTPFileEntryParser interface.  If that succeeds, a parser
      * object of this class is instantiated and is returned;
      * otherwise it attempts to interpret the key as an identirier
@@ -75,9 +75,11 @@ public class DefaultFTPFileEntryParserFa
      *               <li>{@link FTPClientConfig#SYST_NT WINDOWS}</li>
      *               <li>{@link FTPClientConfig#SYST_OS2 OS/2}</li>
      *               <li>{@link FTPClientConfig#SYST_OS400 OS/400}</li>
+     *               <li>{@link FTPClientConfig#SYST_AS400 AS/400}</li>
      *               <li>{@link FTPClientConfig#SYST_VMS VMS}</li>
      *               <li>{@link FTPClientConfig#SYST_MVS MVS}</li>
      *               <li>{@link FTPClientConfig#SYST_NETWARE NETWARE}</li>
+     *               <li>{@link FTPClientConfig#SYST_L8 TYPE:L8}</li>
      *               </ul>
      * @return the FTPFileEntryParser corresponding to the supplied key.
      * @throws ParserInitializationException thrown if for any reason the factory cannot resolve