diff options
author | Abyss777 <abyss@fox5.ru> | 2016-08-03 17:53:54 +0500 |
---|---|---|
committer | Abyss777 <abyss@fox5.ru> | 2016-08-04 16:33:34 +0500 |
commit | 504a555b40ee0c2c14e8679ed320b8c2578f8610 (patch) | |
tree | d6b0fb2fb95253afcbe7dd7fcb1cbf367b45acc6 /src/org/traccar/api/BaseResource.java | |
parent | a5c431069ca0dfe8240f0c8b43f0508189f8fc86 (diff) | |
download | trackermap-server-504a555b40ee0c2c14e8679ed320b8c2578f8610.tar.gz trackermap-server-504a555b40ee0c2c14e8679ed320b8c2578f8610.tar.bz2 trackermap-server-504a555b40ee0c2c14e8679ed320b8c2578f8610.zip |
- Moved retrieving Accept to BaseResource
- Added Events report
- Removed deviceIds from csv
Diffstat (limited to 'src/org/traccar/api/BaseResource.java')
-rw-r--r-- | src/org/traccar/api/BaseResource.java | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/org/traccar/api/BaseResource.java b/src/org/traccar/api/BaseResource.java index 97f5c074d..8259f8868 100644 --- a/src/org/traccar/api/BaseResource.java +++ b/src/org/traccar/api/BaseResource.java @@ -15,6 +15,7 @@ */ package org.traccar.api; +import javax.ws.rs.core.HttpHeaders; import javax.ws.rs.core.SecurityContext; public class BaseResource { @@ -22,6 +23,9 @@ public class BaseResource { @javax.ws.rs.core.Context private SecurityContext securityContext; + @javax.ws.rs.core.Context + private HttpHeaders headers; + protected long getUserId() { UserPrincipal principal = (UserPrincipal) securityContext.getUserPrincipal(); if (principal != null) { @@ -30,4 +34,8 @@ public class BaseResource { return 0; } + protected String getAcceptHeader() { + return headers.getRequestHeaders().getFirst("Accept"); + } + } |