• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Devaka Cooray
  • Tim Cooke
Sheriffs:
  • Rob Spoor
  • Liutauras Vilda
  • paul wheaton
Saloon Keepers:
  • Tim Holloway
  • Tim Moores
  • Mikalai Zaikin
  • Carey Brown
  • Piet Souris
Bartenders:
  • Stephan van Hulst

Want a mehtod in org.apache.commons.net.ftp

 
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi All,
I am developing FTP code with the help of org.apache.commons.net.ftp.
My reqirement is To display all the directory names form a particular folder from server(remote) machine.I cant able to find any method like this in org.apache.commons.net.ftp api.So,Please help me in this regard.
THANKS IN ADVANCE..
-Ravi Kumar
 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You can use one of the FTPClient.listFiles methods to obtain an array of all files in a directory. Then you can check whether each entry is a file or directory by using the FTPFile.getType method, and ignore evertyhing that's not a directory.
 
ravi kumar
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Ulf,
Thanks a lot for your reply.Now I got the directory names like the below from the remote unix box:
drwxrwxrwx 2 bslops1 dstage 512 Sep 26 13:26 cmdb
drwxrwxrwx 2 bslops1 dstage 1024 Sep 21 12:27 hydqdw
drwxrwxrwx 2 bslops1 dstage 1024 Sep 26 13:46 hydstg

But I want only directory names.Please tell me how to get it.
THANK U VERY MUCH IN ADVANCE
-RAVI KUMAR
 
Ulf Dittmer
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Does FTPFile.getName not do what you're looking for?
 
ravi kumar
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi All,
I want to develop java code to upload files(not through FTP) and I dont want to use third party tool.Any body can please tell me how can I do that?Please send me sample codes if any.
THANKS IN ADVANCE

-Ravi Kumar.
 
The airline is called "Virgin"? Don't you want a plane to go all the way? This tiny ad will go all the way:
Smokeless wood heat with a rocket mass heater
https://woodheat.net
reply
    Bookmark Topic Watch Topic
  • New Topic