aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/api
diff options
context:
space:
mode:
authorGabor Somogyi <Gabor_Somogyi@epam.com>2016-05-04 14:36:18 +0200
committerGabor Somogyi <Gabor_Somogyi@epam.com>2016-05-04 14:39:03 +0200
commit516ef6a30eb59e1b9c3aa297e3595c5acf665530 (patch)
tree2bed5e621be4786816bbf3d6adabe41d2d43fbdb /src/org/traccar/api
parent5bf82eff1ecac7b23661cea14be26aa7a3e4d09a (diff)
parent59f466092c9c875c2bbcb70a2a402aad0edd7639 (diff)
downloadtraccar-server-516ef6a30eb59e1b9c3aa297e3595c5acf665530.tar.gz
traccar-server-516ef6a30eb59e1b9c3aa297e3595c5acf665530.tar.bz2
traccar-server-516ef6a30eb59e1b9c3aa297e3595c5acf665530.zip
Merge branch 'master' into command_framework
Diffstat (limited to 'src/org/traccar/api')
-rw-r--r--src/org/traccar/api/BaseResource.java3
-rw-r--r--src/org/traccar/api/CorsResponseFilter.java2
-rw-r--r--src/org/traccar/api/SecurityRequestFilter.java8
-rw-r--r--src/org/traccar/api/UserSecurityContext.java2
-rw-r--r--src/org/traccar/api/resource/DeviceResource.java3
-rw-r--r--src/org/traccar/api/resource/UserResource.java12
6 files changed, 13 insertions, 17 deletions
diff --git a/src/org/traccar/api/BaseResource.java b/src/org/traccar/api/BaseResource.java
index 4dafc084c..97f5c074d 100644
--- a/src/org/traccar/api/BaseResource.java
+++ b/src/org/traccar/api/BaseResource.java
@@ -15,9 +15,6 @@
*/
package org.traccar.api;
-import javax.annotation.security.PermitAll;
-import javax.ws.rs.OPTIONS;
-import javax.ws.rs.core.Response;
import javax.ws.rs.core.SecurityContext;
public class BaseResource {
diff --git a/src/org/traccar/api/CorsResponseFilter.java b/src/org/traccar/api/CorsResponseFilter.java
index 67d312504..459fcee66 100644
--- a/src/org/traccar/api/CorsResponseFilter.java
+++ b/src/org/traccar/api/CorsResponseFilter.java
@@ -18,10 +18,10 @@ package org.traccar.api;
import org.jboss.netty.handler.codec.http.HttpHeaders;
import org.traccar.Context;
-import java.io.IOException;
import javax.ws.rs.container.ContainerRequestContext;
import javax.ws.rs.container.ContainerResponseContext;
import javax.ws.rs.container.ContainerResponseFilter;
+import java.io.IOException;
public class CorsResponseFilter implements ContainerResponseFilter {
diff --git a/src/org/traccar/api/SecurityRequestFilter.java b/src/org/traccar/api/SecurityRequestFilter.java
index 0f0de2dec..f0dd363db 100644
--- a/src/org/traccar/api/SecurityRequestFilter.java
+++ b/src/org/traccar/api/SecurityRequestFilter.java
@@ -19,9 +19,6 @@ import org.traccar.Context;
import org.traccar.api.resource.SessionResource;
import org.traccar.model.User;
-import java.lang.reflect.Method;
-import java.nio.charset.Charset;
-import java.sql.SQLException;
import javax.annotation.security.PermitAll;
import javax.servlet.http.HttpServletRequest;
import javax.ws.rs.WebApplicationException;
@@ -31,6 +28,9 @@ import javax.ws.rs.container.ResourceInfo;
import javax.ws.rs.core.Response;
import javax.ws.rs.core.SecurityContext;
import javax.xml.bind.DatatypeConverter;
+import java.lang.reflect.Method;
+import java.nio.charset.StandardCharsets;
+import java.sql.SQLException;
public class SecurityRequestFilter implements ContainerRequestFilter {
@@ -42,7 +42,7 @@ public class SecurityRequestFilter implements ContainerRequestFilter {
auth = auth.replaceFirst("[B|b]asic ", "");
byte[] decodedBytes = DatatypeConverter.parseBase64Binary(auth);
if (decodedBytes != null && decodedBytes.length > 0) {
- return new String(decodedBytes, Charset.defaultCharset()).split(":", 2);
+ return new String(decodedBytes, StandardCharsets.US_ASCII).split(":", 2);
}
return null;
}
diff --git a/src/org/traccar/api/UserSecurityContext.java b/src/org/traccar/api/UserSecurityContext.java
index 127aee4b3..0ff67a0f8 100644
--- a/src/org/traccar/api/UserSecurityContext.java
+++ b/src/org/traccar/api/UserSecurityContext.java
@@ -15,8 +15,8 @@
*/
package org.traccar.api;
-import java.security.Principal;
import javax.ws.rs.core.SecurityContext;
+import java.security.Principal;
public class UserSecurityContext implements SecurityContext {
diff --git a/src/org/traccar/api/resource/DeviceResource.java b/src/org/traccar/api/resource/DeviceResource.java
index 5c58d3b32..18c4cb0ce 100644
--- a/src/org/traccar/api/resource/DeviceResource.java
+++ b/src/org/traccar/api/resource/DeviceResource.java
@@ -17,9 +17,8 @@ package org.traccar.api.resource;
import org.traccar.Context;
import org.traccar.api.BaseResource;
+import org.traccar.model.Device;
-import java.sql.SQLException;
-import java.util.Collection;
import javax.ws.rs.Consumes;
import javax.ws.rs.DELETE;
import javax.ws.rs.GET;
diff --git a/src/org/traccar/api/resource/UserResource.java b/src/org/traccar/api/resource/UserResource.java
index 9eb0d9597..0b307ab88 100644
--- a/src/org/traccar/api/resource/UserResource.java
+++ b/src/org/traccar/api/resource/UserResource.java
@@ -15,8 +15,10 @@
*/
package org.traccar.api.resource;
-import java.sql.SQLException;
-import java.util.Collection;
+import org.traccar.Context;
+import org.traccar.api.BaseResource;
+import org.traccar.model.User;
+
import javax.annotation.security.PermitAll;
import javax.ws.rs.Consumes;
import javax.ws.rs.DELETE;
@@ -28,10 +30,8 @@ import javax.ws.rs.PathParam;
import javax.ws.rs.Produces;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;
-
-import org.traccar.Context;
-import org.traccar.api.BaseResource;
-import org.traccar.model.User;
+import java.sql.SQLException;
+import java.util.Collection;
@Path("users")
@Produces(MediaType.APPLICATION_JSON)