Question

I am using the JSch library.

I need three methods:

  • void delete() --- to delete the file with the given name
  • void copy() --- to copy the file with the given name into the local system
  • list copyndelete() --- to copy the file and to delete the file in the remote system ... and also return the name of the file deleted into the list.

How could I do this?

Was it helpful?

Solution

You could try using Apache FTPSClient.

OTHER TIPS

Try using Jcraft . Its an Open source Project

The JSch library contains the ChannelSftp class. This class has (between others) also methods to

  • copy remote files to local ones (all the get methods)
  • delete remote files (the rm method, or rmdir to delete empty directories)
  • list remote files (ls)

All your requirements can be fulfilled from combinations of these methods.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top