Enum FileType

java.lang.Object
java.lang.Enum<FileType>
org.apache.commons.vfs2.FileType
All Implemented Interfaces:
Serializable, Comparable<FileType>

public enum FileType extends Enum<FileType>
An enumerated type that represents a file's type.
  • Enum Constant Summary

    Enum Constants
    Enum Constant
    Description
    A regular file.
    A file or folder.
    A folder.
    A file that does not exist.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private final boolean
    true if the FileType has attributes
    private final boolean
    true if the FileType can have children
    private final boolean
    true if the FileType can have content
    private final String
    The name of the FileType
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    private
    FileType(String name, boolean hasChildren, boolean hasContent, boolean hasAttrs)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    Returns the name of this type.
    boolean
    Returns true if files of this type may have attributes.
    boolean
    Returns true if files of this type may contain other files.
    boolean
    Returns true if files of this type may have data content.
    Returns the name of this type.
    static FileType
    Returns the enum constant of this type with the specified name.
    static FileType[]
    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 Details

    • FOLDER

      public static final FileType FOLDER
      A folder. May contain other files, and have attributes, but does not have any data content.
    • FILE

      public static final FileType FILE
      A regular file. May have data content and attributes, but cannot contain other files.
    • FILE_OR_FOLDER

      public static final FileType FILE_OR_FOLDER
      A file or folder. May have data content and attributes, and can contain other files.
    • IMAGINARY

      public static final FileType IMAGINARY
      A file that does not exist. May not have data content, attributes, or contain other files.
  • Field Details

    • name

      private final String name
      The name of the FileType
    • hasChildren

      private final boolean hasChildren
      true if the FileType can have children
    • hasContent

      private final boolean hasContent
      true if the FileType can have content
    • hasAttrs

      private final boolean hasAttrs
      true if the FileType has attributes
  • Constructor Details

    • FileType

      private FileType(String name, boolean hasChildren, boolean hasContent, boolean hasAttrs)
  • Method Details

    • values

      public static FileType[] 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 FileType 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
    • toString

      public String toString()
      Returns the name of this type.
      Overrides:
      toString in class Enum<FileType>
      Returns:
      The name of this type.
    • getName

      public String getName()
      Returns the name of this type.
      Returns:
      The name of the type.
    • hasChildren

      public boolean hasChildren()
      Returns true if files of this type may contain other files.
      Returns:
      true if files can contain other files.
    • hasContent

      public boolean hasContent()
      Returns true if files of this type may have data content.
      Returns:
      true if files can have content.
    • hasAttributes

      public boolean hasAttributes()
      Returns true if files of this type may have attributes.
      Returns:
      true if files can have attributes