Our Products:   CompleteFTP  edtFTPnet/Free  edtFTPnet/PRO  edtFTPj/Free  edtFTPj/PRO
0 votes
3.1k views
in Java FTP by
:idea:
fileparse=new WindowsFileParser();
fileparse.setLocale(Locale.US);
factory=new FTPFileFactory(fileparse);
ftp.setFTPFileFactory(factory);
//ftp.setParserLocale(Locale.CHINA);
String dir="";
try{
String remotedir[]=ftp.dir("");
System.out.println(remotedir.length);
remotefile=new FTPFile[remotedir.length];
for(int i=0;i<remotedir.length;i++)
{
remotefile[i]=fileparse.parse(remotedir[i]);
}

System.out.println(remotefile.length);
addRemote(remotefile);
}
catch(IOException e)
{
JOptionPane.showMessageDialog(this,"获得远程目录出错!!","获得出错",JOptionPane.ERROR_MESSAGE);
}
catch(FTPException e)
{
JOptionPane.showMessageDialog(this,"获得远程目录出错!!","获得出错",JOptionPane.ERROR_MESSAGE);
}
catch(ParseException e)
{
System.out.println(e.getMessage());
}



question:
ParseException

Unexpected number of fields: 1
thanks!!!

1 Answer

0 votes
by (162k points)
Use dirDetails().

Categories

...