src/main/java/org/edgegallery/appstore/application/inner/AppService.java
public void downloadAppImage(List<SwImgDesc> imageInfoList) {

        String[] sourceRepoHost;
        for (SwImgDesc imageInfo : imageInfoList) {
            LOGGER.info("Download docker image {} ", imageInfo.getSwImage());

            sourceRepoHost = imageInfo.getSwImage().split("/");
            DockerClient dockerClient = getDockerClient(sourceRepoHost[0], devRepoUsername, devRepoPassword);

            try {
                dockerClient.pullImageCmd(imageInfo.getSwImage()).exec(new PullImageResultCallback()).awaitCompletion();
            } catch (InterruptedException e) {
                Thread.currentThread().interrupt();
                throw new AppException(PULL_IMAGE_ERR_MESSAGES, ResponseConst.RET_PULL_IMAGE_FAILED,
                    imageInfo.getSwImage());
            } catch (Exception e) {
                LOGGER.error("failed to download image {}, image not found in repository, {}", imageInfo.getSwImage(),
                    e.getMessage());
                throw new AppException(PULL_IMAGE_ERR_MESSAGES, ResponseConst.RET_PULL_IMAGE_FAILED,
                    imageInfo.getSwImage());
            }
        }

        LOGGER.info("images to edge repo downloaded successfully");
    }
/**
     * Downloads app image from repo.
     *
     * @param imageInfoList list of images
     */
Downloads app image from repo.
@param imageInfoList list of images
Downloads app image from repo . @param imageInfoList list of images
public void downloadAppImage(List<SwImgDesc> imageInfoList) {
        String[] sourceRepoHost;
        for (SwImgDesc imageInfo : imageInfoList) {
            LOGGER.info("Download docker image {} ", imageInfo.getSwImage());
            sourceRepoHost = imageInfo.getSwImage().split("/");
            DockerClient dockerClient = getDockerClient(sourceRepoHost[0], devRepoUsername, devRepoPassword);
            try {
                dockerClient.pullImageCmd(imageInfo.getSwImage()).exec(new PullImageResultCallback()).awaitCompletion();
            } catch (InterruptedException e) {
                Thread.currentThread().interrupt();
                throw new AppException(PULL_IMAGE_ERR_MESSAGES, ResponseConst.RET_PULL_IMAGE_FAILED,
                    imageInfo.getSwImage());
            } catch (Exception e) {
                LOGGER.error("failed to download image {}, image not found in repository, {}", imageInfo.getSwImage(),
                    e.getMessage());
                throw new AppException(PULL_IMAGE_ERR_MESSAGES, ResponseConst.RET_PULL_IMAGE_FAILED,
                    imageInfo.getSwImage());
            }
        }
        LOGGER.info("images to edge repo downloaded successfully");
    }
public void downloadAppImage ( List < SwImgDesc > imageInfoList ) { String [ ] sourceRepoHost ; for ( SwImgDesc imageInfo : imageInfoList ) { LOGGER . info ( "Download docker image {} " , imageInfo . getSwImage ( ) ) ; sourceRepoHost = imageInfo . getSwImage ( ) . split ( "/" ) ; DockerClient dockerClient = getDockerClient ( sourceRepoHost [ 0 ] , devRepoUsername , devRepoPassword ) ; try { dockerClient . pullImageCmd ( imageInfo . getSwImage ( ) ) . exec ( new PullImageResultCallback ( ) ) . awaitCompletion ( ) ; } catch ( InterruptedException e ) { Thread . currentThread ( ) . interrupt ( ) ; throw new AppException ( PULL_IMAGE_ERR_MESSAGES , ResponseConst . RET_PULL_IMAGE_FAILED , imageInfo . getSwImage ( ) ) ; } catch ( Exception e ) { LOGGER . error ( "failed to download image {}, image not found in repository, {}" , imageInfo . getSwImage ( ) , e . getMessage ( ) ) ; throw new AppException ( PULL_IMAGE_ERR_MESSAGES , ResponseConst . RET_PULL_IMAGE_FAILED , imageInfo . getSwImage ( ) ) ; } } LOGGER . info ( "images to edge repo downloaded successfully" ) ; }
Downloads app image from repo.
Downloads app image from repo .