Example usage for org.apache.hadoop.crypto CryptoProtocolVersion supports

List of usage examples for org.apache.hadoop.crypto CryptoProtocolVersion supports

Introduction

In this page you can find the example usage for org.apache.hadoop.crypto CryptoProtocolVersion supports.

Prototype

public static boolean supports(CryptoProtocolVersion version) 

Source Link

Document

Returns if a given protocol version is supported.

Usage

From source file:com.mellanox.r4h.DFSClient.java

License:Apache License

/**
 * Obtain the crypto protocol version from the provided FileEncryptionInfo,
 * checking to see if this version is supported by.
 * /*w  w w.j  a v  a  2s .  co m*/
 * @param feInfo
 *            FileEncryptionInfo
 * @return CryptoProtocolVersion from the feInfo
 * @throws IOException
 *             if the protocol version is unsupported.
 */
private static CryptoProtocolVersion getCryptoProtocolVersion(FileEncryptionInfo feInfo) throws IOException {
    final CryptoProtocolVersion version = feInfo.getCryptoProtocolVersion();
    if (!CryptoProtocolVersion.supports(version)) {
        throw new IOException("Client does not support specified " + "CryptoProtocolVersion "
                + version.getDescription() + " version " + "number" + version.getVersion());
    }
    return version;
}