Enum Feature

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Comparable<Feature>

    public enum Feature
    extends java.lang.Enum<Feature>
    Optional file system features that may be supported or unsupported by a Jimfs file system instance.
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
      FILE_CHANNEL
      Feature controlling support for FileChannel.
      LINKS
      Feature controlling support for hard links to regular files.
      SECURE_DIRECTORY_STREAM
      Feature controlling support for SecureDirectoryStream.
      SYMBOLIC_LINKS
      Feature controlling support for symbolic links.
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      private Feature()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static Feature valueOf​(java.lang.String name)
      Returns the enum constant of this type with the specified name.
      static Feature[] 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

      • LINKS

        public static final Feature LINKS
        Feature controlling support for hard links to regular files.

        Affected method:

        • Files.createLink(Path, Path)

        If this feature is not enabled, this method will throw UnsupportedOperationException.

      • SYMBOLIC_LINKS

        public static final Feature SYMBOLIC_LINKS
        Feature controlling support for symbolic links.

        Affected methods:

        • Files.createSymbolicLink(Path, Path, FileAttribute...)
        • Files.readSymbolicLink(Path)

        If this feature is not enabled, these methods will throw UnsupportedOperationException.

      • SECURE_DIRECTORY_STREAM

        public static final Feature SECURE_DIRECTORY_STREAM
        Feature controlling support for SecureDirectoryStream.

        Affected methods:

        • Files.newDirectoryStream(Path)
        • Files.newDirectoryStream(Path, DirectoryStream.Filter)
        • Files.newDirectoryStream(Path, String)

        If this feature is enabled, the DirectoryStream instances returned by these methods will also implement SecureDirectoryStream.

      • FILE_CHANNEL

        public static final Feature FILE_CHANNEL
        Feature controlling support for FileChannel.

        Affected methods:

        • Files.newByteChannel(Path, OpenOption...)
        • Files.newByteChannel(Path, Set, FileAttribute...)
        • FileChannel.open(Path, OpenOption...)
        • FileChannel.open(Path, Set, FileAttribute...)
        • AsynchronousFileChannel.open(Path, OpenOption...)
        • AsynchronousFileChannel.open(Path, Set, ExecutorService, FileAttribute...)

        If this feature is not enabled, the SeekableByteChannel instances returned by the Files methods will not be FileChannel instances and the FileChannel.open and AsynchronousFileChannel.open methods will throw UnsupportedOperationException.

    • Constructor Detail

      • Feature

        private Feature()
    • Method Detail

      • values

        public static Feature[] 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 (Feature c : Feature.values())
            System.out.println(c);
        
        Returns:
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static Feature valueOf​(java.lang.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:
        java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
        java.lang.NullPointerException - if the argument is null