Our Products:   CompleteFTP  edtFTPnet/Free  edtFTPnet/PRO  edtFTPj/Free  edtFTPj/PRO
0 votes
9.2k views
in Java FTP by (240 points)
hello:
I am from china,My english is very poor ,i hope you can Understand my idea.
This problem as follows:
When i trying to using dirDetails function,it throws a following exception :
java.text.ParseException: Unparseable date: "Dec-02-2004 09:23"

   at java.text.DateFormat.parse(DateFormat.java:335)

   at com.enterprisedt.net.ftp.UnixFileParser.parse(UnixFileParser.java:224)

   at com.enterprisedt.net.ftp.FTPFileFactory.parse(FTPFileFactory.java:198)

   at com.enterprisedt.net.ftp.FTPClient.dirDetails(FTPClient.java:1816)


FTP server is in linux 9,my operation system is MS xp
________
Leon Bates (American Labor Leader)

6 Answers

0 votes
by
Can you send me the code snippet?
0 votes
by (240 points)
Can you send me the code snippet?

The code snippet as follows:
class GetFileList {
   private FTPClient fc;
   public GetFileList(){
     ConfigFile cf=new ConfigFile(System.getProperty("user.dir")+"\\ftp.properties");
     String hostStr=cf.getValue("FtpServer");
     String portStr=cf.getValue("FtpPort");
     String userStr=cf.getValue("FtpUserName");
     String passStr=cf.getValue("FtpPassword");
     try{
     fc=new FTPClient(hostStr);
     FTPMessageCollector listener = new FTPMessageCollector();
            fc.setMessageListener(listener);
          fc.login(userStr,passStr);
          // set up passive ASCII transfers
           //log.debug("Setting up passive, ASCII transfers");
           fc.setConnectMode(FTPConnectMode.PASV);
           fc.setType(FTPTransferType.ASCII);
           String[] files = fc.dir(".", true);
          for (int i = 0; i < files.length; i++)
            System.out.println(files[i]);//log.debug(files[i]);

//          fc.get("123.txt","123.txt");
   FTPFile[] fFile=fc.dirDetails(".");

     //print(fFile);
     for(int i=0 ;i<fFile.length;i++)
    {

      System.out.println(fFile[i].getName());

    }
          fc.quit();
    }catch(Exception e)
    { e.printStackTrace(); }

   }

}

The snippet is my Test code,You dont consider my syntax,beacause the snippet is inner class.
Otherwise ,nice to meet you,thank you
________
Zx14 vs hayabusa
0 votes
by
I dont understand why you are doing dir and dirdetails both.
0 votes
by (240 points)
Can you send me the code snippet?

I use edtftpj 1.4.5 , modified class UnixFileParser at
          Calendar cal = Calendar.getInstance();
            int year = cal.get(Calendar.YEAR);
            stamp.append(year).append(" ").append(field);
         //stamp.append(year).append(field);

Above throw exception

Formerly Code is
   Calendar cal = Calendar.getInstance();
            int year = cal.get(Calendar.YEAR);
            stamp.append(year).append("-").append(field);
         //stamp.append(year).append(field);

However throw exception
________
Vermont marijuana dispensaries
0 votes
by (240 points)
I dont understand why you are doing dir and dirdetails both.


Just the code is test,i think for be independent of dir and dirdetails
________
MARIJUANA SATIVA
0 votes
by (161k points)
That appears to be the correct format.

Can you log into the FTP server on the command line, type 'dir' or 'ls' to get a full listing of the directory?

Cut and paste a portion of it here that contains the filename that is failing and we'll take a look.

hello:
I am from china,My english is very poor ,i hope you can Understand my idea.
This problem as follows:
When i trying to using dirDetails function,it throws a following exception :
java.text.ParseException: Unparseable date: "Dec-02-2004 09:23"

   at java.text.DateFormat.parse(DateFormat.java:335)

   at com.enterprisedt.net.ftp.UnixFileParser.parse(UnixFileParser.java:224)

   at com.enterprisedt.net.ftp.FTPFileFactory.parse(FTPFileFactory.java:198)

   at com.enterprisedt.net.ftp.FTPClient.dirDetails(FTPClient.java:1816)


FTP server is in linux 9,my operation system is MS xp

Categories

...