Changed getTenantconfiguration implementation.

This commit is contained in:
harshanl 2015-10-15 12:31:26 +05:30
parent c3517b2fc8
commit e7733f2b12
2 changed files with 9 additions and 6 deletions

View File

@ -121,7 +121,7 @@ public class AndroidDeviceManager implements DeviceManager {
new StringReader(new String((byte[]) resource.getContent(), Charset.
forName(MobilePluginConstants.CHARSET_UTF8))));
}
return new TenantConfiguration();
return null;
} catch (MobileDeviceMgtPluginException e) {
throw new DeviceManagementException(
"Error occurred while retrieving the Registry instance : " + e.getMessage(), e);

View File

@ -106,11 +106,14 @@ public class WindowsDeviceManager implements DeviceManager {
MobileDeviceManagementUtil.getPlatformConfigPath(DeviceManagementConstants.
MobileDeviceTypes.MOBILE_DEVICE_TYPE_WINDOWS);
resource = MobileDeviceManagementUtil.getRegistryResource(windowsTenantRegistryPath);
JAXBContext context = JAXBContext.newInstance(TenantConfiguration.class);
Unmarshaller unmarshaller = context.createUnmarshaller();
return (TenantConfiguration) unmarshaller.unmarshal(
new StringReader(new String((byte[]) resource.getContent(), Charset
.forName(MobilePluginConstants.CHARSET_UTF8))));
if(resource != null){
JAXBContext context = JAXBContext.newInstance(TenantConfiguration.class);
Unmarshaller unmarshaller = context.createUnmarshaller();
return (TenantConfiguration) unmarshaller.unmarshal(
new StringReader(new String((byte[]) resource.getContent(), Charset.
forName(MobilePluginConstants.CHARSET_UTF8))));
}
return null;
} catch (MobileDeviceMgtPluginException e) {
throw new DeviceManagementException(
"Error occurred while retrieving the Registry instance : " + e.getMessage(), e);