Enum Class FileFormat

java.lang.Object
java.lang.Enum<FileFormat>
org.eclipse.hono.config.FileFormat
All Implemented Interfaces:
Serializable, Comparable<FileFormat>, Constable

public enum FileFormat extends Enum<FileFormat>
File formats for using key materials.
  • Enum Constant Details

    • PEM

      public static final FileFormat PEM
      PEM encoded PKCS#1 or PKCS#8.
    • JKS

      public static final FileFormat JKS
      Java Key Store.
    • PKCS12

      public static final FileFormat PKCS12
      PKCS#12 key store.
  • Method Details

    • values

      public static FileFormat[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static FileFormat valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • orDetect

      public static FileFormat orDetect(FileFormat format, String path)
      Use the provided file format or detect. If the file format is not provided the method will try to detect it by a call to detect(String).
      Parameters:
      format - The provided format, may be null
      path - The path to check, may be null.
      Returns:
      The provided or detected file format or null, if the path is null or the format could not be detected. Never returns null when parameter format is not null.
    • detect

      public static FileFormat detect(String path)
      Detects the file format based on a file name's extension.
      Parameters:
      path - The relative or absolute file name, may be null.
      Returns:
      The file format or null if the path is null or the file name's extension is not supported.