aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2015-12-02 12:12:39 +1300
committerAnton Tananaev <anton.tananaev@gmail.com>2015-12-02 12:12:39 +1300
commit2d934d61544b1fbe3e8ec733988f90a358809956 (patch)
tree4274686a900f86fc9d1f745ae207c63c6eb9d30b /src/org/traccar
parent84d2b260896e336482c302cf2a52a79c013ee13e (diff)
downloadtrackermap-server-2d934d61544b1fbe3e8ec733988f90a358809956.tar.gz
trackermap-server-2d934d61544b1fbe3e8ec733988f90a358809956.tar.bz2
trackermap-server-2d934d61544b1fbe3e8ec733988f90a358809956.zip
Clean up unused imports and var names
Diffstat (limited to 'src/org/traccar')
-rw-r--r--src/org/traccar/api/SecurityRequestFilter.java6
-rw-r--r--src/org/traccar/api/resource/ServerResource.java5
-rw-r--r--src/org/traccar/api/resource/SessionResource.java9
3 files changed, 7 insertions, 13 deletions
diff --git a/src/org/traccar/api/SecurityRequestFilter.java b/src/org/traccar/api/SecurityRequestFilter.java
index 782ca7de5..f207b6bff 100644
--- a/src/org/traccar/api/SecurityRequestFilter.java
+++ b/src/org/traccar/api/SecurityRequestFilter.java
@@ -48,7 +48,7 @@ public class SecurityRequestFilter implements ContainerRequestFilter {
}
@javax.ws.rs.core.Context
- private HttpServletRequest req;
+ private HttpServletRequest request;
@javax.ws.rs.core.Context
private ResourceInfo resourceInfo;
@@ -75,9 +75,9 @@ public class SecurityRequestFilter implements ContainerRequestFilter {
throw new WebApplicationException(e);
}
- } else if (req.getSession() != null) {
+ } else if (request.getSession() != null) {
- Long userId = (Long) req.getSession().getAttribute(SessionResource.USER_ID_KEY);
+ Long userId = (Long) request.getSession().getAttribute(SessionResource.USER_ID_KEY);
if (userId != null) {
securityContext = new UserSecurityContext(new UserPrincipal(userId));
}
diff --git a/src/org/traccar/api/resource/ServerResource.java b/src/org/traccar/api/resource/ServerResource.java
index ffe6745f4..2c0373c62 100644
--- a/src/org/traccar/api/resource/ServerResource.java
+++ b/src/org/traccar/api/resource/ServerResource.java
@@ -18,19 +18,14 @@ package org.traccar.api.resource;
import org.traccar.Context;
import org.traccar.api.BaseResource;
import org.traccar.model.Server;
-import org.traccar.model.User;
import javax.annotation.security.PermitAll;
-import javax.servlet.http.HttpServletRequest;
import javax.ws.rs.Consumes;
-import javax.ws.rs.FormParam;
import javax.ws.rs.GET;
-import javax.ws.rs.POST;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;
import javax.ws.rs.WebApplicationException;
import javax.ws.rs.core.MediaType;
-import javax.ws.rs.core.Response;
import java.sql.SQLException;
@Path("server")
diff --git a/src/org/traccar/api/resource/SessionResource.java b/src/org/traccar/api/resource/SessionResource.java
index 53e29802c..554b6760e 100644
--- a/src/org/traccar/api/resource/SessionResource.java
+++ b/src/org/traccar/api/resource/SessionResource.java
@@ -27,7 +27,6 @@ import javax.ws.rs.FormParam;
import javax.ws.rs.GET;
import javax.ws.rs.POST;
import javax.ws.rs.Path;
-import javax.ws.rs.PathParam;
import javax.ws.rs.Produces;
import javax.ws.rs.WebApplicationException;
import javax.ws.rs.core.MediaType;
@@ -42,13 +41,13 @@ public class SessionResource extends BaseResource {
public static final String USER_ID_KEY = "userId";
@javax.ws.rs.core.Context
- private HttpServletRequest req;
+ private HttpServletRequest request;
@PermitAll
@GET
public User get() {
try {
- Long userId = (Long) req.getSession().getAttribute(USER_ID_KEY);
+ Long userId = (Long) request.getSession().getAttribute(USER_ID_KEY);
if (userId != null) {
return Context.getDataManager().getUser(userId);
} else {
@@ -65,7 +64,7 @@ public class SessionResource extends BaseResource {
try {
User user = Context.getDataManager().login(email, password);
if (user != null) {
- req.getSession().setAttribute(USER_ID_KEY, user.getId());
+ request.getSession().setAttribute(USER_ID_KEY, user.getId());
return user;
} else {
throw new WebApplicationException(Response.status(Response.Status.UNAUTHORIZED).build());
@@ -77,7 +76,7 @@ public class SessionResource extends BaseResource {
@DELETE
public Response remove() {
- req.getSession().removeAttribute(USER_ID_KEY);
+ request.getSession().removeAttribute(USER_ID_KEY);
return Response.noContent().build();
}