From a54d2b0924cda7e777e80f96dec096c6e0fb8cca Mon Sep 17 00:00:00 2001 From: Rajitha Kumara Date: Mon, 1 Apr 2024 19:14:58 +0530 Subject: [PATCH] Fix building issue --- .../common/services/ApplicationManager.java | 12 ++---- .../pom.xml | 15 +++++-- .../mgt/core/impl/ApplicationManagerImpl.java | 41 +++++++++++++++---- pom.xml | 4 +- 4 files changed, 50 insertions(+), 22 deletions(-) diff --git a/components/application-mgt/io.entgra.device.mgt.core.application.mgt.common/src/main/java/io/entgra/device/mgt/core/application/mgt/common/services/ApplicationManager.java b/components/application-mgt/io.entgra.device.mgt.core.application.mgt.common/src/main/java/io/entgra/device/mgt/core/application/mgt/common/services/ApplicationManager.java index b46fe7a562..25d3c92f47 100644 --- a/components/application-mgt/io.entgra.device.mgt.core.application.mgt.common/src/main/java/io/entgra/device/mgt/core/application/mgt/common/services/ApplicationManager.java +++ b/components/application-mgt/io.entgra.device.mgt.core.application.mgt.common/src/main/java/io/entgra/device/mgt/core/application/mgt/common/services/ApplicationManager.java @@ -371,11 +371,9 @@ public interface ApplicationManager { * * @param releaseUuid UUID of the application release. * @param entAppReleaseWrapper {@link ApplicationReleaseDTO} - * @param applicationArtifact {@link ApplicationArtifact} * @return If the application release is updated correctly True returns, otherwise retuen False */ - ApplicationRelease updateEntAppRelease(String releaseUuid, EntAppReleaseWrapper entAppReleaseWrapper, - ApplicationArtifact applicationArtifact) throws ApplicationManagementException; + ApplicationRelease updateEntAppRelease(String releaseUuid, EntAppReleaseWrapper entAppReleaseWrapper) throws ApplicationManagementException; /** @@ -392,22 +390,18 @@ public interface ApplicationManager { * * @param releaseUuid UUID of the application release. * @param webAppReleaseWrapper {@link ApplicationReleaseDTO} - * @param applicationArtifact {@link ApplicationArtifact} * @return If the application release is updated correctly True returns, otherwise retuen False */ - ApplicationRelease updateWebAppRelease(String releaseUuid, WebAppReleaseWrapper webAppReleaseWrapper, - ApplicationArtifact applicationArtifact) throws ApplicationManagementException; + ApplicationRelease updateWebAppRelease(String releaseUuid, WebAppReleaseWrapper webAppReleaseWrapper) throws ApplicationManagementException; /** * Use to update existing custom app release * * @param releaseUuid UUID of the application release. * @param customAppReleaseWrapper {@link ApplicationReleaseDTO} - * @param applicationArtifact {@link ApplicationArtifact} * @return If the application release is updated correctly True returns, otherwise retuen False */ - ApplicationRelease updateCustomAppRelease(String releaseUuid, CustomAppReleaseWrapper customAppReleaseWrapper, - ApplicationArtifact applicationArtifact) throws ApplicationManagementException; + ApplicationRelease updateCustomAppRelease(String releaseUuid, CustomAppReleaseWrapper customAppReleaseWrapper) throws ApplicationManagementException; /** * To validate the application creating request diff --git a/components/application-mgt/io.entgra.device.mgt.core.application.mgt.core/pom.xml b/components/application-mgt/io.entgra.device.mgt.core.application.mgt.core/pom.xml index f94823e8f7..dc417eb255 100644 --- a/components/application-mgt/io.entgra.device.mgt.core.application.mgt.core/pom.xml +++ b/components/application-mgt/io.entgra.device.mgt.core.application.mgt.core/pom.xml @@ -83,10 +83,7 @@ io.entgra.device.mgt.core.apimgt.application.extension.*, org.apache.commons.httpclient, org.apache.commons.httpclient.methods, - org.apache.commons.validator.routines, - okhttp3.OkHttpClient, - okhttp3.Request, - okhttp3.Response + org.apache.commons.validator.routines apk-parser;scope=compile|runtime;inline=false @@ -376,6 +373,16 @@ com.squareup.okhttp3 okhttp compile + + + com.squareup.okio + okio + + + + + com.squareup.okio + okio diff --git a/components/application-mgt/io.entgra.device.mgt.core.application.mgt.core/src/main/java/io/entgra/device/mgt/core/application/mgt/core/impl/ApplicationManagerImpl.java b/components/application-mgt/io.entgra.device.mgt.core.application.mgt.core/src/main/java/io/entgra/device/mgt/core/application/mgt/core/impl/ApplicationManagerImpl.java index 98bebe80cf..50c2c2b25a 100644 --- a/components/application-mgt/io.entgra.device.mgt.core.application.mgt.core/src/main/java/io/entgra/device/mgt/core/application/mgt/core/impl/ApplicationManagerImpl.java +++ b/components/application-mgt/io.entgra.device.mgt.core.application.mgt.core/src/main/java/io/entgra/device/mgt/core/application/mgt/core/impl/ApplicationManagerImpl.java @@ -3324,11 +3324,13 @@ public class ApplicationManagerImpl implements ApplicationManager { } @Override - public ApplicationRelease updateEntAppRelease(String releaseUuid, EntAppReleaseWrapper entAppReleaseWrapper, - ApplicationArtifact applicationArtifact) throws ApplicationManagementException { + public ApplicationRelease updateEntAppRelease(String releaseUuid, EntAppReleaseWrapper entAppReleaseWrapper) throws ApplicationManagementException { int tenantId = PrivilegedCarbonContext.getThreadLocalCarbonContext().getTenantId(true); try { + ApplicationArtifact applicationArtifact = ApplicationManagementUtil. + constructApplicationArtifact(entAppReleaseWrapper.getIconLink(), entAppReleaseWrapper.getScreenshotLinks(), + entAppReleaseWrapper.getArtifactLink(), entAppReleaseWrapper.getBannerLink()); ConnectionManagerUtil.beginDBTransaction(); ApplicationDTO applicationDTO = this.applicationDAO.getAppWithRelatedRelease(releaseUuid, tenantId); DeviceType deviceTypeObj = APIUtil.getDeviceTypeData(applicationDTO.getDeviceTypeId()); @@ -3395,6 +3397,12 @@ public class ApplicationManagerImpl implements ApplicationManager { + "UUID:" + releaseUuid; log.error(msg, e); throw new ApplicationManagementException(msg, e); + } catch (MalformedURLException e) { + throw new ApplicationManagementException("Malformed downloadable URL received for the Public app " + + "release UUID: " + releaseUuid); + } catch (FileDownloaderServiceException e) { + throw new ApplicationManagementException("Error encountered while downloading artifact for the Public app " + + "release UUID: " + releaseUuid); } finally { ConnectionManagerUtil.closeDBConnection(); } @@ -3405,7 +3413,9 @@ public class ApplicationManagerImpl implements ApplicationManager { int tenantId = PrivilegedCarbonContext.getThreadLocalCarbonContext().getTenantId(true); try { - ApplicationArtifact applicationArtifact = ApplicationManagementUtil.constructApplicationArtifact(publicAppReleaseWrapper.getIconLink(), publicAppReleaseWrapper.getScreenshotLinks(), null, null); + ApplicationArtifact applicationArtifact = ApplicationManagementUtil. + constructApplicationArtifact(publicAppReleaseWrapper.getIconLink(), publicAppReleaseWrapper.getScreenshotLinks(), + null, publicAppReleaseWrapper.getBannerLink()); ConnectionManagerUtil.beginDBTransaction(); ApplicationDTO applicationDTO = this.applicationDAO.getAppWithRelatedRelease(releaseUuid, tenantId); validateAppReleaseUpdating(publicAppReleaseWrapper, applicationDTO, applicationArtifact, @@ -3476,11 +3486,13 @@ public class ApplicationManagerImpl implements ApplicationManager { } @Override - public ApplicationRelease updateWebAppRelease(String releaseUuid, WebAppReleaseWrapper webAppReleaseWrapper, - ApplicationArtifact applicationArtifact) throws ApplicationManagementException { + public ApplicationRelease updateWebAppRelease(String releaseUuid, WebAppReleaseWrapper webAppReleaseWrapper) throws ApplicationManagementException { int tenantId = PrivilegedCarbonContext.getThreadLocalCarbonContext().getTenantId(true); try { + ApplicationArtifact applicationArtifact = ApplicationManagementUtil. + constructApplicationArtifact(webAppReleaseWrapper.getIconLink(), webAppReleaseWrapper.getScreenshotLinks(), + null, webAppReleaseWrapper.getBannerLink()); ConnectionManagerUtil.beginDBTransaction(); ApplicationDTO applicationDTO = this.applicationDAO.getAppWithRelatedRelease(releaseUuid, tenantId); validateAppReleaseUpdating(webAppReleaseWrapper, applicationDTO, applicationArtifact, @@ -3535,18 +3547,27 @@ public class ApplicationManagerImpl implements ApplicationManager { + "release UUID:" + releaseUuid; log.error(msg, e); throw new ApplicationManagementException(msg, e); + } catch (MalformedURLException e) { + throw new ApplicationManagementException("Malformed downloadable URL received for the Public app " + + "release UUID: " + releaseUuid); + } catch (FileDownloaderServiceException e) { + throw new ApplicationManagementException("Error encountered while downloading artifact for the Public app " + + "release UUID: " + releaseUuid); } finally { ConnectionManagerUtil.closeDBConnection(); } } @Override - public ApplicationRelease updateCustomAppRelease(String releaseUuid, - CustomAppReleaseWrapper customAppReleaseWrapper, ApplicationArtifact applicationArtifact) + public ApplicationRelease updateCustomAppRelease(String releaseUuid, CustomAppReleaseWrapper customAppReleaseWrapper) throws ApplicationManagementException { int tenantId = PrivilegedCarbonContext.getThreadLocalCarbonContext().getTenantId(true); ApplicationStorageManager applicationStorageManager = APIUtil.getApplicationStorageManager(); try { + ApplicationArtifact applicationArtifact = ApplicationManagementUtil. + constructApplicationArtifact(customAppReleaseWrapper.getIconLink(), + customAppReleaseWrapper.getScreenshotLinks(), customAppReleaseWrapper.getArtifactLink(), + customAppReleaseWrapper.getBannerLink()); ConnectionManagerUtil.beginDBTransaction(); ApplicationDTO applicationDTO = this.applicationDAO.getAppWithRelatedRelease(releaseUuid, tenantId); AtomicReference applicationReleaseDTO = new AtomicReference<>( @@ -3665,6 +3686,12 @@ public class ApplicationManagerImpl implements ApplicationManager { + "UUID:" + releaseUuid; log.error(msg, e); throw new ApplicationManagementException(msg, e); + } catch (MalformedURLException e) { + throw new ApplicationManagementException("Malformed downloadable URL received for the Public app " + + "release UUID: " + releaseUuid); + } catch (FileDownloaderServiceException e) { + throw new ApplicationManagementException("Error encountered while downloading artifact for the Public app " + + "release UUID: " + releaseUuid); } finally { ConnectionManagerUtil.closeDBConnection(); } diff --git a/pom.xml b/pom.xml index f40557c8f2..5c3be7d83f 100644 --- a/pom.xml +++ b/pom.xml @@ -2177,8 +2177,8 @@ 1.3 2.8.5 31.0.1-jre - 4.6.0 - 2.6.0 + 4.12.0 + 3.6.0 9.3.1 1.1.1 1.2