Loading
SFTP VS SCP Java Examples

Java Quick Notes

Refresh Your Java - Before Java Interview

We are Agile, believe in less Documentation - Only Quick notes (Java Interview Questions) of Java/J2ee Read more....


Not Included Yet
Not Included Yet
Not Included Yet
Not Included Yet
Not Included Yet
Not Included Yet
Not Included Yet
Not Included Yet
Not Included Yet
Not Included Yet
Not Included Yet
Not Included Yet
Not Included Yet
Not Included Yet
Not Included Yet
Not Included Yet
Not Included Yet
Not Included Yet
Not Included Yet
Not Included Yet

Go to SiteMap

Q)  SFTP VS SCP Java Examples


Ans)


The SSH File Transfer Protocol (also Secret File Transfer Protocol, Secure FTP, or SFTP)
is a network protocol that provides file access, file transfer, and file management
functionalities over any reliable data stream

Compared to the earlier SCP protocol, which allows only file transfers, the SFTP protocol
allows for a range of operations on remote files – it is more like a remote file system
protocol. An SFTP client's extra capabilities compared to an SCP client include resuming
interrupted transfers, directory listings, and remote file removal.
SFTP attempts to be more platform-independent than SCP; for instance, with SCP, the expansion
of wildcards specified by the client is up to the server, whereas SFTP's design avoids
this problem. While SCP is most frequently implemented on Unix platforms, SFTP servers
are commonly available on most platforms.
 
SFTP is not FTP run over SSH, but rather a new protocol designed from the ground
up by the IETF SECSH working group. It is sometimes confused with Simple
File Transfer Protocol.

In Java World.

Use "org.apache.tools.ant.taskdefs.optional.ssh.Scp" if you want to copy a file remotely using SCP.

import org.apache.tools.ant.taskdefs.optional.ssh.Scp;

public synchronized boolean copyAFile(String orderId,
                                       File localFile,
                                       ) throws Exception
      {
    scp = new Scp();
    Project p = new Project();
    p.init();
    scp.setProject( p );
    scp.setTrust(true);
    scp.setPort( SCP_PORT_NO );
    scp.setFile(localFile.getPath());
    scp.setTodir(sshHostUri);
    scp.execute();
  }

If you want use please refer the following  

http://javaquicknotes.com/questionDelegator/Java_FTP_example



Back to top

------------------------- We hope you got necessary Info On -----------------------------------------

SFTP VS SCP Java Examples


SFTP VS SCP Java Examples

-------------------------------------------------------------------------------------------------------



Face Book
Request for a Mock Interview/Training

Get a PDF

Face Book
Same look (Read) on any device, this is Ads free