src/main/java/org/edgegallery/appstore/interfaces/apackage/facade/PushablePackageServiceFacade.java
public ResponseEntity<InputStreamResource> downloadIcon(String packageId) throws FileNotFoundException {
        PushablePackageDto packageDto = pushablePackageService.getPushablePackage(packageId);
        Release release = appService.getRelease(packageDto.getAppId(), packageId);
        String fileName = appUtil.getFileName(release, release.getIcon());
        InputStream ins = fileService.get(release.getIcon());
        HttpHeaders headers = new HttpHeaders();
        headers.add("Content-Type", "application/octet-stream");
        headers.add("Content-Disposition", "attachment; filename=" + fileName);
        return ResponseEntity.ok().headers(headers).body(new InputStreamResource(ins));
    }
/**
     * download a icon by id.
     *
     * @param packageId id
     * @return icon stream
     */
download a icon by id.
@param packageId id
@return icon stream
download a icon by id . @param packageId id @return icon stream
public ResponseEntity<InputStreamResource> downloadIcon(String packageId) throws FileNotFoundException {
        PushablePackageDto packageDto = pushablePackageService.getPushablePackage(packageId);
        Release release = appService.getRelease(packageDto.getAppId(), packageId);
        String fileName = appUtil.getFileName(release, release.getIcon());
        InputStream ins = fileService.get(release.getIcon());
        HttpHeaders headers = new HttpHeaders();
        headers.add("Content-Type", "application/octet-stream");
        headers.add("Content-Disposition", "attachment; filename=" + fileName);
        return ResponseEntity.ok().headers(headers).body(new InputStreamResource(ins));
    }
public ResponseEntity < InputStreamResource > downloadIcon ( String packageId ) throws FileNotFoundException { PushablePackageDto packageDto = pushablePackageService . getPushablePackage ( packageId ) ; Release release = appService . getRelease ( packageDto . getAppId ( ) , packageId ) ; String fileName = appUtil . getFileName ( release , release . getIcon ( ) ) ; InputStream ins = fileService . get ( release . getIcon ( ) ) ; HttpHeaders headers = new HttpHeaders ( ) ; headers . add ( "Content-Type" , "application/octet-stream" ) ; headers . add ( "Content-Disposition" , "attachment; filename=" + fileName ) ; return ResponseEntity . ok ( ) . headers ( headers ) . body ( new InputStreamResource ( ins ) ) ; }
download a icon by id.
download a icon by id .