Class ResourcePath
java.lang.Object
com.inductiveautomation.ignition.common.project.resource.ResourcePath
- All Implemented Interfaces:
Serializable,Comparable<ResourcePath>
Represents a full resource path from the file system, relative to a Project.
Takes the form of moduleId[/resourceType[/path]]
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionResourcePath(ResourceType type, StringPath path) ResourcePath(ResourceType type, String path) -
Method Summary
Modifier and TypeMethodDescriptionintcompareTo(ResourcePath that) static ResourcePathcreateModuleRoot(String moduleId) booleanReturns a string version of the path of this resource.getName()getPath()getType()inthashCode()booleanisAncestorOf(ResourcePath possibleDescendant) Returnstrueif this ResourcePath is an ancestor ofpossibleDescendant.booleanReturnstrueif this ResourcePath points to a module's root folder.booleanisParentOf(ResourcePath possibleChild) booleanReturnstrueif this ResourcePath points to a resource type folder.toString()
-
Constructor Details
-
ResourcePath
- Parameters:
type- the type of resourcepath- the full path underneath the resource type folder, ending with the name of the resource.
-
ResourcePath
- Parameters:
type- the type of resourcepath- the full path underneath the resource type folder, ending with the name of the resource.
-
-
Method Details
-
createModuleRoot
-
getResourceType
-
isModuleFolder
public 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.
-
isResourceTypeFolder
public boolean isResourceTypeFolder()Returnstrueif this ResourcePath points to a resource type folder.- Returns:
trueif this ResourcePath points to a resource type folder.
-
isParentOf
- Returns:
trueif this ResourcePath is the direct parent ofpossibleChild.
-
isAncestorOf
Returnstrueif this ResourcePath is an ancestor ofpossibleDescendant.- Parameters:
possibleDescendant- the ResourcePath that might be a descendant.- Returns:
trueif this ResourcePath is an ancestor ofpossibleDescendant.
-
hashCode
public int hashCode() -
equals
-
toString
-
getModuleId
-
getType
-
getPath
- Returns:
- the path after the resource type. Includes the resource name
-
getFolderPath
Returns a string version of the path of this resource. -
getParentPath
-
getParent
-
getChild
-
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.
-
compareTo
- Specified by:
compareToin interfaceComparable<ResourcePath>
-