Sample code for 30+ languages & platforms
Java

SFTP SymLink - Create Symbolic Link on Server

See more SFTP Examples

Demonstrates how to create a symbolic link on the SFTP server.

Chilkat Java Downloads

Chilkat2 Java
import com.chilkatsoft.chilkat2.ChilkatException;
import com.chilkatsoft.chilkat2.SFtp;

public class ChilkatExample {

    public static void main(String[] args) {
        // This example requires the Chilkat API to have been previously unlocked.
        // See Global Unlock Sample for sample code.

        SFtp sftp = new SFtp();

        // Pass a domain or IP address..
        try {
            sftp.connect("my-sftp-server.com", 22);
            sftp.authenticatePw("mySFtpLogin", "mySFtpPassword");

            sftp.initializeSftp();

            // Create a symbolic link on the server.
            // We'll create a link in our HOME directory named "sshd_config"
            // which points to the file /etc/ssh/sshd_config.
            sftp.symLink("/etc/ssh/sshd_config", "sshd_config");
        } catch (ChilkatException e) {
            System.out.println(e.getLastErrorText());
            return;
        }

        System.out.println("Successfully created symbolic link.");
    }
}