Search in sources :

Example 1 with CopyNotSupportedException

use of io.kubernetes.client.util.exception.CopyNotSupportedException in project java by kubernetes-client.

the class KubectlCopy method execute.

@Override
public Boolean execute() throws KubectlException {
    validate();
    Copy cp = new Copy(apiClient);
    try {
        if (toPod) {
            cp.copyFileToPod(namespace, name, container, Paths.get(from), Paths.get(to));
        } else {
            if (this.dir) {
                cp.copyDirectoryFromPod(namespace, name, container, from, Paths.get(to));
            } else {
                cp.copyFileFromPod(namespace, name, container, from, Paths.get(to));
            }
        }
        return true;
    } catch (ApiException | IOException | CopyNotSupportedException ex) {
        throw new KubectlException(ex);
    }
}
Also used : Copy(io.kubernetes.client.Copy) IOException(java.io.IOException) KubectlException(io.kubernetes.client.extended.kubectl.exception.KubectlException) CopyNotSupportedException(io.kubernetes.client.util.exception.CopyNotSupportedException) ApiException(io.kubernetes.client.openapi.ApiException)

Aggregations

Copy (io.kubernetes.client.Copy)1 KubectlException (io.kubernetes.client.extended.kubectl.exception.KubectlException)1 ApiException (io.kubernetes.client.openapi.ApiException)1 CopyNotSupportedException (io.kubernetes.client.util.exception.CopyNotSupportedException)1 IOException (java.io.IOException)1