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
-
Method Summary
Modifier and TypeMethodDescriptionEstablish a ftp connection to the ftp server running on the docker fixturevoid
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 serverGets the username of the ftp user on the docker serverChecks if a Path exist on the docker ftp servervoid
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
-
Constructor Details
-
FtpdContainer
public FtpdContainer()
-
-
Method Details
-
getPassword
Gets the ftp password of the ftp user on the docker server- Specified by:
getPassword
in interfaceIPasswordDockerContainer
- Returns:
- ftp password
-
ftpDisconnect
public void ftpDisconnect()If the internal ftp client is connected to ftp server on the docker fixture, disconnects. -
ftpConnect
Establish a ftp connection to the ftp server running on the docker fixture- Returns:
- true if connection is okay, false if failed
-
getUsername
Gets the username of the ftp user on the docker server- Specified by:
getUsername
in interfaceIPasswordDockerContainer
- Returns:
- ftp username
-
uploadBinary
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 transferremotePath
- The remote path- Throws:
IOException
-
pathExist
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
-