Enum WSFileType

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

    public enum WSFileType
    extends java.lang.Enum<WSFileType>
    The types of WSFile engine types.
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
      APP_SESSION
      Application session file, removed when an application session is stopped, or when the server is stopped or restarted.
      APPLICATION_PERSISTENT
      Application file, removed when an application is added or removed.
      APPLICATION_VOLATILE
      Application file.
      CLIENT_SESSION
      Client session files for a user, removed when the client session is stopped.
      COMMON_PERSISTENT
      Common server files for everyone.
      COMMON_VOLATILE
      Common server files for everyone, removed when server starts or stops.
      USER_FILES
      User files, private for a user.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      java.lang.String descr
      The description.
      boolean doDeleteFiles
      Flag indicating files should be deleted upon server dispose.
      java.lang.String externalStartPath
      The external (web-facing) start path.
      java.lang.String internalSubDirectory
      The internal subdirectory name, can consists of several directories.
      boolean isSubjectBased
      Flag indicating the type is subject based and can have multiple instances.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      static WSFileType fromExernalStartPath​(java.lang.String path)
      Looks up the WSFileType from an external path.
      static WSFileType[] getNonSubjectBased()
      Gets the non-subject based file types.
      static WSFileType[] getSubjectBased()
      Gets the subject based file types.
      java.lang.String getUniqueDirectory()
      Gets a unique number to use for the directory.
      static WSFileType valueOf​(java.lang.String name)
      Returns the enum constant of this type with the specified name.
      static WSFileType[] 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_PERSISTENT

        public static final WSFileType COMMON_PERSISTENT
        Common server files for everyone. The files and directories persists when server starts or stops. Just a single instance is allowed.
      • COMMON_VOLATILE

        public static final WSFileType COMMON_VOLATILE
        Common server files for everyone, removed when server starts or stops. Just a single instance is allowed.
      • APPLICATION_PERSISTENT

        public static final WSFileType APPLICATION_PERSISTENT
        Application file, removed when an application is added or removed.

        Subject based with "application ID" as subject.

      • APPLICATION_VOLATILE

        public static final WSFileType APPLICATION_VOLATILE
        Application file. The files and directories persists when an application is added or removed, or when server is starts or stops.

        Subject based with "application ID" as subject.

      • APP_SESSION

        public static final WSFileType APP_SESSION
        Application session file, removed when an application session is stopped, or when the server is stopped or restarted. The subject is the session ID.
      • CLIENT_SESSION

        public static final WSFileType CLIENT_SESSION
        Client session files for a user, removed when the client session is stopped. The subject is the appSession ID followed by "-" and the client session ID.
      • USER_FILES

        public static final WSFileType USER_FILES
        User files, private for a user. Remains present until a user is removed. Typically used for user profile image, etc. The subject is a special unique name generated from the user ID that is a valid file name.
    • Field Detail

      • descr

        public final java.lang.String descr
        The description.
      • isSubjectBased

        public final boolean isSubjectBased
        Flag indicating the type is subject based and can have multiple instances.
      • internalSubDirectory

        public final java.lang.String internalSubDirectory
        The internal subdirectory name, can consists of several directories.
      • externalStartPath

        public final java.lang.String externalStartPath
        The external (web-facing) start path.
      • doDeleteFiles

        public final boolean doDeleteFiles
        Flag indicating files should be deleted upon server dispose.
    • Method Detail

      • values

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

        public static WSFileType 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
      • getUniqueDirectory

        public java.lang.String getUniqueDirectory()
        Gets a unique number to use for the directory.
        Returns:
        A string as randomHexValue.
      • getNonSubjectBased

        public static WSFileType[] getNonSubjectBased()
        Gets the non-subject based file types.
        Returns:
        The types COMMON_PERSISTENT and COMMON_VOLATILE. The return value is a cloned array.
      • getSubjectBased

        public static WSFileType[] getSubjectBased()
        Gets the subject based file types.
        Returns:
        The types APPLICATION_PERSISTENT, APPLICATION_VOLATILE, APP_SESSION, CLIENT_SESSION and USER_FILES. The return value is a cloned array.
      • fromExernalStartPath

        public static WSFileType fromExernalStartPath​(java.lang.String path)
        Looks up the WSFileType from an external path. The external path is always preceded with "/$$" and ends at the first '/' after this.
        Parameters:
        path - The external path.
        Returns:
        The file type found, or null for none.