Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Automate FTP  RSS feed

 
Siegfried Heintze
Ranch Hand
Posts: 417
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I presently have a program that uses the Java.IO.File class. I was hoping there was some descendent class that would allow me to polymorphically read and write remote files via FTP. Is there such a class?
Thanks,
Sieg
 
David Weitzman
Ranch Hand
Posts: 1365
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you don't actually need all the features of File, you should be able to access FTP with a URLConnection. I don't know about any implementations that conform to the File interface, but it probably wouldn't be hard to download one that doesn't and create an adapter class.
 
Peter den Haan
author
Ranch Hand
Posts: 3252
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Not that I know of. The URL class will act as an ftp client, and appears to support both reading and writing (judging by the fact that the sun.net.www.protocol.ftp handler has both input and output streams) but I haven't ever used it in this way.
- Peter
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!