You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Hiran Chaudhuri (JIRA)" <ji...@apache.org> on 2010/01/27 16:26:34 UTC

[jira] Created: (NET-309) FTPClient getModificationTime throws ArrayIndexOutOfBoundsException

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.


[jira] Resolved: (NET-309) FTPClient getModificationTime throws ArrayIndexOutOfBoundsException

Posted by "Sebb (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/NET-309?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Sebb resolved NET-309.
----------------------

    Resolution: Duplicate

Duplicates NET-248

> 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.