X Tutup
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/main/java/com/github/dockerjava/api/DockerClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ public CopyFileFromContainerCmd copyFileFromContainerCmd(

public EventsCmd eventsCmd(EventCallback eventCallback);

@Override
public void close() throws IOException;

}
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ public interface CommitCmd extends DockerCmd<String>{
/**
* @throws NotFoundException No such container
*/
@Override
public String exec() throws NotFoundException;

public static interface Exec extends DockerCmdExec<CommitCmd, String> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,15 @@ public interface ContainerDiffCmd extends DockerCmd<List<ChangeLog>> {

public ContainerDiffCmd withContainerId(String containerId);

@Override
public String toString();

/**
* @throws NotFoundException No such container
* @throws InternalServerErrorException server error
* @throws DockerException unexpected http status code
*/
@Override
public List<ChangeLog> exec() throws NotFoundException;

public static interface Exec extends DockerCmdExec<ContainerDiffCmd, List<ChangeLog>> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ public interface CopyFileFromContainerCmd extends DockerCmd<InputStream> {
/**
* @throws NotFoundException No such container
*/
@Override
public InputStream exec() throws NotFoundException;

public static interface Exec extends DockerCmdExec<CopyFileFromContainerCmd, InputStream> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ public interface DockerCmdExecFactory extends Closeable {

public EventsCmd.Exec createEventsCmdExec();

@Override
public void close() throws IOException;

}
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ public interface InspectContainerCmd extends DockerCmd<InspectContainerResponse>
/**
* @throws NotFoundException No such container
*/
@Override
public InspectContainerResponse exec() throws NotFoundException;

public static interface Exec extends DockerCmdExec<InspectContainerCmd, InspectContainerResponse> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ public interface InspectImageCmd extends DockerCmd<InspectImageResponse>{
/**
* @throws NotFoundException No such image
*/
@Override
public InspectImageResponse exec() throws NotFoundException;

public static interface Exec extends DockerCmdExec<InspectImageCmd, InspectImageResponse> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ public interface KillContainerCmd extends DockerCmd<Void> {
/**
* @throws NotFoundException No such container
*/
@Override
public Void exec() throws NotFoundException;

public static interface Exec extends DockerCmdExec<KillContainerCmd, Void> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ public interface LogContainerCmd extends DockerCmd<InputStream>{
/**
* @throws NotFoundException No such container
*/
@Override
public InputStream exec() throws NotFoundException;

public static interface Exec extends DockerCmdExec<LogContainerCmd, InputStream> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ public interface PauseContainerCmd extends DockerCmd<Void>{
/**
* @throws NotFoundException No such container
*/
@Override
public Void exec() throws NotFoundException;

public static interface Exec extends DockerCmdExec<PauseContainerCmd, Void> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ public interface PushImageCmd extends DockerCmd<InputStream>{
/**
* @throws NotFoundException No such image
*/
@Override
public InputStream exec() throws NotFoundException;

public static interface Exec extends DockerCmdExec<PushImageCmd, InputStream> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ public interface RemoveContainerCmd extends DockerCmd<Void> {
/**
* @throws NotFoundException No such container
*/
@Override
public Void exec() throws NotFoundException;

public static interface Exec extends DockerCmdExec<RemoveContainerCmd, Void> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ public interface RemoveImageCmd extends DockerCmd<Void>{
/**
* @throws NotFoundException No such image
*/
@Override
public Void exec() throws NotFoundException;

public static interface Exec extends DockerCmdExec<RemoveImageCmd, Void> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ public interface RestartContainerCmd extends DockerCmd<Void> {
/**
* @throws NotFoundException No such container
*/
@Override
public Void exec() throws NotFoundException;

public static interface Exec extends DockerCmdExec<RestartContainerCmd, Void> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,7 @@ public interface StartContainerCmd extends DockerCmd<Void> {
* @throws NotModifiedException
* Container already started
*/
@Override
public Void exec() throws NotFoundException, NotModifiedException;

public static interface Exec extends DockerCmdExec<StartContainerCmd, Void> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ public interface StopContainerCmd extends DockerCmd<Void> {
* @throws NotFoundException No such container
* @throws NotModifiedException Container already stopped
*/
@Override
public Void exec() throws NotFoundException, NotModifiedException;

public static interface Exec extends DockerCmdExec<StopContainerCmd, Void> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ public interface TopContainerCmd extends DockerCmd<TopContainerResponse> {
/**
* @throws NotFoundException No such container
*/
@Override
public TopContainerResponse exec() throws NotFoundException;

public static interface Exec extends DockerCmdExec<TopContainerCmd, TopContainerResponse> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ public interface UnpauseContainerCmd extends DockerCmd<Void> {
/**
* @throws NotFoundException No such container
*/
@Override
public Void exec() throws NotFoundException;

public static interface Exec extends DockerCmdExec<UnpauseContainerCmd, Void> {
Expand Down
1 change: 0 additions & 1 deletion src/main/java/com/github/dockerjava/api/model/Links.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import java.util.Map;

import com.fasterxml.jackson.core.JsonGenerator;
import com.fasterxml.jackson.core.JsonParser;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,48 +31,58 @@ public ExecCreateCmdImpl(ExecCreateCmd.Exec exec, String containerId) {
withContainerId(containerId);
}

@Override
public ExecCreateCmd withContainerId(String containerId) {
checkNotNull(containerId, "containerId was not specified");
this.containerId = containerId;
return this;
}

@Override
public ExecCreateCmd withAttachStdin(boolean attachStdin) {
this.attachStdin = attachStdin;
return this;
}

@Override
public ExecCreateCmd withAttachStdin() {
return withAttachStdin(true);
}

@Override
public ExecCreateCmd withAttachStdout(boolean attachStdout) {
this.attachStdout = attachStdout;
return this;
}

@Override
public ExecCreateCmd withAttachStdout() {
return withAttachStdout(true);
}

@Override
public ExecCreateCmd withAttachStderr(boolean attachStderr) {
this.attachStderr = attachStderr;
return this;
}

@Override
public ExecCreateCmd withAttachStderr() {
return withAttachStderr(true);
}

@Override
public ExecCreateCmd withTty(boolean tty) {
this.tty = tty;
return this;
}

@Override
public ExecCreateCmd withTty() {
return withTty(true);
}

@Override
public ExecCreateCmd withCmd(String... cmd) {
this.cmd = cmd;
return this;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ protected String registryAuth(AuthConfig authConfig) {
}
}

@Override
public RES_T exec(CMD_T command) {
// this hack works because of ResponseStatusExceptionFilter
RES_T result;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package com.github.dockerjava.jaxrs;

import javax.ws.rs.client.WebTarget;
import javax.ws.rs.core.Response;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ private InputStream logInboundEntity(final StringBuilder b, InputStream stream)
}
stream.mark(maxEntitySize + 1);
final byte[] entity = new byte[maxEntitySize + 1];
final int entitySize = stream.read(entity);
final int entitySize = Math.max(0, stream.read(entity));
b.append(new String(entity, 0, Math.min(entitySize, maxEntitySize)));
if (entitySize > maxEntitySize) {
b.append("...more...");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
import org.testng.annotations.Test;

import com.github.dockerjava.api.DockerException;
import com.github.dockerjava.api.InternalServerErrorException;
import com.github.dockerjava.api.NotFoundException;
import com.github.dockerjava.api.command.CreateContainerResponse;
import com.github.dockerjava.api.command.InspectContainerResponse;
Expand Down
X Tutup