org.entityfs.entityattrs.ntfs
Enum NtFileAttributes

java.lang.Object
  extended by java.lang.Enum<NtFileAttributes>
      extended by org.entityfs.entityattrs.ntfs.NtFileAttributes
All Implemented Interfaces:
Serializable, Comparable<NtFileAttributes>

public enum NtFileAttributes
extends Enum<NtFileAttributes>

This is an enumeration over the different NT attributes that a file can have.

Since:
1.0
Author:
Karl Gustafsson

Enum Constant Summary
ARCHIVE
          The file or directory is an archive file.
COMPRESSED
          The file is compressed.
DEVICE
          Not used?
DIRECTORY
          The entity is a directory.
ENCRYPTED
          The file is encrypted.
HIDDEN
          The file or directory is hidden.
NONINDEXED
          Not used?
NORMAL
          The file does not have any other attributes.
OFFLINE
          The file data is not available immediately.
READ_ONLY
          The file or directory is read only.
REPARSE_POINT
          The entity has an associated reparse point.
SPARSE
          The file is a sparse file.
SYSTEM
          The file or directory is part of the operating system.
TEMPORARY
          The file is used for temporary storage.
VOLUME
          Not used?
 
Method Summary
static Set<NtFileAttributes> get(int code)
          Get the set of NT file attributes that correspond to the flag code.
static int getCode(Set<NtFileAttributes> s)
          Get the integer code for the set of attributes.
 int getIntValue()
          Get the integer flag value for the attribute.
 String getReadable()
          Get a readable tag for the attribute.
 String toString()
           
static NtFileAttributes valueOf(String name)
          Returns the enum constant of this type with the specified name.
static NtFileAttributes[] 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, valueOf
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

READ_ONLY

public static final NtFileAttributes READ_ONLY
The file or directory is read only.


HIDDEN

public static final NtFileAttributes HIDDEN
The file or directory is hidden. EntityFS stores this attribute but does not use it to make entities hidden. Clients may.


SYSTEM

public static final NtFileAttributes SYSTEM
The file or directory is part of the operating system.


VOLUME

public static final NtFileAttributes VOLUME
Not used?


DIRECTORY

public static final NtFileAttributes DIRECTORY
The entity is a directory.


ARCHIVE

public static final NtFileAttributes ARCHIVE
The file or directory is an archive file.


DEVICE

public static final NtFileAttributes DEVICE
Not used?


NORMAL

public static final NtFileAttributes NORMAL
The file does not have any other attributes. This can only be used alone. (And that rule is violated by many implementations.)


TEMPORARY

public static final NtFileAttributes TEMPORARY
The file is used for temporary storage.


SPARSE

public static final NtFileAttributes SPARSE
The file is a sparse file.


REPARSE_POINT

public static final NtFileAttributes REPARSE_POINT
The entity has an associated reparse point.


COMPRESSED

public static final NtFileAttributes COMPRESSED
The file is compressed.


OFFLINE

public static final NtFileAttributes OFFLINE
The file data is not available immediately.


NONINDEXED

public static final NtFileAttributes NONINDEXED
Not used?


ENCRYPTED

public static final NtFileAttributes ENCRYPTED
The file is encrypted.

Method Detail

values

public static NtFileAttributes[] 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 (NtFileAttributes c : NtFileAttributes.values())
    System.out.println(c);

Returns:
an array containing the constants of this enum type, in the order they are declared

valueOf

public static NtFileAttributes 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

getIntValue

public int getIntValue()
Get the integer flag value for the attribute. By combining different attributes' flag values, a collection of attributes can be stored in a single integer.

Returns:
The integer flag value.

getReadable

public String getReadable()
Get a readable tag for the attribute. This can be used for printing in toString methods and suchlike.

Returns:
A readable tag for the attribute.

toString

public String toString()
Overrides:
toString in class Enum<NtFileAttributes>

get

public static Set<NtFileAttributes> get(int code)
                                 throws IllegalArgumentException
Get the set of NT file attributes that correspond to the flag code. The flag code can be created by adding integers returned from getIntValue().

Parameters:
code - The code.
Returns:
A set of attributes.
Throws:
IllegalArgumentException - If code < 0 or code >= 32768
See Also:
getIntValue(), getCode(Set)

getCode

public static int getCode(Set<NtFileAttributes> s)
Get the integer code for the set of attributes. This method creates the integer code from adding the values returned from calling each attribute's getIntValue() method.

Parameters:
s - The set of attributes.
Returns:
The integer code for the attributes.