Merge branch 'release-2.0.x' of https://github.com/wso2/carbon-device-mgt into release-2.0.x

4.x.x
Rasika Perera 8 years ago
commit 7612f064fe

@ -119,7 +119,7 @@ public class ApiPermissionFilter implements Filter {
.getThreadLocalCarbonContext().getTenantId());
return userRealm.getAuthorizationManager().isUserAuthorized(username, permission, action);
} catch (UserStoreException e) {
String errorMsg = String.format("Unable to authorize the user : %s", username, e);
String errorMsg = String.format("Unable to authorize the user : %s", username);
log.error(errorMsg, e);
return false;
}

@ -83,11 +83,7 @@ public class GsonMessageBodyHandler implements MessageBodyWriter<Object>, Messag
OutputStreamWriter writer = new OutputStreamWriter(entityStream, UTF_8);
try {
Type jsonType = null;
if (type.equals(type)) {
jsonType = type;
}
getGson().toJson(object, jsonType, writer);
getGson().toJson(object, type, writer);
} finally {
writer.close();
}

@ -83,11 +83,7 @@ public class GsonMessageBodyHandler implements MessageBodyWriter<Object>, Messag
OutputStreamWriter writer = new OutputStreamWriter(entityStream, UTF_8);
try {
Type jsonType = null;
if (type.equals(type)) {
jsonType = type;
}
getGson().toJson(object, jsonType, writer);
getGson().toJson(object, type, writer);
} finally {
writer.close();
}

@ -91,6 +91,7 @@
<Import-Package>
javax.naming,
javax.sql,
javax.xml,
javax.xml.bind,
javax.xml.bind.annotation,
javax.xml.parsers; version="${javax.xml.parsers.import.pkg.version}",

@ -21,8 +21,10 @@ package org.wso2.carbon.device.mgt.extensions.device.type.deployer.util;
import org.w3c.dom.Document;
import org.wso2.carbon.device.mgt.extensions.device.type.deployer.config.exception.DeviceTypeConfigurationException;
import javax.xml.XMLConstants;
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.parsers.ParserConfigurationException;
import java.io.File;
/**
@ -34,8 +36,12 @@ public class DeviceTypeConfigUtil {
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
factory.setNamespaceAware(true);
try {
factory.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, true);
DocumentBuilder docBuilder = factory.newDocumentBuilder();
return docBuilder.parse(file);
} catch (ParserConfigurationException e) {
e.printStackTrace();
return null;
} catch (Exception e) {
throw new DeviceTypeConfigurationException("Error occurred while parsing file, while converting " +
"to a org.w3c.dom.Document", e);

@ -83,11 +83,7 @@ public class GsonMessageBodyHandler implements MessageBodyWriter<Object>, Messag
OutputStreamWriter writer = new OutputStreamWriter(entityStream, UTF_8);
try {
Type jsonType = null;
if (type.equals(type)) {
jsonType = type;
}
getGson().toJson(object, jsonType, writer);
getGson().toJson(object, type, writer);
} finally {
writer.close();
}

@ -370,7 +370,7 @@ public class DeviceInfo implements Serializable {
}
public Date getUpdatedTime() {
if(updatedTime.equals(null)){
if(updatedTime == null){
updatedTime = new Date();
}
return updatedTime;

@ -137,7 +137,7 @@ public class DeviceLocation implements Serializable {
}
public Date getUpdatedTime() {
if(updatedTime.equals(null)){
if(updatedTime == null ){
updatedTime = new Date();
}
return updatedTime;

@ -48,6 +48,10 @@ public class NotificationContext {
return properties;
}
public void setProperties(Map<String, String> propertiesMap) {
properties = propertiesMap;
}
public Operation getOperation() {
return operation;
}

@ -90,6 +90,9 @@ public class JWTAuthenticator implements WebappAuthenticator {
if (requestUri == null || "".equals(requestUri)) {
authenticationInfo.setStatus(Status.CONTINUE);
}
if (requestUri == null) {
requestUri = "";
}
StringTokenizer tokenizer = new StringTokenizer(requestUri, "/");
String context = tokenizer.nextToken();
if (context == null || "".equals(context)) {

Loading…
Cancel
Save