code formatting and updating comments, descriptions

revert-dabc3590
Nirothipan 7 years ago
parent 2ddfbed6db
commit cff69459be

@ -47,7 +47,6 @@ public class FileTransfer extends AndroidOperation implements Serializable {
this.fileURL = fileURL; this.fileURL = fileURL;
} }
public String getFtpPassword() { public String getFtpPassword() {
return ftpPassword; return ftpPassword;
} }

@ -233,7 +233,8 @@ public interface DeviceManagementAdminService {
consumes = MediaType.APPLICATION_JSON, consumes = MediaType.APPLICATION_JSON,
httpMethod = "POST", httpMethod = "POST",
value = "Transferring file to the device.", value = "Transferring file to the device.",
notes = "Using this API you have the option to transfer a file from FTP server to an Android device.", notes = "Using this API you have the option to transfer a file from SFTP/FTP server or using an " +
"HTTP link to the device or retrieve file from the device to FTP/SFTP server .",
response = Activity.class, response = Activity.class,
tags = "Android Device Management Administrative Service", tags = "Android Device Management Administrative Service",
extensions = { extensions = {
@ -245,7 +246,6 @@ public interface DeviceManagementAdminService {
@ApiResponses(value = { @ApiResponses(value = {
@ApiResponse( @ApiResponse(
code = 201, code = 201,
//todo
message = "File transferred.", message = "File transferred.",
response = Activity.class, response = Activity.class,
responseHeaders = { responseHeaders = {
@ -284,7 +284,8 @@ public interface DeviceManagementAdminService {
Response fileTransfer( Response fileTransfer(
@ApiParam( @ApiParam(
name = "fileTransfer", name = "fileTransfer",
value = "Provide the ID of the Android device. Multiple device IDs can be added by using comma separated values.", value = "Provide the ID of the Android device. Multiple device IDs can be added by using " +
"comma separated values.",
required = true) FileTransferBeanWrapper fileTransferBeanWrapper); required = true) FileTransferBeanWrapper fileTransferBeanWrapper);
@POST @POST

@ -94,17 +94,16 @@ public class DeviceManagementAdminServiceImpl implements DeviceManagementAdminSe
@Path("/file-transfer") @Path("/file-transfer")
@Override @Override
public Response fileTransfer(FileTransferBeanWrapper fileTransferBeanWrapper) { public Response fileTransfer(FileTransferBeanWrapper fileTransferBeanWrapper) {
if (log.isDebugEnabled()) { try {
log.debug("Invoking Android file transfer operation for " + fileTransferBeanWrapper.getDeviceIDs()); if (fileTransferBeanWrapper == null || fileTransferBeanWrapper.getOperation() == null) {
} String errorMessage = "The payload of the file transfer operation is incorrect.";
log.error(errorMessage);
try { throw new BadRequestException(
if (fileTransferBeanWrapper == null || fileTransferBeanWrapper.getOperation() == null) { new ErrorResponse.ErrorResponseBuilder().setCode(400l).setMessage(errorMessage).build());
String errorMessage = "The payload of the file transfer operation is incorrect."; }
log.error(errorMessage); if (fileTransferBeanWrapper.getDeviceIDs() != null && log.isDebugEnabled()) {
throw new BadRequestException( log.debug("Invoking Android file transfer operation for " + fileTransferBeanWrapper.getDeviceIDs());
new ErrorResponse.ErrorResponseBuilder().setCode(400l).setMessage(errorMessage).build()); }
}
FileTransfer file = fileTransferBeanWrapper.getOperation(); FileTransfer file = fileTransferBeanWrapper.getOperation();
ProfileOperation operation = new ProfileOperation(); ProfileOperation operation = new ProfileOperation();
if (fileTransferBeanWrapper.isUpload()) { if (fileTransferBeanWrapper.isUpload()) {

@ -32,6 +32,11 @@ var resetLoader = function () {
$('#lbl-execution').addClass("hidden"); $('#lbl-execution').addClass("hidden");
}; };
/**
* This changes the text box label when the operation is toggled between FILE UPLOAD and FILE DOWNLOAD
* and shows an info label for FILE UPLOAD regarding saving location.
* @param type
*/
function changeLabel(type) { function changeLabel(type) {
$(".modal #operation-error-msg").addClass("hidden"); $(".modal #operation-error-msg").addClass("hidden");
if (type == "no") { if (type == "no") {

Loading…
Cancel
Save