org.apache.hadoop.fs
Enum CreateFlag
java.lang.Object
java.lang.Enum<CreateFlag>
org.apache.hadoop.fs.CreateFlag
- All Implemented Interfaces:
- Serializable, Comparable<CreateFlag>
@InterfaceAudience.Public
@InterfaceStability.Stable
public enum CreateFlag
- extends Enum<CreateFlag>
CreateFlag specifies the file create semantic. Users can combine flags like:
EnumSet.of(CreateFlag.CREATE, CreateFlag.APPEND)
and pass it to #create(Path f, FsPermission permission,
EnumSet flag, int bufferSize, short replication, long blockSize,
Progressable progress)
.
Combine OVERWRITE
with either CREATE
or APPEND
does the same as only use
OVERWRITE
.
Combine CREATE
with APPEND
has the semantic:
- create the file if it does not exist;
- append the file if it already exists.
Enum Constant Summary |
APPEND
append to a file, and throw an IOException if it does not exist |
CREATE
create the file if it does not exist, and throw an IOException if it
already exists |
OVERWRITE
create the file if it does not exist, if it exists, overwrite it. |
Method Summary |
static CreateFlag |
valueOf(String name)
Returns the enum constant of this type with the specified name. |
static CreateFlag[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared. |
CREATE
public static final CreateFlag CREATE
- create the file if it does not exist, and throw an IOException if it
already exists
OVERWRITE
public static final CreateFlag OVERWRITE
- create the file if it does not exist, if it exists, overwrite it.
APPEND
public static final CreateFlag APPEND
- append to a file, and throw an IOException if it does not exist
values
public static CreateFlag[] 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 (CreateFlag c : CreateFlag.values())
System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in
the order they are declared
valueOf
public static CreateFlag 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
Copyright © 2009 The Apache Software Foundation