Class FormThemeFileEntry
java.lang.Object
de.xima.fc.gui.model.form_theme.FormThemeFileEntry
- All Implemented Interfaces:
IFileSystemEntry<FormThemeFileEntry>, Serializable, Comparable<FormThemeFileEntry>
public final class FormThemeFileEntry
extends Object
implements IFileSystemEntry<FormThemeFileEntry>
An
IFileSystemEntry implementation for client form theme files. The
file path is a combination of resource context, followed by the file name.
The file name may have slashes. Everything before the final slash is
treated as a directory. The last file part is treated a file if it has any file extension (i.e. a dot followed by at
least one character). Otherwise, it is treated as a directory.
- Since:
- 8.3.0
- Author:
- XIMA MEDIA GmbH
- See Also:
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionintcontext()Gets theClientFormThemeFile.getResourceContext()resource context of this file key, i.e. the first path part.booleanGets the file extension, i.e. the part of the file name after the last '.'.fileName()Gets the last file part of the path, i.e. the file name or directory name.filePath()Gets the file path after thecontext(), i.e. all path parts other than the first.inthashCode()booleanisAnyParentOf(IFileSystemEntry<?> other) 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.booleanWhether this file system entry represents a directory.booleanisImmediateParentOf(IFileSystemEntry<?> other) 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.booleanWhether this entry represents the volume group that is used to group all client form themes.booleanWhether this file system entry represents the root (top-level directory) of the file system volume.static FormThemeFileEntryCreates a file key for the given client form theme file.static FormThemeFileEntryofClientFormThemeFile(ClientFormTheme theme, String context, String filePath) Creates a file key for the givenresource contextandfile path.static FormThemeFileEntryofClientFormThemeFile(UUID themeUuid, String context, String filePath) Creates a file key for the givenresource contextandfile path.static FormThemeFileEntryofVolumeAndPath(ClientFormTheme theme, String path) Creates a file key for the given volume and path.static FormThemeFileEntryofVolumeAndPath(String volume, String path) Creates a file key for the given volume and path.parent()Gets the file system entry representing the parent directory of this file system entry.parents()Gets all file system entries representing the parent directories of this file system entry.path()Gets the path of this file system entry, which is the concatenation of all path parts separated by the path separator.String[]Gets the path parts of this file system entry, i.e. the directory names and the file name.relativeTo(FormThemeFileEntry target) Makes this entry relative to the given target.resolve(FormThemeFileEntry entry) Adds the given children to the list of path parts and returns a new file key representing the resulting path.Adds the given child to the list of path parts and returns a new file key representing the resulting path.Adds the given children to the list of path parts and returns a new file key representing the resulting path.static FormThemeFileEntryroot(ClientFormTheme theme) Get therootfile key for the volume represented by the given client form theme.static FormThemeFileEntryGet therootfile key for the volume represented by the given client form theme UUID.static StringthemeToVolumeId(ClientFormTheme theme) Gets the volume ID for the given client form theme.Gets the UUID of the client form theme from thevolume.static StringthemeUuidToVolumeId(UUID themeUuid) Gets the volume ID for the client form theme wit the given UUID.toString()<FileSystemEntry>
FileSystemEntryUnwraps this file system entry to the given type.volume()Gets the volume of this file system entry.static FormThemeFileEntryGets the file entry representing the volume group that is used to group all client form themes.static UUIDvolumeIdToThemeUuid(String volumeId) Converts a volume ID to a theme UUID.
-
Field Details
-
VOLUME_CLIENT_FORM_THEME_GROUP
- See Also:
-
-
Method Details
-
compareTo
- Specified by:
compareToin interfaceComparable<FormThemeFileEntry>
-
context
Gets theClientFormThemeFile.getResourceContext()resource context of this file key, i.e. the first path part. Returns empty for the root directory.- Returns:
- The resource context.
-
equals
-
fileExtension
Description copied from interface:IFileSystemEntryGets the file extension, i.e. the part of the file name after the last '.'. Returns empty for directories.- Specified by:
fileExtensionin interfaceIFileSystemEntry<FormThemeFileEntry>- Returns:
- The file extension.
-
fileName
Description copied from interface:IFileSystemEntryGets the last file part of the path, i.e. the file name or directory name.- Specified by:
fileNamein interfaceIFileSystemEntry<FormThemeFileEntry>- Returns:
- The last file part.
-
filePath
-
hashCode
-
isAnyParentOf
Description copied from interface:IFileSystemEntryChecks 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:
isAnyParentOfin interfaceIFileSystemEntry<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:IFileSystemEntryWhether this file system entry represents a directory.- Specified by:
isDirectoryin interfaceIFileSystemEntry<FormThemeFileEntry>- Returns:
- true if this file system entry represents a directory, false otherwise.
-
isImmediateParentOf
Description copied from interface:IFileSystemEntryChecks 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:
isImmediateParentOfin interfaceIFileSystemEntry<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:IFileSystemEntryWhether 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:
isVolumeRootin interfaceIFileSystemEntry<FormThemeFileEntry>- Returns:
- true if this file system entry represents the root directory, false otherwise.
-
parent
Description copied from interface:IFileSystemEntryGets the file system entry representing the parent directory of this file system entry. Will return null if this file system entry represents thevolume root.- Specified by:
parentin interfaceIFileSystemEntry<FormThemeFileEntry>- Returns:
- The parent file system entry, or null if this file system entry does not have a parent directory.
-
parents
Description copied from interface:IFileSystemEntryGets 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:
parentsin interfaceIFileSystemEntry<FormThemeFileEntry>- Returns:
- The parent file system entries, or empty if this file system entry does not have any parent directories.
-
path
Description copied from interface:IFileSystemEntryGets 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:
pathin interfaceIFileSystemEntry<FormThemeFileEntry>- Returns:
- The file path.
-
pathParts
Description copied from interface:IFileSystemEntryGets the path parts of this file system entry, i.e. the directory names and the file name.- Specified by:
pathPartsin interfaceIFileSystemEntry<FormThemeFileEntry>- Returns:
- The path parts.
-
relativeTo
Description copied from interface:IFileSystemEntryMakes 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:
relativeToin interfaceIFileSystemEntry<FormThemeFileEntry>- Parameters:
target- The target to make this entry relative to.- Returns:
- The relativized entry.
-
resolve
Description copied from interface:IFileSystemEntryAdds the given child to the list of path parts and returns a new file key representing the resulting path.- Specified by:
resolvein interfaceIFileSystemEntry<FormThemeFileEntry>- Parameters:
child- The child path to add. May contain slashes.- Returns:
- The new file key.
-
resolve
Description copied from interface:IFileSystemEntryAdds the given children to the list of path parts and returns a new file key representing the resulting path.- Specified by:
resolvein interfaceIFileSystemEntry<FormThemeFileEntry>- Parameters:
children- The child paths to add. May contain slashes.- Returns:
- The new file key.
-
resolve
Description copied from interface:IFileSystemEntryAdds the given children to the list of path parts and returns a new file key representing the resulting path.- Specified by:
resolvein interfaceIFileSystemEntry<FormThemeFileEntry>- Parameters:
entry- The child paths to add. May contain slashes.- Returns:
- The new file key.
-
themeUuid
-
toString
-
unwrap
Description copied from interface:IFileSystemEntryUnwraps 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:
unwrapin interfaceIFileSystemEntry<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.
-
volume
Description copied from interface:IFileSystemEntryGets the volume of this file system entry.- Specified by:
volumein interfaceIFileSystemEntry<FormThemeFileEntry>- Returns:
- The name of this entry's volume.
-
ofClientFormThemeFile
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 givenresource contextandfile 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 givenresource contextandfile 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
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
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
Get therootfile 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
Get therootfile 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
Gets the volume ID for the given client form theme.- Parameters:
theme- The client form theme.- Returns:
- The volume ID.
-
themeUuidToVolumeId
-
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
Converts a volume ID to a theme UUID. This is the inverse ofthemeToVolumeId(ClientFormTheme).- Parameters:
volumeId- The volume ID.- Returns:
- The theme UUID, or null if the volume ID is not a valid volume ID.
-