Class FormThemeFileEntry

    • Method Detail

      • filePath

        public String filePath()
        Gets the file path after the context(), i.e. all path parts other than the first.
        Returns:
        The file path.
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object
      • isAnyParentOf

        public boolean isAnyParentOf​(IFileSystemEntry<?> other)
        Description copied from interface: IFileSystemEntry
        Checks whether this file system entry is a direct or indirect parent of the given file system entry, i.e. whether this file system entry is a directory and the given file system entry is inside that directory.
        Specified by:
        isAnyParentOf in interface IFileSystemEntry<FormThemeFileEntry>
        Parameters:
        other - The other file system entry.
        Returns:
        true if this file system entry is a direct or indirect parent of the given file system entry, false otherwise.
      • isDirectory

        public boolean isDirectory()
        Description copied from interface: IFileSystemEntry
        Whether this file system entry represents a directory.
        Specified by:
        isDirectory in interface IFileSystemEntry<FormThemeFileEntry>
        Returns:
        true if this file system entry represents a directory, false otherwise.
      • isImmediateParentOf

        public boolean isImmediateParentOf​(IFileSystemEntry<?> other)
        Description copied from interface: IFileSystemEntry
        Checks whether this file system entry is an immediate parent of the given file system entry, i.e. whether this file system entry is a directory and the given file system entry is directly inside that directory.
        Specified by:
        isImmediateParentOf in interface IFileSystemEntry<FormThemeFileEntry>
        Parameters:
        other - The other file system entry.
        Returns:
        true if this file system entry is an immediate parent of the given file system entry, false otherwise.
      • isVolumeGroup

        public boolean isVolumeGroup()
        Whether this entry represents the volume group that is used to group all client form themes.
        Returns:
        True if this entry represents the volume group.
      • isVolumeRoot

        public boolean isVolumeRoot()
        Description copied from interface: IFileSystemEntry
        Whether this file system entry represents the root (top-level directory) of the file system volume. A volume directory is for example a Windows drive or the root of a network share such as FTP.

        Note that IFileSystemEntry.parent() will return null for a volume root, and a non-null value for any other directory.

        Specified by:
        isVolumeRoot in interface IFileSystemEntry<FormThemeFileEntry>
        Returns:
        true if this file system entry represents the root directory, false otherwise.
      • parent

        public FormThemeFileEntry parent()
        Description copied from interface: IFileSystemEntry
        Gets the file system entry representing the parent directory of this file system entry. Will return null if this file system entry represents the volume root.
        Specified by:
        parent in interface IFileSystemEntry<FormThemeFileEntry>
        Returns:
        The parent file system entry, or null if this file system entry does not have a parent directory.
      • parents

        public Iterable<FormThemeFileEntry> parents()
        Description copied from interface: IFileSystemEntry
        Gets all file system entries representing the parent directories of this file system entry. The entries are returned in the order parent, grandparent, great-grandparent etc. This entry is not included in the result. If this file system entry does not have any parent directories, returns an empty iterable.
        Specified by:
        parents in interface IFileSystemEntry<FormThemeFileEntry>
        Returns:
        The parent file system entries, or empty if this file system entry does not have any parent directories.
      • path

        public String path()
        Description copied from interface: IFileSystemEntry
        Gets the path of this file system entry, which is the concatenation of all path parts separated by the path separator. Returns empty for the root directory. Does not include the volume.
        Specified by:
        path in interface IFileSystemEntry<FormThemeFileEntry>
        Returns:
        The file path.
      • relativeTo

        public FormThemeFileEntry relativeTo​(FormThemeFileEntry target)
        Description copied from interface: IFileSystemEntry
        Makes this entry relative to the given target. I.e. remove the path parts of the target from the path parts of this entry. If this entry is not a sub-path of the target, returns this entry unchanged.
        Specified by:
        relativeTo in interface IFileSystemEntry<FormThemeFileEntry>
        Parameters:
        target - The target to make this entry relative to.
        Returns:
        The relativized entry.
      • themeUuid

        public UUID themeUuid()
        Gets the UUID of the client form theme from the volume.
        Returns:
        The UUID of the client form theme.
      • unwrap

        public <FileSystemEntry> FileSystemEntry unwrap​(Class<? extends FileSystemEntry> type)
        Description copied from interface: IFileSystemEntry
        Unwraps this file system entry to the given type. If this file system entry is an instance of the given type, it is returned. Otherwise, potential wrappers are unwrapped until the given type is reached. If the file system entry cannot be unwrapped to the given type, null is returned.

        If multiple wrappers are present, the first one that can be unwrapped to the given type is returned.

        Specified by:
        unwrap in interface IFileSystemEntry<FormThemeFileEntry>
        Type Parameters:
        FileSystemEntry - The type of the desired file system entry.
        Parameters:
        type - The type to unwrap to.
        Returns:
        The unwrapped file system entry, or null if the file system entry cannot be unwrapped to the given type.
      • ofClientFormThemeFile

        public static FormThemeFileEntry ofClientFormThemeFile​(ClientFormThemeFile file)
        Creates a file key for the given client form theme file.
        Parameters:
        file - The client form theme file.
        Returns:
        The file key, or null if the file is null.
      • ofClientFormThemeFile

        public static FormThemeFileEntry ofClientFormThemeFile​(ClientFormTheme theme,
                                                               String context,
                                                               String filePath)
        Creates a file key for the given resource context and file path.
        Parameters:
        theme - The form theme representing the file system volume.
        context - The resource context.
        filePath - The file path.
        Returns:
        The file key.
      • ofClientFormThemeFile

        public static FormThemeFileEntry ofClientFormThemeFile​(UUID themeUuid,
                                                               String context,
                                                               String filePath)
        Creates a file key for the given resource context and file path.
        Parameters:
        themeUuid - The UUID of the form theme representing the file system volume.
        context - The resource context.
        filePath - The file path.
        Returns:
        The file key.
      • ofVolumeAndPath

        public static FormThemeFileEntry ofVolumeAndPath​(ClientFormTheme theme,
                                                         String path)
        Creates a file key for the given volume and path. The volume must be a valid UUID.
        Parameters:
        theme - The theme representing the volume.
        path - The path.
        Returns:
        The file key.
        Throws:
        IllegalArgumentException - If the volume is not the default volume ID.
      • ofVolumeAndPath

        public static FormThemeFileEntry ofVolumeAndPath​(String volume,
                                                         String path)
        Creates a file key for the given volume and path. The volume must be a valid UUID.
        Parameters:
        volume - The volume.
        path - The path.
        Returns:
        The file key.
        Throws:
        IllegalArgumentException - If the volume is not the default volume ID.
      • root

        public static FormThemeFileEntry root​(ClientFormTheme theme)
        Get the root file key for the volume represented by the given client form theme.
        Parameters:
        theme - The client form theme representing the root.
        Returns:
        The root file key.
      • root

        public static FormThemeFileEntry root​(UUID themeUuid)
        Get the root file key for the volume represented by the given client form theme UUID.
        Parameters:
        themeUuid - The UUID of the client form theme representing the root.
        Returns:
        The root file key.
      • themeToVolumeId

        public static String themeToVolumeId​(ClientFormTheme theme)
        Gets the volume ID for the given client form theme.
        Parameters:
        theme - The client form theme.
        Returns:
        The volume ID.
      • themeUuidToVolumeId

        public static String themeUuidToVolumeId​(UUID themeUuid)
        Gets the volume ID for the client form theme wit the given UUID.
        Parameters:
        themeUuid - The UUID of a client form theme.
        Returns:
        The volume ID.
      • volumeGroup

        public static FormThemeFileEntry volumeGroup()
        Gets the file entry representing the volume group that is used to group all client form themes.
        Returns:
        The file entry representing the volume group.
      • volumeIdToThemeUuid

        public static UUID volumeIdToThemeUuid​(String volumeId)
        Converts a volume ID to a theme UUID. This is the inverse of themeToVolumeId(ClientFormTheme).
        Parameters:
        volumeId - The volume ID.
        Returns:
        The theme UUID, or null if the volume ID is not a valid volume ID.