|
12 | 12 | */ |
13 | 13 | package io.kubernetes.client; |
14 | 14 |
|
15 | | -import com.google.common.io.ByteStreams; |
16 | 15 | import io.kubernetes.client.openapi.ApiClient; |
17 | 16 | import io.kubernetes.client.openapi.ApiException; |
18 | 17 | import io.kubernetes.client.openapi.Configuration; |
19 | 18 | import io.kubernetes.client.openapi.models.V1Pod; |
| 19 | +import io.kubernetes.client.util.Streams; |
20 | 20 | import io.kubernetes.client.util.exception.CopyNotSupportedException; |
21 | 21 | import java.io.BufferedInputStream; |
22 | 22 | import java.io.BufferedReader; |
@@ -95,7 +95,7 @@ public void copyFileFromPod( |
95 | 95 | throws ApiException, IOException { |
96 | 96 | try (InputStream is = copyFileFromPod(namespace, name, container, srcPath); |
97 | 97 | FileOutputStream fos = new FileOutputStream(destination.toFile())) { |
98 | | - ByteStreams.copy(is, fos); |
| 98 | + Streams.copy(is, fos); |
99 | 99 | fos.flush(); |
100 | 100 | } |
101 | 101 | } |
@@ -199,7 +199,7 @@ public Future<Integer> copyDirectoryFromPodAsync( |
199 | 199 | throw new IOException("create directory failed: " + parent); |
200 | 200 | } |
201 | 201 | try (OutputStream fs = new FileOutputStream(f)) { |
202 | | - ByteStreams.copy(archive, fs); |
| 202 | + Streams.copy(archive, fs); |
203 | 203 | fs.flush(); |
204 | 204 | } |
205 | 205 | } |
@@ -245,7 +245,7 @@ private void createFiles( |
245 | 245 | String modifiedSrcPath = genericPathBuilder(srcPath, childNode.name); |
246 | 246 | try (InputStream is = copyFileFromPod(namespace, pod, modifiedSrcPath); |
247 | 247 | OutputStream fs = new FileOutputStream(f)) { |
248 | | - ByteStreams.copy(is, fs); |
| 248 | + Streams.copy(is, fs); |
249 | 249 | fs.flush(); |
250 | 250 | } |
251 | 251 | } else { |
@@ -332,7 +332,7 @@ public static void copyFileFromPod(String namespace, String pod, String srcPath, |
332 | 332 | Copy c = new Copy(); |
333 | 333 | try (InputStream is = c.copyFileFromPod(namespace, pod, null, srcPath); |
334 | 334 | FileOutputStream os = new FileOutputStream(dest.toFile())) { |
335 | | - ByteStreams.copy(is, os); |
| 335 | + Streams.copy(is, os); |
336 | 336 | os.flush(); |
337 | 337 | } |
338 | 338 | } |
@@ -366,7 +366,7 @@ public Future<Integer> copyFileToPodAsync( |
366 | 366 | ArchiveEntry tarEntry = new TarArchiveEntry(srcFile, destPath.getFileName().toString()); |
367 | 367 |
|
368 | 368 | archiveOutputStream.putArchiveEntry(tarEntry); |
369 | | - ByteStreams.copy(input, archiveOutputStream); |
| 369 | + Streams.copy(input, archiveOutputStream); |
370 | 370 | archiveOutputStream.closeArchiveEntry(); |
371 | 371 |
|
372 | 372 | return new ProcessFuture(proc); |
@@ -399,7 +399,7 @@ public Future<Integer> copyFileToPodAsync( |
399 | 399 | ((TarArchiveEntry) tarEntry).setSize(src.length); |
400 | 400 |
|
401 | 401 | archiveOutputStream.putArchiveEntry(tarEntry); |
402 | | - ByteStreams.copy(new ByteArrayInputStream(src), archiveOutputStream); |
| 402 | + Streams.copy(new ByteArrayInputStream(src), archiveOutputStream); |
403 | 403 | archiveOutputStream.closeArchiveEntry(); |
404 | 404 |
|
405 | 405 | return new ProcessFuture(proc); |
|
0 commit comments