Author: rwinston
Date: Sun Aug 27 08:22:03 2006
New Revision: 437385

URL: http://svn.apache.org/viewvc?rev=437385&view=rev
Log:
Apply some JIRA patches to bleeding edge branch

Removed:
    jakarta/commons/proper/net/branches/JDK_1_5_BRANCH/maven.xml
Modified:
    jakarta/commons/proper/net/branches/JDK_1_5_BRANCH/README
    
jakarta/commons/proper/net/branches/JDK_1_5_BRANCH/src/main/java/org/apache/commons/net/SocketClient.java
    
jakarta/commons/proper/net/branches/JDK_1_5_BRANCH/src/main/java/org/apache/commons/net/ftp/FTPClient.java
    
jakarta/commons/proper/net/branches/JDK_1_5_BRANCH/src/main/java/org/apache/commons/net/ftp/parser/UnixFTPEntryParser.java
    
jakarta/commons/proper/net/branches/JDK_1_5_BRANCH/src/main/java/org/apache/commons/net/io/FromNetASCIIInputStream.java
    
jakarta/commons/proper/net/branches/JDK_1_5_BRANCH/src/test/java/org/apache/commons/net/ftp/parser/NTFTPEntryParserTest.java
    jakarta/commons/proper/net/branches/JDK_1_5_BRANCH/xdocs/changes.xml
    jakarta/commons/proper/net/branches/JDK_1_5_BRANCH/xdocs/index.xml

Modified: jakarta/commons/proper/net/branches/JDK_1_5_BRANCH/README
URL: 
http://svn.apache.org/viewvc/jakarta/commons/proper/net/branches/JDK_1_5_BRANCH/README?rev=437385&r1=437384&r2=437385&view=diff
==============================================================================
--- jakarta/commons/proper/net/branches/JDK_1_5_BRANCH/README (original)
+++ jakarta/commons/proper/net/branches/JDK_1_5_BRANCH/README Sun Aug 27 
08:22:03 2006
@@ -13,4 +13,4 @@
 
 You can build the documentation with:
 
-maven site
+mvn site

Modified: 
jakarta/commons/proper/net/branches/JDK_1_5_BRANCH/src/main/java/org/apache/commons/net/SocketClient.java
URL: 
http://svn.apache.org/viewvc/jakarta/commons/proper/net/branches/JDK_1_5_BRANCH/src/main/java/org/apache/commons/net/SocketClient.java?rev=437385&r1=437384&r2=437385&view=diff
==============================================================================
--- 
jakarta/commons/proper/net/branches/JDK_1_5_BRANCH/src/main/java/org/apache/commons/net/SocketClient.java
 (original)
+++ 
jakarta/commons/proper/net/branches/JDK_1_5_BRANCH/src/main/java/org/apache/commons/net/SocketClient.java
 Sun Aug 27 08:22:03 2006
@@ -263,10 +263,10 @@
      */
     public void disconnect() throws IOException
     {
-        _socket_.close();
-        _input_.close();
-        _output_.close();
-        _socket_ = null;
+        if (_socket_ != null) _socket_.close();
+        if (_input_ != null) _input_.close();
+        if (_output_ != null) _output_.close();
+        if (_socket_ != null) _socket_ = null;
         _input_ = null;
         _output_ = null;
         _isConnected_ = false;

Modified: 
jakarta/commons/proper/net/branches/JDK_1_5_BRANCH/src/main/java/org/apache/commons/net/ftp/FTPClient.java
URL: 
http://svn.apache.org/viewvc/jakarta/commons/proper/net/branches/JDK_1_5_BRANCH/src/main/java/org/apache/commons/net/ftp/FTPClient.java?rev=437385&r1=437384&r2=437385&view=diff
==============================================================================
--- 
jakarta/commons/proper/net/branches/JDK_1_5_BRANCH/src/main/java/org/apache/commons/net/ftp/FTPClient.java
 (original)
+++ 
jakarta/commons/proper/net/branches/JDK_1_5_BRANCH/src/main/java/org/apache/commons/net/ftp/FTPClient.java
 Sun Aug 27 08:22:03 2006
@@ -275,6 +275,7 @@
     private long __restartOffset;
     private FTPFileEntryParserFactory __parserFactory;
     private int __bufferSize;
+    private boolean __listHiddenFiles;
 
     // __systemName is a cached value that should not be referenced directly
     // except when assigned in getSystemName and __initDefaults.
@@ -302,6 +303,7 @@
         __remoteVerificationEnabled = true;
         __parserFactory = new DefaultFTPFileEntryParserFactory();
         __configuration      = null;
+        __listHiddenFiles = false;
     }
 
 
@@ -2390,7 +2392,8 @@
         Socket socket;
 
         FTPListParseEngine engine = new FTPListParseEngine(parser);
-        if ((socket = _openDataConnection_(FTPCommand.LIST, pathname)) == null)
+
+        if ((socket = _openDataConnection_(FTPCommand.LIST, 
getListArguments(pathname))) == null)
         {
             return engine;
         }
@@ -2404,7 +2407,20 @@
         return engine;
     }
 
-    /***
+    protected String getListArguments(String pathname) {
+       if (getListHiddenFiles())
+       {
+               StringBuffer sb = new StringBuffer(pathname.length() + 3);
+               sb.append("-a ");
+               sb.append(pathname);
+               return sb.toString();
+       }
+       
+       return pathname;
+       }
+
+
+       /***
      * Issue the FTP STAT command to the server.
      * <p>
      * @return The status information returned by the server.
@@ -2488,7 +2504,7 @@
         Socket socket;
         FTPFile[] results;
 
-        if ((socket = _openDataConnection_(FTPCommand.LIST, pathname)) == null)
+        if ((socket = _openDataConnection_(FTPCommand.LIST, 
getListArguments(pathname))) == null)
             return new FTPFile[0];
 
         results = parser.parseFileList(socket.getInputStream(), 
getControlEncoding());
@@ -2628,7 +2644,7 @@
     {
         Socket socket;
 
-        if ((socket = _openDataConnection_(FTPCommand.LIST, pathname)) == null)
+        if ((socket = _openDataConnection_(FTPCommand.LIST, 
getListArguments(pathname))) == null)
         {
             return null;
         }
@@ -2670,7 +2686,26 @@
     public void configure(FTPClientConfig config) {
        this.__configuration = config;
     }
-    
+
+    /**
+     * You can set this to true if you would like to get hidden files when 
[EMAIL PROTECTED] #listFiles} too.
+     * A <code>LIST -a</code> will be issued to the ftp server.
+     * It depends on your ftp server if you need to call this method, also 
dont expect to get rid
+     * of hidden files if you call this method with "false".
+     * 
+     * @param listHiddenFiles true if hidden files should be listed 
+     */
+    public void setListHiddenFiles(boolean listHiddenFiles) {
+       this.__listHiddenFiles = listHiddenFiles;
+    }
+
+    /**
+     * @see #setListHiddenFiles(boolean)
+     * @return the current state
+     */
+    public boolean getListHiddenFiles() {
+       return this.__listHiddenFiles;
+    }
 }
 
 /* Emacs configuration

Modified: 
jakarta/commons/proper/net/branches/JDK_1_5_BRANCH/src/main/java/org/apache/commons/net/ftp/parser/UnixFTPEntryParser.java
URL: 
http://svn.apache.org/viewvc/jakarta/commons/proper/net/branches/JDK_1_5_BRANCH/src/main/java/org/apache/commons/net/ftp/parser/UnixFTPEntryParser.java?rev=437385&r1=437384&r2=437385&view=diff
==============================================================================
--- 
jakarta/commons/proper/net/branches/JDK_1_5_BRANCH/src/main/java/org/apache/commons/net/ftp/parser/UnixFTPEntryParser.java
 (original)
+++ 
jakarta/commons/proper/net/branches/JDK_1_5_BRANCH/src/main/java/org/apache/commons/net/ftp/parser/UnixFTPEntryParser.java
 Sun Aug 27 08:22:03 2006
@@ -83,9 +83,10 @@
      *        execution is on
      *    T   the 1000 bit is turned on, and execution is off (undefined bit-
      *        state)
+     *    e   z/OS external link bit
      */
     private static final String REGEX =
-        "([bcdlfmpSs-])"
+        "([bcdelfmpSs-])"
         
+"(((r|-)(w|-)([xsStTL-]))((r|-)(w|-)([xsStTL-]))((r|-)(w|-)([xsStTL-])))\\+?\\s+"
         + "(\\d+)\\s+"
         + "(\\S+)\\s+"
@@ -180,6 +181,9 @@
             {
             case 'd':
                 type = FTPFile.DIRECTORY_TYPE;
+                break;
+            case 'e':
+                type = FTPFile.SYMBOLIC_LINK_TYPE;
                 break;
             case 'l':
                 type = FTPFile.SYMBOLIC_LINK_TYPE;

Modified: 
jakarta/commons/proper/net/branches/JDK_1_5_BRANCH/src/main/java/org/apache/commons/net/io/FromNetASCIIInputStream.java
URL: 
http://svn.apache.org/viewvc/jakarta/commons/proper/net/branches/JDK_1_5_BRANCH/src/main/java/org/apache/commons/net/io/FromNetASCIIInputStream.java?rev=437385&r1=437384&r2=437385&view=diff
==============================================================================
--- 
jakarta/commons/proper/net/branches/JDK_1_5_BRANCH/src/main/java/org/apache/commons/net/io/FromNetASCIIInputStream.java
 (original)
+++ 
jakarta/commons/proper/net/branches/JDK_1_5_BRANCH/src/main/java/org/apache/commons/net/io/FromNetASCIIInputStream.java
 Sun Aug 27 08:22:03 2006
@@ -34,12 +34,12 @@
 {
     static final boolean _noConversionRequired;
     static final String _lineSeparator;
-    static final byte[] _lineSeparatorBytes;
+    static byte[] _lineSeparatorBytes;
 
     static {
         _lineSeparator = System.getProperty("line.separator");
         _noConversionRequired = _lineSeparator.equals("\r\n");
-        _lineSeparatorBytes = _lineSeparator.getBytes();
+        _lineSeparatorBytes = _lineSeparator.getBytes(); // TODO specify 
encoding
     }
 
     private int __length = 0;

Modified: 
jakarta/commons/proper/net/branches/JDK_1_5_BRANCH/src/test/java/org/apache/commons/net/ftp/parser/NTFTPEntryParserTest.java
URL: 
http://svn.apache.org/viewvc/jakarta/commons/proper/net/branches/JDK_1_5_BRANCH/src/test/java/org/apache/commons/net/ftp/parser/NTFTPEntryParserTest.java?rev=437385&r1=437384&r2=437385&view=diff
==============================================================================
--- 
jakarta/commons/proper/net/branches/JDK_1_5_BRANCH/src/test/java/org/apache/commons/net/ftp/parser/NTFTPEntryParserTest.java
 (original)
+++ 
jakarta/commons/proper/net/branches/JDK_1_5_BRANCH/src/test/java/org/apache/commons/net/ftp/parser/NTFTPEntryParserTest.java
 Sun Aug 27 08:22:03 2006
@@ -143,6 +143,17 @@
         assertEquals(0, dir.getSize());
 
     }
+    
+    public void testParseLeadingDigits() {
+               FTPFile file = getParser().parseFTPEntry("05-22-97  12:08AM     
             5000000000 10 years and under");
+               assertNotNull("Could not parse entry", file);
+               assertEquals("10 years and under", file.getName());
+               assertEquals(5000000000L, file.getSize());
+               
+               FTPFile dir = getParser().parseFTPEntry("12-03-96  06:38AM      
 <DIR>           10 years and under");
+               assertNotNull("Could not parse entry", dir);
+               assertEquals("10 years and under", dir.getName());
+    }
 
     /**
      * @see 
org.apache.commons.net.ftp.parser.FTPParseTestFramework#testParseFieldsOnFile()

Modified: jakarta/commons/proper/net/branches/JDK_1_5_BRANCH/xdocs/changes.xml
URL: 
http://svn.apache.org/viewvc/jakarta/commons/proper/net/branches/JDK_1_5_BRANCH/xdocs/changes.xml?rev=437385&r1=437384&r2=437385&view=diff
==============================================================================
--- jakarta/commons/proper/net/branches/JDK_1_5_BRANCH/xdocs/changes.xml 
(original)
+++ jakarta/commons/proper/net/branches/JDK_1_5_BRANCH/xdocs/changes.xml Sun 
Aug 27 08:22:03 2006
@@ -61,11 +61,20 @@
                        <action dev="rwinston" type="update">
                                Applied patch from NET-36 which makes FTPClient 
extend SocketClient
                                instead of TelnetClient.
-                       <action>
+                       </action>
+                       <action dev="rwinston" type="fix">
+                               Apply patch for NET-39, which adds an "e" 
symbolic link flag to the Unix FTP parser
+                       </action>
+                       <action dev="rwinston" type="fix">
+                               Apply patch for NET-119 (allow hidden files to 
be listed)
+                       </action>
+                       <action dev="rwinston" type="add">
+                               Added an FTP parser for Netware FTP servers.
+                       </action>
                </release>      
 
 
-               <release version="1.4.x" date="" description="">
+               <release version="1.5" date="" description="">
                        <action dev="dfs" type="fix">
                                Applied Rob Hasselbaum's
                                &lt;rhasselbaum -> alumni.ithaca.edu&gt;
@@ -83,6 +92,9 @@
                                Reverted PR 32859 patch to TFTPClient
                                because it caused final packets to not
                                be sent.
+                       </action>
+                       <action dev="rwinston" type="add">
+                               Added an FTP parser for Netware FTP servers.
                        </action>
                </release>
                

Modified: jakarta/commons/proper/net/branches/JDK_1_5_BRANCH/xdocs/index.xml
URL: 
http://svn.apache.org/viewvc/jakarta/commons/proper/net/branches/JDK_1_5_BRANCH/xdocs/index.xml?rev=437385&r1=437384&r2=437385&view=diff
==============================================================================
--- jakarta/commons/proper/net/branches/JDK_1_5_BRANCH/xdocs/index.xml 
(original)
+++ jakarta/commons/proper/net/branches/JDK_1_5_BRANCH/xdocs/index.xml Sun Aug 
27 08:22:03 2006
@@ -43,7 +43,7 @@
    <p>
      Supported protocols are:
      <ul>
-       <li>FTP</li>
+       <li>FTP/FTPS</li>
        <li>NNTP</li>
        <li>SMTP</li>
        <li>POP3</li>



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to