@Override
  protected void setUp() throws Exception {
    File baseTempFile = File.createTempFile("test", ".txt"); // $NON-NLS-1$ //$NON-NLS-2$
    baseTempFile.deleteOnExit();

    File baseDirectory = baseTempFile.getParentFile();

    LocalConnectionPoint lcp = new LocalConnectionPoint();
    lcp.setPath(new Path(baseDirectory.getAbsolutePath()));
    clientManager = lcp;

    SFTPConnectionPoint ftpcp = new SFTPConnectionPoint();
    ftpcp.setHost(getConfig().getProperty("sftp.host")); // $NON-NLS-1$
    ftpcp.setLogin(getConfig().getProperty("sftp.username")); // $NON-NLS-1$
    ftpcp.setPassword(getConfig().getProperty("sftp.password").toCharArray());
    ftpcp.setPort(
        Integer.valueOf(getConfig().getProperty("sftp.port", "22"))); // $NON-NLS-1$ //$NON-NLS-2$
    ftpcp.setPath(Path.fromPortableString(getConfig().getProperty("sftp.path"))); // $NON-NLS-1$
    serverManager = ftpcp;

    ConnectionContext context = new ConnectionContext();
    context.put(ConnectionContext.COMMAND_LOG, System.out);
    CoreIOPlugin.setConnectionContext(ftpcp, context);

    fileName = "file name.txt";
    folderName = "folder name";

    super.setUp();
  }
Ejemplo n.º 2
0
  @Override
  protected void setUp() throws Exception {
    File baseTempFile = File.createTempFile("test", ".txt"); // $NON-NLS-1$ //$NON-NLS-2$
    baseTempFile.deleteOnExit();

    File baseDirectory = baseTempFile.getParentFile();

    LocalConnectionPoint lcp = new LocalConnectionPoint();
    lcp.setPath(new Path(baseDirectory.getAbsolutePath()));
    clientManager = lcp;

    LocalConnectionPoint scp = new LocalConnectionPoint();
    scp.setPath(new Path(baseDirectory.getAbsolutePath()));
    serverManager = scp;

    super.setUp();
  }