commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Hiran Chaudhuri (JIRA)" <j...@apache.org>
Subject [jira] Created: (NET-309) FTPClient getModificationTime throws ArrayIndexOutOfBoundsException
Date Wed, 27 Jan 2010 15:26:34 GMT
FTPClient getModificationTime throws ArrayIndexOutOfBoundsException
-------------------------------------------------------------------

                 Key: NET-309
                 URL: https://issues.apache.org/jira/browse/NET-309
             Project: Commons Net
          Issue Type: Bug
    Affects Versions: 2.0
         Environment: Client Windows XP, Server unknown unix styly FTP server
            Reporter: Hiran Chaudhuri


FTPClient is used to connect to FTP server via https, browse for files and get their age.
The call to getModificationTime throws an ArrayOutOfBoundsException.

Code:
        FTPClient ftpclient = new FTPClient();
        ftpclient.connect(server, port);
        log.debug("Connected");
        if (!ftpclient.login(user, password)) {
            throw new Exception("Could not logon");
        }
        log.debug("Logged in");
        String[] files = ftpclient.listNames(path);
        for (String f : files) {
            log.debug("Found file: ftp://" + server + ":" + port + f);
            String mt = ftpclient.getModificationTime(f);
            log.debug("File "+f+"was last modified "+mt);
        }

Exception:
java.lang.ArrayIndexOutOfBoundsException: 33
        at org.apache.commons.net.ftp.FTP.sendCommand(FTP.java:534)
        at org.apache.commons.net.ftp.FTP.mdtm(FTP.java:1157)
        at org.apache.commons.net.ftp.FTPClient.getModificationTime(FTPClient.java:2382)
    ...

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message