Refactoring

feature/appm-store/pbac
megala21 7 years ago
parent 2fcf1c4e70
commit 813302e555

@ -141,7 +141,7 @@ public class PlatformManagementAPIImpl implements PlatformManagementAPI {
+ tenantId, e); + tenantId, e);
return APIUtil.getResponse(e, Response.Status.NOT_FOUND); return APIUtil.getResponse(e, Response.Status.NOT_FOUND);
} catch (PlatformStorageManagementException e) { } catch (PlatformStorageManagementException e) {
log.error("Platform Storage Management Exception while trying to update the icon for the platform : " + id log.error("Platform Storage Management Exception while trying to get the icon for the platform : " + id
+ " for the tenant : " + tenantId, e); + " for the tenant : " + tenantId, e);
return APIUtil.getResponse(e, Response.Status.NOT_FOUND); return APIUtil.getResponse(e, Response.Status.NOT_FOUND);
} }

@ -69,12 +69,12 @@ public class PlatformStorageManagerImpl implements PlatformStorageManager {
+ "directly to the deployment location inside icon folder"); + "directly to the deployment location inside icon folder");
} }
if (platform.isShared() && tenantId != MultitenantConstants.SUPER_TENANT_ID) { if (platform.isShared() && tenantId != MultitenantConstants.SUPER_TENANT_ID) {
throw new PlatformStorageManagementException("Platform " + platformIdentifier + " is a share platform from " throw new PlatformStorageManagementException("Platform " + platformIdentifier
+ "super-tenant. Only the super-tenant users can modify it"); + " is a shared platform from super-tenant. Only the super-tenant users can modify it");
} }
if (log.isDebugEnabled()) { if (log.isDebugEnabled()) {
log.debug("Artifact Directory Path for saving the artifacts related with application " log.debug("Artifact Directory Path for saving the artifacts related with application " + platformIdentifier
+ platformIdentifier + " is " + storagePath); + " is " + storagePath);
} }
StorageManagementUtil.createArtifactDirectory(storagePath); StorageManagementUtil.createArtifactDirectory(storagePath);
if (iconFileStream != null) { if (iconFileStream != null) {
@ -82,8 +82,8 @@ public class PlatformStorageManagerImpl implements PlatformStorageManager {
saveFile(iconFileStream, storagePath + File.separator + platform.getId()); saveFile(iconFileStream, storagePath + File.separator + platform.getId());
} catch (IOException e) { } catch (IOException e) {
throw new ApplicationStorageManagementException( throw new ApplicationStorageManagementException(
"IO Exception while saving the icon file in the server for the platform " "IO Exception while saving the icon file in the server for the platform " + platformIdentifier,
+ platformIdentifier, e); e);
} }
} }
} }
@ -127,8 +127,8 @@ public class PlatformStorageManagerImpl implements PlatformStorageManager {
String imageArtifactPath = storagePath + platform.getId(); String imageArtifactPath = storagePath + platform.getId();
if (platform.isShared() && tenantId != MultitenantConstants.SUPER_TENANT_ID) { if (platform.isShared() && tenantId != MultitenantConstants.SUPER_TENANT_ID) {
throw new PlatformStorageManagementException("Platform " + platformIdentifier + " is a share platform from " throw new PlatformStorageManagementException("Platform " + platformIdentifier + " is a shared platform "
+ "super-tenant. Only the super-tenant users can modify it"); + "from super-tenant. Only the super-tenant users can modify it");
} }
if (platform.isFileBased()) { if (platform.isFileBased()) {
throw new PlatformStorageManagementException("Platform " + platformIdentifier + " is a file based one. " throw new PlatformStorageManagementException("Platform " + platformIdentifier + " is a file based one. "
@ -154,13 +154,14 @@ public class PlatformStorageManagerImpl implements PlatformStorageManager {
PlatformManager platformManager = DataHolder.getInstance().getPlatformManager(); PlatformManager platformManager = DataHolder.getInstance().getPlatformManager();
platform = platformManager.getPlatform(tenantId, identifier); platform = platformManager.getPlatform(tenantId, identifier);
} catch (PlatformManagementException e) { } catch (PlatformManagementException e) {
throw new PlatformStorageManagementException("Platform Management Exception while getting the platform " throw new PlatformStorageManagementException(
+ "related with the identifier " + identifier); "Platform Management Exception while getting the platform " + "related with the identifier "
+ identifier);
} }
if (platform == null) { if (platform == null) {
throw new PlatformStorageManagementException("Platform does not exist with the identifier " + identifier); throw new PlatformStorageManagementException("Platform does not exist with the identifier " + identifier);
} }
return platform; return platform;
} }
} }

Loading…
Cancel
Save