|
|
@ -232,7 +232,6 @@ public class ApplicationManagementAPIImpl implements ApplicationManagementAPI {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
applicationRelease = applicationStorageManager
|
|
|
|
applicationRelease = applicationStorageManager
|
|
|
|
.updateImageArtifacts(applicationRelease, iconFileStream, bannerFileStream, attachments);
|
|
|
|
.updateImageArtifacts(applicationRelease, iconFileStream, bannerFileStream, attachments);
|
|
|
|
//todo need to implement updateRelease method
|
|
|
|
|
|
|
|
applicationManager.updateRelease(appId, applicationRelease);
|
|
|
|
applicationManager.updateRelease(appId, applicationRelease);
|
|
|
|
return Response.status(Response.Status.OK)
|
|
|
|
return Response.status(Response.Status.OK)
|
|
|
|
.entity("Successfully uploaded artifacts for the application " + applicationUuid).build();
|
|
|
|
.entity("Successfully uploaded artifacts for the application " + applicationUuid).build();
|
|
|
@ -262,7 +261,7 @@ public class ApplicationManagementAPIImpl implements ApplicationManagementAPI {
|
|
|
|
public Response updateApplicationArtifact(
|
|
|
|
public Response updateApplicationArtifact(
|
|
|
|
@PathParam("appType") String appType,
|
|
|
|
@PathParam("appType") String appType,
|
|
|
|
@PathParam("appId") int applicationId,
|
|
|
|
@PathParam("appId") int applicationId,
|
|
|
|
@PathParam("uuid") String applicationUuuid,
|
|
|
|
@PathParam("uuid") String applicationUuid,
|
|
|
|
@Multipart("binaryFile") Attachment binaryFile) {
|
|
|
|
@Multipart("binaryFile") Attachment binaryFile) {
|
|
|
|
ApplicationStorageManager applicationStorageManager = APIUtil.getApplicationStorageManager();
|
|
|
|
ApplicationStorageManager applicationStorageManager = APIUtil.getApplicationStorageManager();
|
|
|
|
ApplicationManager applicationManager = APIUtil.getApplicationManager();
|
|
|
|
ApplicationManager applicationManager = APIUtil.getApplicationManager();
|
|
|
@ -272,27 +271,26 @@ public class ApplicationManagementAPIImpl implements ApplicationManagementAPI {
|
|
|
|
|
|
|
|
|
|
|
|
if (binaryFile == null) {
|
|
|
|
if (binaryFile == null) {
|
|
|
|
return Response.status(Response.Status.BAD_REQUEST)
|
|
|
|
return Response.status(Response.Status.BAD_REQUEST)
|
|
|
|
.entity("Uploading artifacts for the application is failed " + applicationUuuid).build();
|
|
|
|
.entity("Uploading artifacts for the application is failed " + applicationUuid).build();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
applicationRelease = applicationManager.validateApplicationRelease(applicationUuuid);
|
|
|
|
applicationRelease = applicationManager.validateApplicationRelease(applicationUuid);
|
|
|
|
applicationRelease = applicationStorageManager.updateReleaseArtifacts(applicationRelease, appType,
|
|
|
|
applicationRelease = applicationStorageManager.updateReleaseArtifacts(applicationRelease, appType,
|
|
|
|
binaryFile.getDataHandler().getInputStream());
|
|
|
|
binaryFile.getDataHandler().getInputStream());
|
|
|
|
//todo
|
|
|
|
|
|
|
|
applicationManager.updateRelease(applicationId, applicationRelease);
|
|
|
|
applicationManager.updateRelease(applicationId, applicationRelease);
|
|
|
|
return Response.status(Response.Status.OK)
|
|
|
|
return Response.status(Response.Status.OK)
|
|
|
|
.entity("Successfully uploaded artifacts for the application " + applicationUuuid).build();
|
|
|
|
.entity("Successfully uploaded artifacts for the application " + applicationUuid).build();
|
|
|
|
} catch (IOException e) {
|
|
|
|
} catch (IOException e) {
|
|
|
|
log.error("Exception while trying to read icon, banner files for the application " + applicationUuuid);
|
|
|
|
log.error("Exception while trying to read icon, banner files for the application " + applicationUuid);
|
|
|
|
return APIUtil.getResponse(new ApplicationManagementException(
|
|
|
|
return APIUtil.getResponse(new ApplicationManagementException(
|
|
|
|
"Exception while trying to read icon, banner files for the application " + applicationUuuid, e),
|
|
|
|
"Exception while trying to read icon, banner files for the application " + applicationUuid, e),
|
|
|
|
Response.Status.BAD_REQUEST);
|
|
|
|
Response.Status.BAD_REQUEST);
|
|
|
|
} catch (ResourceManagementException e) {
|
|
|
|
} catch (ResourceManagementException e) {
|
|
|
|
log.error("Error occurred while uploading the image artifacts of the application with the uuid "
|
|
|
|
log.error("Error occurred while uploading the image artifacts of the application with the uuid "
|
|
|
|
+ applicationUuuid, e);
|
|
|
|
+ applicationUuid, e);
|
|
|
|
return APIUtil.getResponse(e, Response.Status.INTERNAL_SERVER_ERROR);
|
|
|
|
return APIUtil.getResponse(e, Response.Status.INTERNAL_SERVER_ERROR);
|
|
|
|
} catch (ApplicationManagementException e) {
|
|
|
|
} catch (ApplicationManagementException e) {
|
|
|
|
log.error("Error occurred while updating the image artifacts of the application with the uuid "
|
|
|
|
log.error("Error occurred while updating the image artifacts of the application with the uuid "
|
|
|
|
+ applicationUuuid, e);
|
|
|
|
+ applicationUuid, e);
|
|
|
|
return APIUtil.getResponse(e, Response.Status.INTERNAL_SERVER_ERROR);
|
|
|
|
return APIUtil.getResponse(e, Response.Status.INTERNAL_SERVER_ERROR);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -361,8 +359,6 @@ public class ApplicationManagementAPIImpl implements ApplicationManagementAPI {
|
|
|
|
|
|
|
|
|
|
|
|
applicationRelease = applicationStorageManager
|
|
|
|
applicationRelease = applicationStorageManager
|
|
|
|
.updateImageArtifacts(applicationRelease, iconFileStream, bannerFileStream, attachments);
|
|
|
|
.updateImageArtifacts(applicationRelease, iconFileStream, bannerFileStream, attachments);
|
|
|
|
|
|
|
|
|
|
|
|
//todo
|
|
|
|
|
|
|
|
applicationRelease = applicationManager.updateRelease(applicationId, applicationRelease);
|
|
|
|
applicationRelease = applicationManager.updateRelease(applicationId, applicationRelease);
|
|
|
|
|
|
|
|
|
|
|
|
return Response.status(Response.Status.OK).entity(applicationRelease).build();
|
|
|
|
return Response.status(Response.Status.OK).entity(applicationRelease).build();
|
|
|
|