diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2015-12-02 12:12:39 +1300 |
---|---|---|
committer | Anton Tananaev <anton.tananaev@gmail.com> | 2015-12-02 12:12:39 +1300 |
commit | 2d934d61544b1fbe3e8ec733988f90a358809956 (patch) | |
tree | 4274686a900f86fc9d1f745ae207c63c6eb9d30b /src/org/traccar/api/resource/SessionResource.java | |
parent | 84d2b260896e336482c302cf2a52a79c013ee13e (diff) | |
download | traccar-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/SessionResource.java')
-rw-r--r-- | src/org/traccar/api/resource/SessionResource.java | 9 |
1 files changed, 4 insertions, 5 deletions
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(); } |