Class ResourcePath
- java.lang.Object
- 
- com.inductiveautomation.ignition.common.project.resource.ResourcePath
 
- 
- All Implemented Interfaces:
- java.io.Serializable,- java.lang.Comparable<ResourcePath>
 
 public class ResourcePath extends java.lang.Object implements java.io.Serializable, java.lang.Comparable<ResourcePath> Represents a full resource path from the file system, relative to a Project.Takes the form of moduleId[/resourceType[/path]] - See Also:
- Serialized Form
 
- 
- 
Constructor SummaryConstructors Constructor Description ResourcePath(ResourceType type, StringPath path)ResourcePath(ResourceType type, java.lang.String path)
 - 
Method SummaryAll Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description intcompareTo(ResourcePath that)static ResourcePathcreateModuleRoot(java.lang.String moduleId)booleanequals(java.lang.Object o)ResourcePathgetChild(java.lang.String... pathParts)java.lang.StringgetFolderPath()Returns a string version of the path of this resource.java.lang.StringgetModuleId()java.lang.StringgetName()ResourcePathgetParent()java.lang.StringgetParentPath()StringPath.CaseSensitiveStringPathgetPath()ResourceTypegetResourceType()java.lang.StringgetType()inthashCode()booleanisAncestorOf(ResourcePath possibleDescendant)Returnstrueif this ResourcePath is an ancestor ofpossibleDescendant.booleanisModuleFolder()Returnstrueif this ResourcePath points to a module's root folder.booleanisParentOf(ResourcePath possibleChild)booleanisResourceTypeFolder()Returnstrueif this ResourcePath points to a resource type folder.java.lang.StringtoString()
 
- 
- 
- 
Constructor Detail- 
ResourcePathpublic ResourcePath(@Nonnull ResourceType type, @Nullable java.lang.String path)- Parameters:
- type- the type of resource
- path- the full path underneath the resource type folder, ending with the name of the resource.
 
 - 
ResourcePathpublic ResourcePath(@Nonnull ResourceType type, @Nonnull StringPath path)- Parameters:
- type- the type of resource
- path- the full path underneath the resource type folder, ending with the name of the resource.
 
 
- 
 - 
Method Detail- 
createModuleRootpublic static ResourcePath createModuleRoot(java.lang.String moduleId) 
 - 
getResourceTypepublic ResourceType getResourceType() 
 - 
isModuleFolderpublic boolean isModuleFolder() Returnstrueif this ResourcePath points to a module's root folder.This means that the path is root ( StringPath.isRoot()and the ResourceType's typeId is null.- Returns:
- trueif this ResourcePath points to a module's root folder.
 
 - 
isResourceTypeFolderpublic boolean isResourceTypeFolder() Returnstrueif this ResourcePath points to a resource type folder.- Returns:
- trueif this ResourcePath points to a resource type folder.
 
 - 
isParentOfpublic boolean isParentOf(ResourcePath possibleChild) - Returns:
- trueif this ResourcePath is the direct parent of- possibleChild.
 
 - 
isAncestorOfpublic boolean isAncestorOf(ResourcePath possibleDescendant) Returnstrueif this ResourcePath is an ancestor ofpossibleDescendant.- Parameters:
- possibleDescendant- the ResourcePath that might be a descendant.
- Returns:
- trueif this ResourcePath is an ancestor of- possibleDescendant.
 
 - 
hashCodepublic int hashCode() - Overrides:
- hashCodein class- java.lang.Object
 
 - 
equalspublic boolean equals(java.lang.Object o) - Overrides:
- equalsin class- java.lang.Object
 
 - 
toStringpublic java.lang.String toString() - Overrides:
- toStringin class- java.lang.Object
- Returns:
- the full path represented by this resourcePath
 
 - 
getModuleIdpublic java.lang.String getModuleId() 
 - 
getTypepublic java.lang.String getType() 
 - 
getPath@Nonnull public StringPath.CaseSensitiveStringPath getPath() - Returns:
- the path after the resource type. Includes the resource name
 
 - 
getFolderPathpublic java.lang.String getFolderPath() Returns a string version of the path of this resource.
 - 
getParentPathpublic java.lang.String getParentPath() 
 - 
getParentpublic ResourcePath getParent() 
 - 
getChildpublic ResourcePath getChild(java.lang.String... pathParts) 
 - 
getNamepublic java.lang.String getName() - Returns:
- the name that identifies the resource. Either the last element of the path, or the resourceType if the types folder, or the moduleId if the modules folder.
 
 - 
compareTopublic int compareTo(@Nonnull ResourcePath that)- Specified by:
- compareToin interface- java.lang.Comparable<ResourcePath>
 
 
- 
 
-