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);
}
}
Aggregations