Refresh Your Java - Before Java Interview
We are Agile, believe in less Documentation - Only Quick notes (Java Interview Questions) of Java/J2ee Read more....
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
This Portal is intended to put all Java/J2ee related topics at one single place for quick referance, not only Technical , but also the Project Management Related thing such as Development Process methodoogies build process, unit testing etc.,
This Portal has More than 500 Java Interview Questions (also could be Considered as Quick Notes) very neatly separated topic by topic with simple diagrams which makes you easily understandable. Importantly these are from our Realtime expericance.