diff --git a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/FileTransfer.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/FileTransfer.java index e4488952d..0ecf3d4fe 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/FileTransfer.java +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/FileTransfer.java @@ -47,7 +47,6 @@ public class FileTransfer extends AndroidOperation implements Serializable { this.fileURL = fileURL; } - public String getFtpPassword() { return ftpPassword; } diff --git a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/services/DeviceManagementAdminService.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/services/DeviceManagementAdminService.java index 90fd3e877..c8bd68d9c 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/services/DeviceManagementAdminService.java +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/services/DeviceManagementAdminService.java @@ -233,7 +233,8 @@ public interface DeviceManagementAdminService { consumes = MediaType.APPLICATION_JSON, httpMethod = "POST", 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, tags = "Android Device Management Administrative Service", extensions = { @@ -245,7 +246,6 @@ public interface DeviceManagementAdminService { @ApiResponses(value = { @ApiResponse( code = 201, - //todo message = "File transferred.", response = Activity.class, responseHeaders = { @@ -284,7 +284,8 @@ public interface DeviceManagementAdminService { Response fileTransfer( @ApiParam( 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); @POST diff --git a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/services/impl/DeviceManagementAdminServiceImpl.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/services/impl/DeviceManagementAdminServiceImpl.java index 7974f00cb..6fa0d1fd2 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/services/impl/DeviceManagementAdminServiceImpl.java +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/services/impl/DeviceManagementAdminServiceImpl.java @@ -94,17 +94,16 @@ public class DeviceManagementAdminServiceImpl implements DeviceManagementAdminSe @Path("/file-transfer") @Override public Response fileTransfer(FileTransferBeanWrapper fileTransferBeanWrapper) { - if (log.isDebugEnabled()) { - log.debug("Invoking Android file transfer operation for " + fileTransferBeanWrapper.getDeviceIDs()); - } - - try { - if (fileTransferBeanWrapper == null || fileTransferBeanWrapper.getOperation() == null) { - String errorMessage = "The payload of the file transfer operation is incorrect."; - log.error(errorMessage); - throw new BadRequestException( - new ErrorResponse.ErrorResponseBuilder().setCode(400l).setMessage(errorMessage).build()); - } + try { + if (fileTransferBeanWrapper == null || fileTransferBeanWrapper.getOperation() == null) { + String errorMessage = "The payload of the file transfer operation is incorrect."; + log.error(errorMessage); + throw new BadRequestException( + new ErrorResponse.ErrorResponseBuilder().setCode(400l).setMessage(errorMessage).build()); + } + if (fileTransferBeanWrapper.getDeviceIDs() != null && log.isDebugEnabled()) { + log.debug("Invoking Android file transfer operation for " + fileTransferBeanWrapper.getDeviceIDs()); + } FileTransfer file = fileTransferBeanWrapper.getOperation(); ProfileOperation operation = new ProfileOperation(); if (fileTransferBeanWrapper.isUpload()) { diff --git a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android.operation-bar/public/js/operation-bar.js b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android.operation-bar/public/js/operation-bar.js index aebf833f0..ea8c424da 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android.operation-bar/public/js/operation-bar.js +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android.operation-bar/public/js/operation-bar.js @@ -32,6 +32,11 @@ var resetLoader = function () { $('#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) { $(".modal #operation-error-msg").addClass("hidden"); if (type == "no") {