• Post Reply Bookmark Topic Watch Topic
  • New Topic

delete file from ftp server  RSS feed

 
zb cong
Ranch Hand
Posts: 416
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hello
i use "sun.net.ftp" package to read and save files hosted in a ftp server,now,i can "get" and "put" files to ftp server,but i can't find the "delete" method in the "FtpClient" client,if after i read a file,i want to delete it,how can i do?
thank you!
 
Van Glass
Ranch Hand
Posts: 110
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The FTP command to delete a file is DELE filename. Does the sun.net.ftp package include a method for issuing an arbitrary command? If so it should simply be a matter of invoking the DELE command.
 
Peter den Haan
author
Ranch Hand
Posts: 3252
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Don't use the sun.* classes if you can help it. They are not supported and may disappear or move with any release of the Java platform. If you're looking for a reasonably feature-complete FTP client, try Apache Jakarta Commons/Net.
- Peter
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!