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_FILENAMES
Filenames 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> T
decodeOrCreate(ProjectResource r, XMLDeserializer deserializer, java.lang.Class<T> clazz, LoggerEx log)
static <T> T
decodeOrNull(ProjectResource r, XMLDeserializer deserializer, java.lang.Class<T> clazz)
static java.lang.String
getResourceName(ProjectResourceId id)
static java.lang.String
getValidFolderName(java.lang.String folderName)
static java.lang.String
getValidResourceName(java.lang.String resourceName)
static boolean
isLegalForLocation(Project project, java.lang.String proposedName, ResourcePath location)
static boolean
isLegalName(java.lang.String proposedName)
static java.lang.String
subPath(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
-
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:
true
if this resource name is valid for all supported filesystems
-
isLegalForLocation
public static boolean isLegalForLocation(@Nonnull Project project, @Nonnull java.lang.String proposedName, @Nonnull ResourcePath location)
- Returns:
true
if this resource can be added to the specified project
-
-