org.apache.commons.codec.BinaryEncoder Java Examples

The following examples show how to use org.apache.commons.codec.BinaryEncoder. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: LoggingTestBase.java    From appengine-tck with Apache License 2.0 6 votes vote down vote up
protected static WebArchive getDefaultDeployment(TestContext context) {
    context.setAppEngineWebXmlFile("appengine-web-with-logging-properties.xml");
    WebArchive war = getTckDeployment(context);
    war.addClasses(LoggingTestBase.class, TestBase.class)
        // classes for Base64.isBase64()
        .addClasses(Base64.class, BaseNCodec.class)
        .addClasses(BinaryEncoder.class, Encoder.class)
        .addClasses(BinaryDecoder.class, Decoder.class)
        .addClasses(EncoderException.class, DecoderException.class)
        .addAsWebInfResource("currentTimeUsec.jsp")
        .addAsWebInfResource("doNothing.jsp")
        .addAsWebInfResource("storeTestData.jsp")
        .addAsWebInfResource("throwException.jsp")
        .addAsWebInfResource("log4j-test.properties")
        .addAsWebInfResource("logging-all.properties");
    return war;
}
 
Example #2
Source File: DatastoreHelperTestBase.java    From appengine-tck with Apache License 2.0 5 votes vote down vote up
protected static WebArchive getHelperDeployment() {
    WebArchive war = getTckDeployment();
    war.addClass(DatastoreHelperTestBase.class)
        .addClasses(Base64.class, BaseNCodec.class)
        .addClasses(BinaryEncoder.class, Encoder.class)
        .addClasses(BinaryDecoder.class, Decoder.class)
        .addClasses(EncoderException.class, DecoderException.class);
    return war;
}
 
Example #3
Source File: DefaultHasher.java    From metron with Apache License 2.0 2 votes vote down vote up
/**
 * Builds a utility to hash values based on a given algorithm.
 * @param algorithm The algorithm used when hashing a value.
 * @param encoder The encoder to use to encode the hashed value.
 * @param charset The charset that will be used during hashing and encoding.
 * @see java.security.Security
 * @see java.security.MessageDigest
 */
public DefaultHasher(final String algorithm, final BinaryEncoder encoder, final Charset charset) {
  this.algorithm = algorithm;
  this.encoder = encoder;
  this.charset = charset;
}
 
Example #4
Source File: DefaultHasher.java    From metron with Apache License 2.0 2 votes vote down vote up
/**
 * Builds a utility to hash values based on a given algorithm. Uses {@link StandardCharsets#UTF_8} for encoding.
 * @param algorithm The algorithm used when hashing a value.
 * @param encoder The encoder to use to encode the hashed value.
 * @see java.security.Security
 * @see java.security.MessageDigest
 */
public DefaultHasher(final String algorithm, final BinaryEncoder encoder) {
  this.algorithm = algorithm;
  this.encoder = encoder;
  this.charset = StandardCharsets.UTF_8;
}