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 TypeMethodDescriptionint
compareTo
(ResourcePath that) static ResourcePath
createModuleRoot
(String moduleId) boolean
Returns a string version of the path of this resource.getName()
getPath()
getType()
int
hashCode()
boolean
isAncestorOf
(ResourcePath possibleDescendant) Returnstrue
if this ResourcePath is an ancestor ofpossibleDescendant
.boolean
Returnstrue
if this ResourcePath points to a module's root folder.boolean
isParentOf
(ResourcePath possibleChild) boolean
Returnstrue
if 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()Returnstrue
if 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:
true
if this ResourcePath points to a module's root folder.
-
isResourceTypeFolder
public boolean isResourceTypeFolder()Returnstrue
if this ResourcePath points to a resource type folder.- Returns:
true
if this ResourcePath points to a resource type folder.
-
isParentOf
- Returns:
true
if this ResourcePath is the direct parent ofpossibleChild
.
-
isAncestorOf
Returnstrue
if this ResourcePath is an ancestor ofpossibleDescendant
.- Parameters:
possibleDescendant
- the ResourcePath that might be a descendant.- Returns:
true
if 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:
compareTo
in interfaceComparable<ResourcePath>
-