Enum FileFormat

    • Enum Constant Detail

      • 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 Detail

      • values

        public static FileFormat[] values()
        Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
        for (FileFormat c : FileFormat.values())
            System.out.println(c);
        
        Returns:
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static FileFormat valueOf​(String name)
        Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (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 type 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, in which the result will be Optional.empty().
        Returns:
        The provided or detected file format, may return 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)
        Detect the file format based on the file name extension.
        Parameters:
        path - The relative or absolute file name, may be null
        Returns:
        the detected file format, may return null if the path is null or the format culd not be detected.