From 300e7a710ec61873404c4ff62bb1654f3d475685 Mon Sep 17 00:00:00 2001 From: megala21 Date: Mon, 9 Oct 2017 22:03:36 +0530 Subject: [PATCH] Changes according maven check style plugin --- .../services/ApplicationManagementAPI.java | 2 +- .../api/services/PlatformManagementAPI.java | 5 ++- .../impl/ApplicationManagementAPIImpl.java | 4 +-- .../application/mgt/common/Application.java | 1 - .../services/ApplicationReleaseManager.java | 32 +++++++++--------- .../services/ApplicationStorageManager.java | 33 ++++++++++--------- .../mgt/common/services/CategoryManager.java | 2 -- .../mgt/common/services/PlatformManager.java | 26 +++++++-------- .../services/PlatformStorageManager.java | 11 ++++--- .../mgt/core/dao/common/DAOFactory.java | 2 +- .../impl/platform/GenericPlatformDAOImpl.java | 3 +- .../impl/ApplicationStorageManagerImpl.java | 5 ++- .../mgt/core/util/StorageManagementUtil.java | 7 ++-- 13 files changed, 66 insertions(+), 67 deletions(-) diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.api/src/main/java/org/wso2/carbon/device/application/mgt/api/services/ApplicationManagementAPI.java b/components/application-mgt/org.wso2.carbon.device.application.mgt.api/src/main/java/org/wso2/carbon/device/application/mgt/api/services/ApplicationManagementAPI.java index 573e13f458..acdd989b89 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.api/src/main/java/org/wso2/carbon/device/application/mgt/api/services/ApplicationManagementAPI.java +++ b/components/application-mgt/org.wso2.carbon.device.application.mgt.api/src/main/java/org/wso2/carbon/device/application/mgt/api/services/ApplicationManagementAPI.java @@ -214,7 +214,7 @@ public interface ApplicationManagementAPI { name = "isWithImages", value = "Whether to return application with images", required = false) - @QueryParam("isWithImages") Boolean IsWithImages + @QueryParam("isWithImages") Boolean isWithImages ); @PUT diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.api/src/main/java/org/wso2/carbon/device/application/mgt/api/services/PlatformManagementAPI.java b/components/application-mgt/org.wso2.carbon.device.application.mgt.api/src/main/java/org/wso2/carbon/device/application/mgt/api/services/PlatformManagementAPI.java index ace466cdd8..3a30c15e55 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.api/src/main/java/org/wso2/carbon/device/application/mgt/api/services/PlatformManagementAPI.java +++ b/components/application-mgt/org.wso2.carbon.device.application.mgt.api/src/main/java/org/wso2/carbon/device/application/mgt/api/services/PlatformManagementAPI.java @@ -32,7 +32,6 @@ import org.apache.cxf.jaxrs.ext.multipart.Attachment; import org.apache.cxf.jaxrs.ext.multipart.Multipart; import org.wso2.carbon.apimgt.annotations.api.Scopes; import org.wso2.carbon.device.application.mgt.api.beans.ErrorResponse; -import org.wso2.carbon.device.application.mgt.common.ApplicationRelease; import org.wso2.carbon.device.application.mgt.common.Platform; import javax.validation.constraints.Size; @@ -211,7 +210,7 @@ public interface PlatformManagementAPI { response = ErrorResponse.class) }) Response addPlatform( - @Multipart(value = "Platform", type = "application/json" ) Platform platform, + @Multipart(value = "Platform", type = "application/json") Platform platform, @Multipart(value = "icon", required = false) Attachment iconFile ); @@ -371,7 +370,7 @@ public interface PlatformManagementAPI { response = ErrorResponse.class) }) Response getPlatformTags( - @ApiParam(name = "name", value ="The initial part of the name of platform tags that we need to retrieve", + @ApiParam(name = "name", value = "The initial part of the name of platform tags that we need to retrieve", required = true) @PathParam("name") @Size(min = 3) String name ); diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.api/src/main/java/org/wso2/carbon/device/application/mgt/api/services/impl/ApplicationManagementAPIImpl.java b/components/application-mgt/org.wso2.carbon.device.application.mgt.api/src/main/java/org/wso2/carbon/device/application/mgt/api/services/impl/ApplicationManagementAPIImpl.java index 34edd4c5d8..47743b4f72 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.api/src/main/java/org/wso2/carbon/device/application/mgt/api/services/impl/ApplicationManagementAPIImpl.java +++ b/components/application-mgt/org.wso2.carbon.device.application.mgt.api/src/main/java/org/wso2/carbon/device/application/mgt/api/services/impl/ApplicationManagementAPIImpl.java @@ -217,8 +217,8 @@ public class ApplicationManagementAPIImpl implements ApplicationManagementAPI { @POST @Path("/upload-image-artifacts/{uuid}") public Response uploadApplicationArtifacts(@PathParam("uuid") String applicationUUID, - @Multipart("icon") Attachment iconFile, @Multipart("banner") Attachment bannerFile, @Multipart - ("screenshot") List attachmentList) { + @Multipart("icon") Attachment iconFile, @Multipart("banner") Attachment bannerFile, + @Multipart("screenshot") List attachmentList) { ApplicationStorageManager applicationStorageManager = APIUtil.getApplicationStorageManager(); try { InputStream iconFileStream; diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device/application/mgt/common/Application.java b/components/application-mgt/org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device/application/mgt/common/Application.java index a6468de326..427bceee25 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device/application/mgt/common/Application.java +++ b/components/application-mgt/org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device/application/mgt/common/Application.java @@ -21,7 +21,6 @@ package org.wso2.carbon.device.application.mgt.common; import org.wso2.carbon.device.application.mgt.common.jaxrs.Exclude; -import java.awt.*; import java.util.ArrayList; import java.util.Date; import java.util.List; diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device/application/mgt/common/services/ApplicationReleaseManager.java b/components/application-mgt/org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device/application/mgt/common/services/ApplicationReleaseManager.java index a97050d19f..2f5231d671 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device/application/mgt/common/services/ApplicationReleaseManager.java +++ b/components/application-mgt/org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device/application/mgt/common/services/ApplicationReleaseManager.java @@ -27,46 +27,48 @@ import java.util.List; * ApplicationReleaseManager is responsible for handling all the operations related with * {@link org.wso2.carbon.device.application.mgt.common.ApplicationRelease} which involving addition, updating , * deletion and viewing. - * */ public interface ApplicationReleaseManager { /** * To create an application release for an Application. * - * @param appicationUuid UUID of the Application + * @param appicationUuid UUID of the Application * @param applicationRelease ApplicatonRelease that need to be be created. * @return the unique id of the application release, if the application release succeeded else -1 */ - public ApplicationRelease createRelease(String appicationUuid, ApplicationRelease applicationRelease) throws - ApplicationManagementException; + ApplicationRelease createRelease(String appicationUuid, ApplicationRelease applicationRelease) + throws ApplicationManagementException; /** * To get the application release of the Application/ + * * @param applicationUuid UUID of the Application. - * @param version Version of the ApplicationRelease that need to be retrieved. + * @param version Version of the ApplicationRelease that need to be retrieved. * @return ApplicationRelease related with particular Application UUID and version. * @throws ApplicationManagementException ApplicationManagementException */ - public ApplicationRelease getRelease(String applicationUuid, String version) throws ApplicationManagementException; + ApplicationRelease getRelease(String applicationUuid, String version) throws ApplicationManagementException; /** * To get all the releases of a particular Application. + * * @param applicationUuid UUID of the Application to get all the releases. * @return the List of the Application releases related with the particular Application. * @throws ApplicationManagementException Application Management Exception. */ - public List getReleases(String applicationUuid) throws ApplicationManagementException; + List getReleases(String applicationUuid) throws ApplicationManagementException; /** * To make a particular application release as the default / not default-one - * @param uuid UUID of the application - * @param version Version of the application - * @param isDefault is default or not. + * + * @param uuid UUID of the application + * @param version Version of the application + * @param isDefault is default or not. * @param releaseChannel Release channel to make the * @throws ApplicationManagementException Application Management Exception. */ - public void changeDefaultRelease(String uuid, String version, boolean isDefault, String releaseChannel) + void changeDefaultRelease(String uuid, String version, boolean isDefault, String releaseChannel) throws ApplicationManagementException; /** @@ -77,8 +79,8 @@ public interface ApplicationReleaseManager { * @return Updated Application Release. * @throws ApplicationManagementException Application Management Exception. */ - public ApplicationRelease updateRelease(String applicationUuid, ApplicationRelease applicationRelease) throws - ApplicationManagementException; + ApplicationRelease updateRelease(String applicationUuid, ApplicationRelease applicationRelease) + throws ApplicationManagementException; /** * To delete a particular release @@ -87,7 +89,7 @@ public interface ApplicationReleaseManager { * @param version Version of the ApplicationRelease that need to be deleted. * @throws ApplicationManagementException Application Management Exception. */ - public void deleteApplicationRelease(String applicationUuid, String version) throws ApplicationManagementException; + void deleteApplicationRelease(String applicationUuid, String version) throws ApplicationManagementException; /** * To delete all the application releases related with the the particular application. @@ -95,5 +97,5 @@ public interface ApplicationReleaseManager { * @param applicationUuid UUID of the application. * @throws ApplicationManagementException Application Management Exception. */ - public void deleteApplicationReleases(String applicationUuid) throws ApplicationManagementException; + void deleteApplicationReleases(String applicationUuid) throws ApplicationManagementException; } diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device/application/mgt/common/services/ApplicationStorageManager.java b/components/application-mgt/org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device/application/mgt/common/services/ApplicationStorageManager.java index e1597f8786..e6f60f6bf5 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device/application/mgt/common/services/ApplicationStorageManager.java +++ b/components/application-mgt/org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device/application/mgt/common/services/ApplicationStorageManager.java @@ -36,37 +36,40 @@ public interface ApplicationStorageManager { * @param applicationUUID UUID of the application * @param iconFile Icon File input stream * @param bannerFile Banner File input stream - * @throws ApplicationStorageManagementException Application Storage Management Exception. + * @throws ResourceManagementException Resource Management Exception. */ - public void uploadImageArtifacts(String applicationUUID, InputStream iconFile, InputStream bannerFile, + void uploadImageArtifacts(String applicationUUID, InputStream iconFile, InputStream bannerFile, List screenshots) throws ResourceManagementException; /** * To upload release artifacts for an Application. + * * @param applicationUUID UUID of the application related with the release. - * @param versionName Name of version of the Applcation Release. - * @param binaryFile Binary File for the release. - * @throws ApplicationStorageManagementException Application Storage Management Exception. + * @param versionName Name of version of the Applcation Release. + * @param binaryFile Binary File for the release. + * @throws ResourceManagementException Resource Management Exception. */ - public void uploadReleaseArtifacts(String applicationUUID, String versionName, InputStream binaryFile) + void uploadReleaseArtifacts(String applicationUUID, String versionName, InputStream binaryFile) throws ResourceManagementException; /** * To get released artifacts for the particular version of the application. + * * @param applicationUUID UUID of the Application - * @param versionName Version of the release to be retrieved + * @param versionName Version of the release to be retrieved * @return the artifact related with the Application Release. * @throws ApplicationStorageManagementException Application Storage Management Exception. */ - public InputStream getReleasedArtifacts(String applicationUUID, String versionName) throws - ApplicationStorageManagementException; + InputStream getReleasedArtifacts(String applicationUUID, String versionName) + throws ApplicationStorageManagementException; /** * To delete all the artifacts related with a particular Application. + * * @param applicationUUID UUID of the Application. * @throws ApplicationStorageManagementException Application Storage Management Exception. */ - public void deleteApplicationArtifacts(String applicationUUID) throws ApplicationStorageManagementException; + void deleteApplicationArtifacts(String applicationUUID) throws ApplicationStorageManagementException; /** * To delete the artifacts related with particular Application Release. @@ -75,16 +78,16 @@ public interface ApplicationStorageManager { * @param version Version of ApplicationRelease that need to be deleted. * @throws ApplicationStorageManagementException Application Storage Management Exception. */ - public void deleteApplicationReleaseArtifacts(String applicationUUID, String version) + void deleteApplicationReleaseArtifacts(String applicationUUID, String version) throws ApplicationStorageManagementException; /** * To delete all release artifacts related with particular Application Release. + * * @param applicationUUID UUID of the Application. * @throws ApplicationStorageManagementException Application Storage Management Exception */ - public void deleteAllApplicationReleaseArtifacts(String applicationUUID) throws - ApplicationStorageManagementException; + void deleteAllApplicationReleaseArtifacts(String applicationUUID) throws ApplicationStorageManagementException; /** * To get particular image artifact of the application. @@ -95,6 +98,6 @@ public interface ApplicationStorageManager { * @return the relevant image artifact. * @throws ApplicationStorageManagementException Application Storage Management Exception. */ - public ImageArtifact getImageArtifact(String applicationUUID, String name, int count) throws - ApplicationStorageManagementException; + ImageArtifact getImageArtifact(String applicationUUID, String name, int count) + throws ApplicationStorageManagementException; } diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device/application/mgt/common/services/CategoryManager.java b/components/application-mgt/org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device/application/mgt/common/services/CategoryManager.java index 0b5083adc4..4bc3d66289 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device/application/mgt/common/services/CategoryManager.java +++ b/components/application-mgt/org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device/application/mgt/common/services/CategoryManager.java @@ -19,8 +19,6 @@ package org.wso2.carbon.device.application.mgt.common.services; import org.wso2.carbon.device.application.mgt.common.Category; -import org.wso2.carbon.device.application.mgt.common.Filter; -import org.wso2.carbon.device.application.mgt.common.exception.ApplicationCategoryManagementException; import org.wso2.carbon.device.application.mgt.common.exception.ApplicationManagementException; import java.util.List; diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device/application/mgt/common/services/PlatformManager.java b/components/application-mgt/org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device/application/mgt/common/services/PlatformManager.java index 467be42844..ab7babb5b0 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device/application/mgt/common/services/PlatformManager.java +++ b/components/application-mgt/org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device/application/mgt/common/services/PlatformManager.java @@ -35,7 +35,7 @@ public interface PlatformManager { * @param tenantId ID of the tenant * @throws PlatformManagementException Platform Management Exception */ - public void initialize(int tenantId) throws PlatformManagementException; + void initialize(int tenantId) throws PlatformManagementException; /** * To get platforms of the specific tenant. @@ -44,7 +44,7 @@ public interface PlatformManager { * @return List of platforms * @throws PlatformManagementException Platform Management Exception */ - public List getPlatforms(int tenantId) throws PlatformManagementException; + List getPlatforms(int tenantId) throws PlatformManagementException; /** * To get platform with the given platform identifier and tenant ID. @@ -54,7 +54,7 @@ public interface PlatformManager { * @return the Specific platform with the platform identifier and tenant * @throws PlatformManagementException Platform Management Exception */ - public Platform getPlatform(int tenantId, String platformIdentifier) throws PlatformManagementException; + Platform getPlatform(int tenantId, String platformIdentifier) throws PlatformManagementException; /** * To register a platform under particular tenant. @@ -63,7 +63,7 @@ public interface PlatformManager { * @param platform Platform to be registered * @throws PlatformManagementException Platform Management Exception */ - public void register(int tenantId, Platform platform) throws PlatformManagementException; + void register(int tenantId, Platform platform) throws PlatformManagementException; /** * To update a platform. @@ -73,8 +73,7 @@ public interface PlatformManager { * @param platform Platform to be updated * @throws PlatformManagementException Platform Management Exception */ - public void update(int tenantId, String oldPlatformIdentifier, Platform platform) - throws PlatformManagementException; + void update(int tenantId, String oldPlatformIdentifier, Platform platform) throws PlatformManagementException; /** * To un-register the platform. @@ -84,8 +83,7 @@ public interface PlatformManager { * @param isFileBased To indicate whether a file based or not. * @throws PlatformManagementException Platform Management Exception. */ - public void unregister(int tenantId, String platformIdentifier, boolean isFileBased) - throws PlatformManagementException; + void unregister(int tenantId, String platformIdentifier, boolean isFileBased) throws PlatformManagementException; /** * To add mapping to platform identifiers with the tenant ID. @@ -94,7 +92,7 @@ public interface PlatformManager { * @param platformIdentifiers Platform Identifiers * @throws PlatformManagementException Platform Management Exception */ - public void addMapping(int tenantId, List platformIdentifiers) throws PlatformManagementException; + void addMapping(int tenantId, List platformIdentifiers) throws PlatformManagementException; /** * To add mapping to a platform for a tenant. @@ -103,7 +101,7 @@ public interface PlatformManager { * @param platformIdentifier ID of the platform, the mapping should be added. * @throws PlatformManagementException Platform Management Exception. */ - public void addMapping(int tenantId, String platformIdentifier) throws PlatformManagementException; + void addMapping(int tenantId, String platformIdentifier) throws PlatformManagementException; /** * To remove a mapping of a platform to a tenant. @@ -112,7 +110,7 @@ public interface PlatformManager { * @param platformIdentifier ID of the platform. * @throws PlatformManagementException Platform Management Exception. */ - public void removeMapping(int tenantId, String platformIdentifier) throws PlatformManagementException; + void removeMapping(int tenantId, String platformIdentifier) throws PlatformManagementException; /** * To update the platform status(ENABLED / DISABLED). @@ -122,7 +120,7 @@ public interface PlatformManager { * @param status Status to be updated. * @throws PlatformManagementException Platform Management Exception. */ - public void updatePlatformStatus(int tenantId, String platformIdentifier, String status) + void updatePlatformStatus(int tenantId, String platformIdentifier, String status) throws PlatformManagementException; /** @@ -131,7 +129,7 @@ public interface PlatformManager { * @param tenantId ID of the tenant. * @throws PlatformManagementException Platform Management Exception. */ - public void removePlatforms(int tenantId) throws PlatformManagementException; + void removePlatforms(int tenantId) throws PlatformManagementException; /** * To get the platform tags. @@ -140,5 +138,5 @@ public interface PlatformManager { * @return list of the platform tags that start with the character sequence. * @throws PlatformManagementException PlatformManagement Exception */ - public List getPlatformTags(String name) throws PlatformManagementException; + List getPlatformTags(String name) throws PlatformManagementException; } diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device/application/mgt/common/services/PlatformStorageManager.java b/components/application-mgt/org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device/application/mgt/common/services/PlatformStorageManager.java index 5b3f373221..3777086cc5 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device/application/mgt/common/services/PlatformStorageManager.java +++ b/components/application-mgt/org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device/application/mgt/common/services/PlatformStorageManager.java @@ -33,18 +33,19 @@ public interface PlatformStorageManager { * To upload image artifacts related with an Application. * * @param platformIdentifier Identifier of the platform - * @param iconFile Icon File input stream - * @throws PlatformStorageManagementException Platform Storage Management Exception. + * @param iconFile Icon File input stream + * @throws ResourceManagementException Resource Management Exception. */ - public void uploadIcon(String platformIdentifier, InputStream iconFile) throws ResourceManagementException; + void uploadIcon(String platformIdentifier, InputStream iconFile) throws ResourceManagementException; /** * To get the icon for a particular platform. * * @param platformIdentifier Identifier of the platform. * @return the icon for the given platform. + * @throws PlatformStorageManagementException Platform Storage Management Exception. */ - public ImageArtifact getIcon(String platformIdentifier) throws PlatformStorageManagementException; + ImageArtifact getIcon(String platformIdentifier) throws PlatformStorageManagementException; /** * To delete the icon of a particular platform @@ -52,5 +53,5 @@ public interface PlatformStorageManager { * @param platformIdentifier Identifier of the platform to which delete icon. * @throws PlatformStorageManagementException PlatformStorageManagement Exception. */ - public void deleteIcon(String platformIdentifier) throws PlatformStorageManagementException; + void deleteIcon(String platformIdentifier) throws PlatformStorageManagementException; } diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/dao/common/DAOFactory.java b/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/dao/common/DAOFactory.java index 88e7bb9f1e..8c63e99cc0 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/dao/common/DAOFactory.java +++ b/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/dao/common/DAOFactory.java @@ -36,8 +36,8 @@ import org.wso2.carbon.device.application.mgt.core.dao.impl.category.GenericCate import org.wso2.carbon.device.application.mgt.core.dao.impl.lifecyclestate.GenericLifecycleStateImpl; import org.wso2.carbon.device.application.mgt.core.dao.impl.platform.GenericPlatformDAOImpl; import org.wso2.carbon.device.application.mgt.core.dao.impl.platform.OracleMsSQLPlatformDAOImpl; -import org.wso2.carbon.device.application.mgt.core.dao.impl.visibility.GenericVisibilityDAOImpl; import org.wso2.carbon.device.application.mgt.core.dao.impl.subscription.GenericSubscriptionDAOImpl; +import org.wso2.carbon.device.application.mgt.core.dao.impl.visibility.GenericVisibilityDAOImpl; import org.wso2.carbon.device.application.mgt.core.exception.ApplicationManagementDAOException; import org.wso2.carbon.device.application.mgt.core.util.ApplicationMgtDatabaseCreator; import org.wso2.carbon.device.application.mgt.core.util.ConnectionManagerUtil; diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/dao/impl/platform/GenericPlatformDAOImpl.java b/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/dao/impl/platform/GenericPlatformDAOImpl.java index 3625a90eaf..892403abcc 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/dao/impl/platform/GenericPlatformDAOImpl.java +++ b/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/dao/impl/platform/GenericPlatformDAOImpl.java @@ -90,8 +90,7 @@ public class GenericPlatformDAOImpl extends AbstractDAOImpl implements PlatformD if (isBatchExecutionSupported) { preparedStatement.addBatch(); - } - else { + } else { preparedStatement.execute(); } } diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/impl/ApplicationStorageManagerImpl.java b/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/impl/ApplicationStorageManagerImpl.java index 5ee902e0d6..60cea3d56e 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/impl/ApplicationStorageManagerImpl.java +++ b/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/impl/ApplicationStorageManagerImpl.java @@ -157,10 +157,10 @@ public class ApplicationStorageManagerImpl implements ApplicationStorageManager throws ResourceManagementException { Application application = validateApplication(applicationUUID); String artifactDirectoryPath = storagePath + application.getId(); - if (log.isDebugEnabled()) + if (log.isDebugEnabled()) { log.debug("Artifact Directory Path for saving the application release related artifacts related with " + "application " + applicationUUID + " is " + artifactDirectoryPath); - + } StorageManagementUtil.createArtifactDirectory(artifactDirectoryPath); if (binaryFile != null) { try { @@ -171,7 +171,6 @@ public class ApplicationStorageManagerImpl implements ApplicationStorageManager + applicationUUID, e); } } - } @Override diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/util/StorageManagementUtil.java b/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/util/StorageManagementUtil.java index 4c8f01250d..94b05a69ee 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/util/StorageManagementUtil.java +++ b/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/util/StorageManagementUtil.java @@ -21,7 +21,6 @@ package org.wso2.carbon.device.application.mgt.core.util; import org.apache.commons.codec.binary.Base64; import org.apache.commons.io.IOUtils; import org.wso2.carbon.device.application.mgt.common.ImageArtifact; -import org.wso2.carbon.device.application.mgt.common.exception.ApplicationStorageManagementException; import org.wso2.carbon.device.application.mgt.common.exception.ResourceManagementException; import java.io.File; @@ -32,12 +31,15 @@ import java.io.InputStream; import java.io.OutputStream; import java.nio.file.Files; +/** + * This is a util class that handles Storage Management related tasks. + */ public class StorageManagementUtil { /** * This method is responsible for creating artifact parent directories in the given path. * * @param artifactDirectoryPath Path for the artifact directory. - * @throws ApplicationStorageManagementException Application Storage Management Exception. + * @throws ResourceManagementException Resource Management Exception. */ public static void createArtifactDirectory(String artifactDirectoryPath) throws ResourceManagementException { File artifactDirectory = new File(artifactDirectoryPath); @@ -65,7 +67,6 @@ public class StorageManagementUtil { artifactDirectory.delete(); } - /** * To save a file in a given location. *