Class FtpdContainer

java.lang.Object
org.jenkinsci.test.acceptance.docker.DockerContainer
org.jenkinsci.test.acceptance.docker.fixtures.FtpdContainer
All Implemented Interfaces:
Closeable, AutoCloseable, IPasswordDockerContainer

public class FtpdContainer extends org.jenkinsci.test.acceptance.docker.DockerContainer implements IPasswordDockerContainer
Represents a server with FTPD. Uses FtpClient to allow easy acces to files. It is assumed that the ftpd server of the docker fixture is configured using passive connection and the ports 21,7050,...,7055
Author:
Tobias Meyer
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    Establish a ftp connection to the ftp server running on the docker fixture
    void
    If the internal ftp client is connected to ftp server on the docker fixture, disconnects.
    Gets the ftp password of the ftp user on the docker server
    Gets the username of the ftp user on the docker server
    Checks if a Path exist on the docker ftp server
    void
    uploadBinary(String localPath, String remotePath)
    Connects to the ftp server and uploads one File from the localPath to the remote Path.

    Methods inherited from class org.jenkinsci.test.acceptance.docker.DockerContainer

    assertRunning, close, cp, getCid, getIpAddress, getLogfile, getPid, inspect, ipBound, ipUdpBound, ipv6Enabled, port, resource, sharingHostDockerService, toString, udpPort

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • FtpdContainer

      public FtpdContainer()
  • Method Details

    • getPassword

      public String getPassword()
      Gets the ftp password of the ftp user on the docker server
      Specified by:
      getPassword in interface IPasswordDockerContainer
      Returns:
      ftp password
    • ftpDisconnect

      public void ftpDisconnect()
      If the internal ftp client is connected to ftp server on the docker fixture, disconnects.
    • ftpConnect

      public Boolean ftpConnect()
      Establish a ftp connection to the ftp server running on the docker fixture
      Returns:
      true if connection is okay, false if failed
    • getUsername

      public String getUsername()
      Gets the username of the ftp user on the docker server
      Specified by:
      getUsername in interface IPasswordDockerContainer
      Returns:
      ftp username
    • uploadBinary

      public void uploadBinary(String localPath, String remotePath) throws IOException
      Connects to the ftp server and uploads one File from the localPath to the remote Path. The binary Transfer mode is used. After the transfer is finished the client disconnects from the server.
      Parameters:
      localPath - The file to transfer
      remotePath - The remote path
      Throws:
      IOException
    • pathExist

      public Boolean pathExist(String Path) throws IOException
      Checks if a Path exist on the docker ftp server
      Parameters:
      Path - the Path to check
      Returns:
      true if the Path exist, else false
      Throws:
      IOException