Class ResourceUtil
java.lang.Object
com.inductiveautomation.ignition.common.util.ResourceUtil
-
Field Summary
FieldsModifier and TypeFieldDescriptionFilenames that are reserved for use by the Windows OS, and will cause errors if you attempt to create them on the filesystem.static final Comparator<ProjectResource>
-
Method Summary
Modifier and TypeMethodDescriptionstatic <T> T
decodeOrCreate
(ProjectResource r, XMLDeserializer deserializer, Class<T> clazz, LoggerEx log) static <T> T
decodeOrNull
(byte[] data, XMLDeserializer deserializer, Class<T> clazz) static <T> T
decodeOrNull
(ProjectResource r, XMLDeserializer deserializer, Class<T> clazz) static String
static String
getValidFolderName
(String folderName) static String
getValidResourceName
(String resourceName) static boolean
isLegalName
(String proposedName) static String
subPath
(ProjectResource resource)
-
Field Details
-
INVALID_WINDOWS_FILENAMES
Filenames that are reserved for use by the Windows OS, and will cause errors if you attempt to create them on the filesystem. -
SORT_BY_MOST_RECENT
-
-
Method Details
-
getResourceName
-
subPath
- Returns:
- the
ResourcePath.getPath()
of the resource, or null if the resource was null.
-
decodeOrCreate
public static <T> T decodeOrCreate(ProjectResource r, XMLDeserializer deserializer, Class<T> clazz, LoggerEx log) throws Exception - Throws:
Exception
-
decodeOrNull
@Nullable public static <T> T decodeOrNull(ProjectResource r, XMLDeserializer deserializer, Class<T> clazz) throws Exception - Throws:
Exception
-
decodeOrNull
@Nullable public static <T> T decodeOrNull(byte[] data, XMLDeserializer deserializer, Class<T> clazz) throws Exception - Throws:
Exception
-
getValidResourceName
- Returns:
- a resource name that can be written to disk. In the case of a singletons, a null value or an improper name returns null.
-
getValidFolderName
-
isLegalName
- Returns:
true
if this resource name is valid for all supported filesystems
-