Changeset 8149 in josm for trunk/src/oauth


Ignore:
Timestamp:
2015-03-22T23:16:08+01:00 (5 years ago)
Author:
stoecker
Message:

fix #11257 - Remove apache.commons.codecs - patch by Florian Schaefer

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/oauth/signpost/signature/OAuthMessageSigner.java

    r4231 r8149  
    1717import java.io.IOException;
    1818import java.io.Serializable;
     19import javax.xml.bind.DatatypeConverter;
    1920
    2021import oauth.signpost.exception.OAuthMessageSignerException;
     
    2223import oauth.signpost.http.HttpParameters;
    2324
    24 import org.apache.commons.codec.binary.Base64;
    25 
    2625public abstract class OAuthMessageSigner implements Serializable {
    2726
    2827    private static final long serialVersionUID = 4445779788786131202L;
    29 
    30     private transient Base64 base64;
    3128
    3229    private String consumerSecret;
     
    3431    private String tokenSecret;
    3532
    36     public OAuthMessageSigner() {
    37         this.base64 = new Base64();
    38     }
    3933
    4034    public abstract String sign(HttpRequest request, HttpParameters requestParameters)
     
    6054
    6155    protected byte[] decodeBase64(String s) {
    62         return base64.decode(s.getBytes());
     56        return DatatypeConverter.parseBase64Binary(s);
    6357    }
    6458
    6559    protected String base64Encode(byte[] b) {
    66         return new String(base64.encode(b));
     60        return DatatypeConverter.printBase64Binary(b);
    6761    }
    6862
     
    7064            throws IOException, ClassNotFoundException {
    7165        stream.defaultReadObject();
    72         this.base64 = new Base64();
    7366    }
    7467}
Note: See TracChangeset for help on using the changeset viewer.