Enum ERandomAccessFileMode

java.lang.Object
java.lang.Enum<ERandomAccessFileMode>
com.helger.commons.io.file.ERandomAccessFileMode
All Implemented Interfaces:
Serializable, Comparable<ERandomAccessFileMode>, java.lang.constant.Constable

public enum ERandomAccessFileMode extends Enum<ERandomAccessFileMode>
Represents a set of predefined open modes for RandomAccessFile objects.
Author:
Philip Helger
  • Enum Constant Details

    • READ_ONLY

      public static final ERandomAccessFileMode READ_ONLY
      Open for reading only.
    • READ_WRITE

      public static final ERandomAccessFileMode READ_WRITE
      Open for reading and writing. If the file does not already exist then an attempt will be made to create it.
    • READ_WRITE_SYNCHRONOUSLY

      public static final ERandomAccessFileMode READ_WRITE_SYNCHRONOUSLY
      Open for reading and writing, as with "rw", and also require that every update to the file's content or metadata be written synchronously to the underlying storage device.
    • READ_WRITE_SYNCHRONOUSLY_ONLY_CONTENT

      public static final ERandomAccessFileMode READ_WRITE_SYNCHRONOUSLY_ONLY_CONTENT
      Open for reading and writing, as with "rw", and also require that every update to the file's content be written synchronously to the underlying storage device.
  • Method Details

    • values

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

      public static ERandomAccessFileMode 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
    • getMode

      @Nonnull @Nonempty public String getMode()
    • getFromModeOrNull

      @Nullable public static ERandomAccessFileMode getFromModeOrNull(@Nullable String sMode)