diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2018-03-10 16:23:06 +1300 |
---|---|---|
committer | Anton Tananaev <anton.tananaev@gmail.com> | 2018-03-10 16:23:06 +1300 |
commit | a58b40a49e96f8fc876b88b6b10489f8532893d9 (patch) | |
tree | 4ed73b40eda9b3c560d3a10519ee210461d2c5ae /src/org/traccar/api/resource/SessionResource.java | |
parent | 4d7c36cbd2ec7f6e7d971f4de013603d4cb80d0e (diff) | |
download | trackermap-server-a58b40a49e96f8fc876b88b6b10489f8532893d9.tar.gz trackermap-server-a58b40a49e96f8fc876b88b6b10489f8532893d9.tar.bz2 trackermap-server-a58b40a49e96f8fc876b88b6b10489f8532893d9.zip |
Replace deprecated classes
Diffstat (limited to 'src/org/traccar/api/resource/SessionResource.java')
-rw-r--r-- | src/org/traccar/api/resource/SessionResource.java | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/org/traccar/api/resource/SessionResource.java b/src/org/traccar/api/resource/SessionResource.java index 2a0bd4364..fd331c766 100644 --- a/src/org/traccar/api/resource/SessionResource.java +++ b/src/org/traccar/api/resource/SessionResource.java @@ -17,6 +17,7 @@ package org.traccar.api.resource; import org.traccar.Context; import org.traccar.api.BaseResource; +import org.traccar.helper.DataConverter; import org.traccar.helper.LogAction; import org.traccar.model.User; @@ -34,7 +35,6 @@ import javax.ws.rs.QueryParam; import javax.ws.rs.WebApplicationException; import javax.ws.rs.core.MediaType; import javax.ws.rs.core.Response; -import javax.xml.bind.DatatypeConverter; import java.io.UnsupportedEncodingException; import java.net.URLDecoder; @@ -63,11 +63,11 @@ public class SessionResource extends BaseResource { if (cookies != null) { for (Cookie cookie : cookies) { if (cookie.getName().equals(USER_COOKIE_KEY)) { - byte[] emailBytes = DatatypeConverter.parseBase64Binary( + byte[] emailBytes = DataConverter.parseBase64( URLDecoder.decode(cookie.getValue(), StandardCharsets.US_ASCII.name())); email = new String(emailBytes, StandardCharsets.UTF_8); } else if (cookie.getName().equals(PASS_COOKIE_KEY)) { - byte[] passwordBytes = DatatypeConverter.parseBase64Binary( + byte[] passwordBytes = DataConverter.parseBase64( URLDecoder.decode(cookie.getValue(), StandardCharsets.US_ASCII.name())); password = new String(passwordBytes, StandardCharsets.UTF_8); } |