org.apache.hadoop.fs
Enum CreateFlag

java.lang.Object
  extended by java.lang.Enum<CreateFlag>
      extended by 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:

  1. create the file if it does not exist;
  2. 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.
 
Methods inherited from class java.lang.Enum
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

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

Method Detail

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