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

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

Introduction

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

Prototype

public int getVersion() 

Source Link

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  ww  .jav a 2  s  .  c o  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;
}