Package com.spotify.docker.client
Class AnsiProgressHandler
java.lang.Object
com.spotify.docker.client.AnsiProgressHandler
- All Implemented Interfaces:
ProgressHandler
Parses ProgressMessage objects and writes the output to a PrintStream. The output includes ANSI
escape characters to move the cursor around to nicely print progress bars.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate void
printProgress
(ProgressMessage message) Displays the upload/download status of multiple image layers the same way the docker CLI does.void
progress
(ProgressMessage message) This method will be called for each progress message received from Docker.
-
Field Details
-
ESC_CODE
private static final char ESC_CODE- See Also:
-
out
-
idsToLines
-
-
Constructor Details
-
AnsiProgressHandler
public AnsiProgressHandler() -
AnsiProgressHandler
-
-
Method Details
-
progress
Description copied from interface:ProgressHandler
This method will be called for each progress message received from Docker.- Specified by:
progress
in interfaceProgressHandler
- Parameters:
message
- the message to process- Throws:
DockerException
- if a server error occurred (500)
-
printProgress
Displays the upload/download status of multiple image layers the same way the docker CLI does. The current status of each layer is show on its own line. As the status updated, we move the cursor to the correct line, and overwrite the old status with the new one.- Parameters:
message
- the ProgressMessage to parse
-