All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.testcontainers.dockerclient.LogToStringContainerCallback Maven / Gradle / Ivy

There is a newer version: 1.20.3
Show newest version
package org.testcontainers.dockerclient;

import com.github.dockerjava.api.async.ResultCallback;
import com.github.dockerjava.api.model.Frame;

/**
 *
 * @deprecated use {@link ResultCallback.Adapter}
 */
@Deprecated
public class LogToStringContainerCallback extends ResultCallback.Adapter {

    private final StringBuffer log = new StringBuffer();

    @Override
    public void onNext(Frame frame) {
        log.append(new String(frame.getPayload()));
    }

    @Override
    public String toString() {
        try {
            awaitCompletion();
        } catch (InterruptedException e) {
            throw new RuntimeException(e);
        }
        return log.toString();
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy