Package com.helger.commons.io.file
Enum ERandomAccessFileMode
- java.lang.Object
-
- java.lang.Enum<ERandomAccessFileMode>
-
- com.helger.commons.io.file.ERandomAccessFileMode
-
- All Implemented Interfaces:
Serializable,Comparable<ERandomAccessFileMode>
public enum ERandomAccessFileMode extends Enum<ERandomAccessFileMode>
Represents a set of predefined open modes for RandomAccessFile objects.- Author:
- Philip Helger
-
-
Enum Constant Summary
Enum Constants Enum Constant Description READ_ONLYOpen for reading only.READ_WRITEOpen for reading and writing.READ_WRITE_SYNCHRONOUSLYOpen 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_CONTENTOpen 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 Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ERandomAccessFileModegetFromModeOrNull(String sMode)StringgetMode()static ERandomAccessFileModevalueOf(String name)Returns the enum constant of this type with the specified name.static ERandomAccessFileMode[]values()Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
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 Detail
-
values
public static ERandomAccessFileMode[] 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 (ERandomAccessFileMode c : ERandomAccessFileMode.values()) System.out.println(c);
- 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 nameNullPointerException- if the argument is null
-
getFromModeOrNull
@Nullable public static ERandomAccessFileMode getFromModeOrNull(@Nullable String sMode)
-
-