aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/api/resource
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/api/resource
parent84d2b260896e336482c302cf2a52a79c013ee13e (diff)
downloadtraccar-server-2d934d61544b1fbe3e8ec733988f90a358809956.tar.gz
traccar-server-2d934d61544b1fbe3e8ec733988f90a358809956.tar.bz2
traccar-server-2d934d61544b1fbe3e8ec733988f90a358809956.zip
Clean up unused imports and var names
Diffstat (limited to 'src/org/traccar/api/resource')
-rw-r--r--src/org/traccar/api/resource/ServerResource.java5
-rw-r--r--src/org/traccar/api/resource/SessionResource.java9
2 files changed, 4 insertions, 10 deletions
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();
}