Package net.schmizz.sshj.xfer

Examples of net.schmizz.sshj.xfer.FileSystemFile


        try {
            ssh.authPublickey(System.getProperty("user.name"));
            final String src = System.getProperty("user.home") + File.separator + "test_file";
            final SFTPClient sftp = ssh.newSFTPClient();
            try {
                sftp.put(new FileSystemFile(src), "/tmp");
            } finally {
                sftp.close();
            }
        } finally {
            ssh.disconnect();
View Full Code Here


        ssh.connect("localhost");
        try {
            ssh.authPublickey(System.getProperty("user.name"));
            final SFTPClient sftp = ssh.newSFTPClient();
            try {
                sftp.get("test_file", new FileSystemFile("/tmp"));
            } finally {
                sftp.close();
            }
        } finally {
            ssh.disconnect();
View Full Code Here

            // Present here to demo algorithm renegotiation - could have just put this before connect()
            // Make sure JZlib is in classpath for this to work
            ssh.useCompression();

            final String src = System.getProperty("user.home") + File.separator + "test_file";
            ssh.newSCPFileTransfer().upload(new FileSystemFile(src), "/tmp/");
        } finally {
            ssh.disconnect();
        }
    }
View Full Code Here

        // ssh.useCompression(); // Can lead to significant speedup (needs JZlib in classpath)
        ssh.loadKnownHosts();
        ssh.connect("localhost");
        try {
            ssh.authPublickey(System.getProperty("user.name"));
            ssh.newSCPFileTransfer().download("test_file", new FileSystemFile("/tmp/"));
        } finally {
            ssh.disconnect();
        }
    }
View Full Code Here

    }

    @Override
    public void upload(String source, String dest)
            throws IOException {
        new Uploader().upload(new FileSystemFile(source), dest);
    }
View Full Code Here

    }

    @Override
    public void download(String source, String dest)
            throws IOException {
        download(source, new FileSystemFile(dest));
    }
View Full Code Here

    }

    @Override
    public void upload(String localPath, String remotePath)
            throws IOException {
        newSCPUploadClient().copy(new FileSystemFile(localPath), remotePath);
    }
View Full Code Here

    }

    @Override
    public void download(String remotePath, String localPath)
            throws IOException {
        download(remotePath, new FileSystemFile(localPath));
    }
View Full Code Here

    File dir = temp.newFolder("filtered-scp-upload");
    new File(dir, "not-sent.txt").createNewFile();
    new File(dir, "sent.txt").createNewFile();

    int copy = scpUploadClient.copy(new FileSystemFile(dir), "/tmp");
    verify(engine).startedDir("filtered-scp-upload");
    verify(engine).startedFile(eq("sent.txt"), isA(Long.class));
    verify(engine, times(1)).startedFile(isA(String.class), isA(Long.class));
  }
View Full Code Here

          final KeyProvider keyProvider = ssh.loadKeys(base + "id_dsa", password);
         
          final String user = System.getProperty("user.name");
          ssh.authPublickey(user, keyProvider);
         
            ssh.newSCPFileTransfer().download("/home/erikb/ninja.sh", new FileSystemFile("/tmp/"));
        } finally {
            ssh.disconnect();
        }
    }   
View Full Code Here

TOP

Related Classes of net.schmizz.sshj.xfer.FileSystemFile

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.