0

I am working on a JAVA console application that does file backup and copy operations on Linux servers.

I want to check whether a path on a remote Linux server is valid and copy the file from local to remote server.

How to validate the path on a remote Linux server and copy the file from local to Linux.

I use the below code for validating the path on local server.

public static boolean isValidFile(File file) {
        return file != null && file.exists() && file.isFile();
    }

Please suggest any articles or code samples that helps to copy files across servers.

Thanks Ashok

Alexander
  • 9,737
  • 4
  • 53
  • 59
user3219354
  • 101
  • 4
  • 21
  • Possible duplicate of [Check if file exists on remote machine](http://stackoverflow.com/questions/4235953/check-if-file-exists-on-remote-machine) – Hrabosch Aug 17 '16 at 12:02
  • Check [JSch](http://www.jcraft.com/jsch/) and this [question](http://stackoverflow.com/questions/18831238/copy-all-files-with-specific-extension-from-remote-server-with-java?rq=1) –  Aug 17 '16 at 12:03
  • `file.exists()` is redundant. `file.isFile()` checks for the existence of the file. – VGR Aug 17 '16 at 13:46

0 Answers0