commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Rory Winston (JIRA)" <j...@apache.org>
Subject [jira] Resolved: (NET-39) [net] Solution for ant ftp fails with Nullpointerexception when a symlink is evaluated in method checkRemoteSensitivity in FTP.java for a z/OS ftp server
Date Sun, 27 Aug 2006 17:07:23 GMT
     [ http://issues.apache.org/jira/browse/NET-39?page=all ]

Rory Winston resolved NET-39.
-----------------------------

    Fix Version/s: 2.0
       Resolution: Fixed

Added to 2.0 branch

> [net] Solution for ant ftp fails with Nullpointerexception when a symlink is evaluated
in method checkRemoteSensitivity in FTP.java for a z/OS ftp server
> ---------------------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: NET-39
>                 URL: http://issues.apache.org/jira/browse/NET-39
>             Project: Commons Net
>          Issue Type: Bug
>    Affects Versions: 1.4 Final
>         Environment: Operating System: Windows 2000
> Platform: PC
>            Reporter: Denis Gaebler
>             Fix For: 2.0
>
>         Attachments: FTP.diffs, UnixFTPEntryParser.diffs
>
>
> The following code is trying to download a file from a z/OS FTP server:
> <ftp action="get" server="${server}" userid="${userid}" password="${password}"
> remotedir="/usr/lpp/ims/imsjava91">
>   <fileset dir="C:\temp">
>     <include name="imsjava.jar"/>
>   </fileset>
> </ftp>
> The directory in my case also contains symlinks to non Unix File Systems. For
> those symlinks somehow the FTP classes are not able to obtain file information,
> e.g. the following listing prints String target and array[pcounter] from method
> checkRemoteSensitivity in org/apache/tools/ant/taskdefs/optional/net/FTP.java:
>       [ftp] getting files
>       [ftp] ibm drwxr-xr-x   2 OMVSKERN SYS1        8192 Feb 14  2005 IBM
>       [ftp] ibm -rw-r--r--   2 OMVSKERN SYS1        1963 Feb 14  2005 README
>       [ftp] ibm drwxr-xr-x   3 OMVSKERN SYS1        8192 Feb 14  2005 cics
>       [ftp] ibm drwxr-xr-x   4 OMVSKERN SYS1        8192 Jun 16 13:50 dlimodel
>       [ftp] ibm -rw-r--r--   2 OMVSKERN SYS1      267217 Jun 16 13:50 imsjava.ja
> r
>       [ftp] ibm -rw-r--r--   2 OMVSKERN SYS1        5545 Jun 16 13:50 imsjava91.
> rar
>       [ftp] ibm drwxr-xr-x   3 OMVSKERN SYS1        8192 Feb 14  2005 lib
>       [ftp] ibm null
> In FTP.java at line 536 it is not checked if array[pcounter] is null.
> Commons-net is at 1.4.0. Apache Ant version is 1.6.2 compiled on July 16 2004. I
> did not try to research the cause in the code, why the file information is null.
> For me I added an if clause around lines 536-538 to check if array[pcounter] is
> null and this worked great.
> So I replaced lines:
>                               if (array[pcounter].getName().equals(target) &&
> pcounter != icounter) {
>                                 candidateFound = false;
>                               }
> with:
>                            if (array[pcounter] != null) {
>                               if (array[pcounter].getName().equals(target) &&
> pcounter != icounter) {
>                                 candidateFound = false;
>                               }
>                            }
> I would highly appreciate to add that code to Ant, otherwise my customers will
> not be able to use any Ant version for some z/OS directories.
> Thank you in advance.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message