Enum WindowsSpecialFolder

    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
      COMMON_APPLICATION_DATA
      Provides the Path corresponding to the CommonApplicationData special folder.
      SYSTEM
      Provides the Path corresponding to the System special folder.
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      private WindowsSpecialFolder​(java.lang.String identifier, boolean create)  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.nio.file.Path get()
      Gets the Path assigned to the identified special folder.
      private static java.nio.file.Path getSpecialFolder​(java.lang.String specialFolderId, boolean create)
      Gets the Path to the identified Windows Special Folder.
      static WindowsSpecialFolder valueOf​(java.lang.String name)
      Returns the enum constant of this type with the specified name.
      static WindowsSpecialFolder[] 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

      • COMMON_APPLICATION_DATA

        public static final WindowsSpecialFolder COMMON_APPLICATION_DATA
        Provides the Path corresponding to the CommonApplicationData special folder. A get via this constant will attempt to create the folder if it does not already exist.
      • SYSTEM

        public static final WindowsSpecialFolder SYSTEM
        Provides the Path corresponding to the System special folder.
    • Constructor Detail

      • WindowsSpecialFolder

        private WindowsSpecialFolder​(java.lang.String identifier,
                                     boolean create)
    • Method Detail

      • values

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

        public static WindowsSpecialFolder 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
      • get

        public java.nio.file.Path get()
                               throws java.io.IOException
        Gets the Path assigned to the identified special folder.
        Returns:
        the special folder Path
        Throws:
        java.io.IOException - if an error is raised while attempting to determine the Path for the special folder
      • getSpecialFolder

        private static java.nio.file.Path getSpecialFolder​(java.lang.String specialFolderId,
                                                           boolean create)
                                                    throws java.io.IOException
        Gets the Path to the identified Windows Special Folder.
        Parameters:
        specialFolderId - the special folder identifier
        create - if true, attempts to create the folder if it does not exist
        Returns:
        the path to the special folder; an empty path is returned if the folder does not exist
        Throws:
        java.io.IOException - if the special folder value cannot be determined