new-integration-tests/src/test/java/oracle/weblogic/kubernetes/utils/LoggingUtil.java
private static void copyDirectoryFromPod(V1Pod pvPod, Path destinationPath)
      throws ApiException {
    LoggingFacade logger = getLogger();
    Future<String> copyJob = null;
    try {
      Runnable copy = () -> {
        try {
          logger.info("Copying the contents of PV to {0}", destinationPath.toString());
          Kubernetes.copyDirectoryFromPod(pvPod, "/shared", destinationPath);
        } catch (IOException | ApiException ex) {
          logger.warning(ex.getMessage());
        }
      };
      ExecutorService executorService = Executors.newSingleThreadExecutor();
      copyJob = executorService.submit(copy, "Done copying");
      copyJob.get(1, MINUTES);
    } catch (ExecutionException ex) {
      logger.warning("Exception in copy");
    } catch (TimeoutException ex) {
      logger.warning("Copy timed out");
    } catch (InterruptedException ex) {
      logger.warning("Copy interrupted");
    } finally {
      if (copyJob != null && !copyJob.isDone()) {
        logger.info("Cancelling the copy job");
        copyJob.cancel(true);
      }
    }
  }
/**
   * Copy the mounted persistent volume directory to local file system.
   * @param pvPod V1Pod object to copy from
   * @param destinationPath location for the destination path
   * @throws ApiException when copy fails
   */
Copy the mounted persistent volume directory to local file system.
@param pvPod V1Pod object to copy from
@param destinationPath location for the destination path
@throws ApiException when copy fails
Copy the mounted persistent volume directory to local file system . @param pvPod V1Pod object to copy from @param destinationPath location for the destination path @throws ApiException when copy fails
private static void copyDirectoryFromPod(V1Pod pvPod, Path destinationPath)
      throws ApiException {
    LoggingFacade logger = getLogger();
    Future<String> copyJob = null;
    try {
      Runnable copy = () -> {
        try {
          logger.info("Copying the contents of PV to {0}", destinationPath.toString());
          Kubernetes.copyDirectoryFromPod(pvPod, "/shared", destinationPath);
        } catch (IOException | ApiException ex) {
          logger.warning(ex.getMessage());
        }
      };
      ExecutorService executorService = Executors.newSingleThreadExecutor();
      copyJob = executorService.submit(copy, "Done copying");
      copyJob.get(1, MINUTES);
    } catch (ExecutionException ex) {
      logger.warning("Exception in copy");
    } catch (TimeoutException ex) {
      logger.warning("Copy timed out");
    } catch (InterruptedException ex) {
      logger.warning("Copy interrupted");
    } finally {
      if (copyJob != null && !copyJob.isDone()) {
        logger.info("Cancelling the copy job");
        copyJob.cancel(true);
      }
    }
  }
private static void copyDirectoryFromPod ( V1Pod pvPod , Path destinationPath ) throws ApiException { LoggingFacade logger = getLogger ( ) ; Future < String > copyJob = null ; try { Runnable copy = ( ) -> { try { logger . info ( "Copying the contents of PV to {0}" , destinationPath . toString ( ) ) ; Kubernetes . copyDirectoryFromPod ( pvPod , "/shared" , destinationPath ) ; } catch ( IOException | ApiException ex ) { logger . warning ( ex . getMessage ( ) ) ; } } ; ExecutorService executorService = Executors . newSingleThreadExecutor ( ) ; copyJob = executorService . submit ( copy , "Done copying" ) ; copyJob . get ( 1 , MINUTES ) ; } catch ( ExecutionException ex ) { logger . warning ( "Exception in copy" ) ; } catch ( TimeoutException ex ) { logger . warning ( "Copy timed out" ) ; } catch ( InterruptedException ex ) { logger . warning ( "Copy interrupted" ) ; } finally { if ( copyJob != null && ! copyJob . isDone ( ) ) { logger . info ( "Cancelling the copy job" ) ; copyJob . cancel ( true ) ; } } }
Copy the mounted persistent volume directory to local file system.
Copy the mounted persistent volume directory to local file system .