Class ResourceUtil
- java.lang.Object
-
- com.inductiveautomation.ignition.common.util.ResourceUtil
-
public class ResourceUtil extends java.lang.Object
-
-
Field Summary
Fields Modifier and Type Field Description static java.util.List<java.lang.String>INVALID_WINDOWS_FILENAMESFilenames that are reserved for use by the Windows OS, and will cause errors if you attempt to create them on the filesystem.static java.util.Comparator<ProjectResource>SORT_BY_MOST_RECENT
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static <T> TdecodeOrCreate(ProjectResource r, XMLDeserializer deserializer, java.lang.Class<T> clazz, LoggerEx log)static <T> TdecodeOrNull(byte[] data, XMLDeserializer deserializer, java.lang.Class<T> clazz)static <T> TdecodeOrNull(ProjectResource r, XMLDeserializer deserializer, java.lang.Class<T> clazz)static java.lang.StringgetResourceName(ProjectResourceId id)static java.lang.StringgetValidFolderName(java.lang.String folderName)static java.lang.StringgetValidResourceName(java.lang.String resourceName)static booleanisLegalName(java.lang.String proposedName)static java.lang.StringsubPath(ProjectResource resource)
-
-
-
Field Detail
-
INVALID_WINDOWS_FILENAMES
public static final java.util.List<java.lang.String> 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
public static final java.util.Comparator<ProjectResource> SORT_BY_MOST_RECENT
-
-
Method Detail
-
getResourceName
public static java.lang.String getResourceName(ProjectResourceId id)
-
subPath
public static java.lang.String subPath(ProjectResource resource)
- Returns:
- the
ResourcePath.getPath()of the resource, or null if the resource was null.
-
decodeOrCreate
public static <T> T decodeOrCreate(ProjectResource r, XMLDeserializer deserializer, java.lang.Class<T> clazz, LoggerEx log) throws java.lang.Exception
- Throws:
java.lang.Exception
-
decodeOrNull
@Nullable public static <T> T decodeOrNull(ProjectResource r, XMLDeserializer deserializer, java.lang.Class<T> clazz) throws java.lang.Exception
- Throws:
java.lang.Exception
-
decodeOrNull
@Nullable public static <T> T decodeOrNull(byte[] data, XMLDeserializer deserializer, java.lang.Class<T> clazz) throws java.lang.Exception- Throws:
java.lang.Exception
-
getValidResourceName
@Nullable public static java.lang.String getValidResourceName(java.lang.String resourceName)
- 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
public static java.lang.String getValidFolderName(java.lang.String folderName)
-
isLegalName
public static boolean isLegalName(java.lang.String proposedName)
- Returns:
trueif this resource name is valid for all supported filesystems
-
-