ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 36258] New: - 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 Thu, 18 Aug 2005 19:22:32 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=36258>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND·
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=36258

           Summary: Solution for ant ftp fails with Nullpointerexception
                    when a symlink is evaluated in method
                    checkRemoteSensitivity in FTP.java for a z/OS ftp server
           Product: Ant
           Version: 1.6.2
          Platform: PC
        OS/Version: Windows 2000
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Optional Tasks
        AssignedTo: dev@ant.apache.org
        ReportedBy: denisgaebler@netscape.net


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.

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

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


Mime
View raw message