Enum Class FileType

java.lang.Object
java.lang.Enum<FileType>
org.gnome.gio.FileType
All Implemented Interfaces:
Serializable, Comparable<FileType>, Constable, Enumeration

@Generated("org.javagi.JavaGI") public enum FileType extends Enum<FileType> implements Enumeration

Indicates the file's on-disk type.

On Windows systems a file will never have SYMBOLIC_LINK type; use GFileInfo and G_FILE_ATTRIBUTE_STANDARD_IS_SYMLINK to determine whether a file is a symlink or not. This is due to the fact that NTFS does not have a single filesystem object type for symbolic links - it has files that symlink to files, and directories that symlink to directories. GFileType enumeration cannot precisely represent this important distinction, which is why all Windows symlinks will continue to be reported as REGULAR or DIRECTORY.

  • Enum Constant Details

    • UNKNOWN

      public static final FileType UNKNOWN
      File's type is unknown.
    • REGULAR

      public static final FileType REGULAR
      File handle represents a regular file.
    • DIRECTORY

      public static final FileType DIRECTORY
      File handle represents a directory.
    • SPECIAL

      public static final FileType SPECIAL
      File is a "special" file, such as a socket, fifo, block device, or character device.
    • SHORTCUT

      public static final FileType SHORTCUT
      File is a shortcut (Windows systems).
    • MOUNTABLE

      public static final FileType MOUNTABLE
      File is a mountable location.
  • Method Details

    • values

      public static FileType[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static FileType valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (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 class has no constant with the specified name
      NullPointerException - if the argument is null
    • of

      public static FileType of(int value)
      Create a new FileType for the provided value
      Parameters:
      value - the enum value
      Returns:
      the enum for the provided value
    • getValue

      public int getValue()
      Get the numeric value of this enum
      Specified by:
      getValue in interface Enumeration
      Returns:
      the enum value
    • of

      public static FileType of(MemorySegment address)
      Create a new FileType for the value in the provided memory address.
      Parameters:
      address - the memory address holding a enum value
      Returns:
      the enum for the value in the provided memory address
    • getType

      public static @Nullable Type getType()
      Get the GType of the FileType class.
      Returns:
      the GType