Examples of upload()


Examples of org.apache.sshd.client.ScpClient.upload()

        assertTrue(root.exists());


        writeFile(new File("target/scp/local/out.txt"), data);
        try {
            scp.upload("target/scp/local/out.txt", "target/scp/remote/out.txt");
            fail("Expected IOException");
        } catch (IOException e) {
            // ok
        }
        new File(root, "remote").mkdirs();
View Full Code Here

Examples of org.apache.sshd.client.ScpClient.upload()

            fail("Expected IOException");
        } catch (IOException e) {
            // ok
        }
        new File(root, "remote").mkdirs();
        scp.upload("target/scp/local/out.txt", "target/scp/remote/out.txt");
        assertFileLength(new File("target/scp/remote/out.txt"), data.length(), 5000);

        scp.download("target/scp/remote/out.txt", "target/scp/local/out2.txt");
        assertFileLength(new File("target/scp/local/out2.txt"), data.length(), 5000);
View Full Code Here

Examples of org.apache.sshd.client.ScpClient.upload()


        writeFile(new File("target/scp/local/out1.txt"), data);
        writeFile(new File("target/scp/local/out2.txt"), data);
        try {
            scp.upload(new String[] { "target/scp/local/out1.txt", "target/scp/local/out2.txt" }, "target/scp/remote/out.txt");
            fail("Expected IOException");
        } catch (IOException e) {
            // Ok
        }
        writeFile(new File("target/scp/remote/out.txt"), data);
View Full Code Here

Examples of org.apache.sshd.client.ScpClient.upload()

        } catch (IOException e) {
            // Ok
        }
        writeFile(new File("target/scp/remote/out.txt"), data);
        try {
            scp.upload(new String[] { "target/scp/local/out1.txt", "target/scp/local/out2.txt" }, "target/scp/remote/out.txt");
            fail("Expected IOException");
        } catch (IOException e) {
            // Ok
        }
        new File(root, "remote/dir").mkdirs();
View Full Code Here

Examples of org.apache.sshd.client.ScpClient.upload()

            fail("Expected IOException");
        } catch (IOException e) {
            // Ok
        }
        new File(root, "remote/dir").mkdirs();
        scp.upload(new String[] { "target/scp/local/out1.txt", "target/scp/local/out2.txt" }, "target/scp/remote/dir");
        assertFileLength(new File("target/scp/remote/dir/out1.txt"), data.length(), 5000);
        assertFileLength(new File("target/scp/remote/dir/out2.txt"), data.length(), 5000);

        try {
            scp.download(new String[] { "target/scp/remote/dir/out1.txt", "target/scp/remote/dir/out2.txt" }, "target/scp/local/out1.txt");
View Full Code Here

Examples of org.apache.sshd.client.ScpClient.upload()

        assertTrue(root.exists());

        new File("target/scp/local/dir").mkdirs();
        writeFile(new File("target/scp/local/dir/out1.txt"), data);
        writeFile(new File("target/scp/local/dir/out2.txt"), data);
        scp.upload("target/scp/local/dir", "target/scp/remote/", ScpClient.Option.Recursive);
        assertFileLength(new File("target/scp/remote/dir/out1.txt"), data.length(), 5000);
        assertFileLength(new File("target/scp/remote/dir/out2.txt"), data.length(), 5000);

        Utils.deleteRecursive(new File("target/scp/local/dir"));
        scp.download("target/scp/remote/dir", "target/scp/local", ScpClient.Option.Recursive);
View Full Code Here

Examples of org.apache.sshd.client.ScpClient.upload()

        new File(root, "remote").mkdirs();
        assertTrue(root.exists());

        writeFile(new File("target/scp/local/out1.txt"), data);
        writeFile(new File("target/scp/local/out2.txt"), data);
        scp.upload("target/scp/local/*", "target/scp/remote/");
        assertFileLength(new File("target/scp/remote/out1.txt"), data.length(), 5000);
        assertFileLength(new File("target/scp/remote/out2.txt"), data.length(), 5000);

        new File("target/scp/local/out1.txt").delete();
        new File("target/scp/local/out2.txt").delete();
View Full Code Here

Examples of org.apache.sshd.client.ScpClient.upload()

        assertTrue(root.exists());

        new File("target/scp/local/dir").mkdirs();
        writeFile(new File("target/scp/local/out1.txt"), data);
        writeFile(new File("target/scp/local/dir/out2.txt"), data);
        scp.upload("target/scp/local/*", "target/scp/remote/", ScpClient.Option.Recursive);
        assertFileLength(new File("target/scp/remote/out1.txt"), data.length(), 5000);
        assertFileLength(new File("target/scp/remote/dir/out2.txt"), data.length(), 5000);

        Utils.deleteRecursive(new File("target/scp/local/out1.txt"));
        Utils.deleteRecursive(new File("target/scp/local/dir"));
View Full Code Here

Examples of org.apache.sshd.client.ScpClient.upload()

        writeFile(new File("target/scp/local/dir/out2.txt"), data);
        new File("target/scp/local/out1.txt").setLastModified(lastMod);
        new File("target/scp/local/out1.txt").setExecutable(true, true);
        new File("target/scp/local/out1.txt").setWritable(false, false);
        new File("target/scp/local/dir/out2.txt").setLastModified(lastMod);
        scp.upload("target/scp/local/*", "target/scp/remote/", ScpClient.Option.Recursive, ScpClient.Option.PreserveAttributes);
        assertFileLength(new File("target/scp/remote/out1.txt"), data.length(), 5000);
        assertEquals(lastMod, new File("target/scp/remote/out1.txt").lastModified());
        assertFileLength(new File("target/scp/remote/dir/out2.txt"), data.length(), 5000);
        assertEquals(lastMod, new File("target/scp/remote/dir/out2.txt").lastModified());

View Full Code Here

Examples of org.eclipse.jgit.transport.UploadPack.upload()

    UploadPack up = (UploadPack) req.getAttribute(ATTRIBUTE_HANDLER);
    try {
      up.setBiDirectionalPipe(false);
      rsp.setContentType(UPLOAD_PACK_RESULT_TYPE);

      up.upload(getInputStream(req), out, null);
      out.close();

    } catch (ServiceMayNotContinueException e) {
      if (e.isOutput()) {
        consumeRequestBody(req);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.