Changeset 10618 in josm for trunk/src/org/openstreetmap/josm/io
- Timestamp:
- 2016-07-23T23:54:27+02:00 (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/io/OsmConnection.java
r10615 r10618 8 8 import java.net.MalformedURLException; 9 9 import java.net.URL; 10 import java.nio.ByteBuffer;11 import java.nio.CharBuffer;12 import java.nio.charset.CharacterCodingException;13 10 import java.nio.charset.StandardCharsets; 11 import java.util.Base64; 14 12 import java.util.Objects; 15 13 import java.util.concurrent.FutureTask; … … 24 22 import org.openstreetmap.josm.io.auth.CredentialsAgentResponse; 25 23 import org.openstreetmap.josm.io.auth.CredentialsManager; 26 import org.openstreetmap.josm.tools.Base64;27 24 import org.openstreetmap.josm.tools.HttpClient; 28 25 import org.openstreetmap.josm.tools.Utils; … … 80 77 String password = response.getPassword() == null ? "" : String.valueOf(response.getPassword()); 81 78 token = username + ':' + password; 82 try { 83 ByteBuffer bytes = StandardCharsets.UTF_8.newEncoder().encode(CharBuffer.wrap(token)); 84 con.setHeader("Authorization", "Basic "+Base64.encode(bytes)); 85 } catch (CharacterCodingException e) { 86 throw new OsmTransferException(e); 87 } 79 con.setHeader("Authorization", "Basic "+Base64.getEncoder().encodeToString(token.getBytes(StandardCharsets.UTF_8))); 88 80 } 89 81 }
Note:
See TracChangeset
for help on using the changeset viewer.