Class EntityFileIdentifier

  • All Implemented Interfaces:
    java.io.Serializable

    public class EntityFileIdentifier
    extends java.lang.Object
    implements java.io.Serializable
    EntityFileIdentifier that is used to uniquely identify an entity that is a EntityFile.
    Since:
    5.13
    See Also:
    Serialized Form
    • Field Detail

      • INSTANCE_PARENT

        public static java.lang.Long INSTANCE_PARENT
        instance id for instance parent, which is not referencing any instance.
      • instanceTypeId

        protected java.lang.String instanceTypeId
      • instanceId

        protected java.lang.Long instanceId
      • filePath

        protected java.lang.String filePath
    • Constructor Detail

      • EntityFileIdentifier

        public EntityFileIdentifier​(Instance instance,
                                    java.lang.String filePath)
        Constructor
        Parameters:
        instance - an instance
        filePath - file path relative to the instance home
      • EntityFileIdentifier

        public EntityFileIdentifier​(java.lang.String instanceTypeId,
                                    java.lang.Long instanceId,
                                    java.lang.String filePath)
        Constructor
        Parameters:
        instanceTypeId - instance type id
        instanceId - instance id
        filePath - file path relative to instance/instanceType home
        See Also:
        getInstanceTypeId(), getInstanceId()
      • EntityFileIdentifier

        public EntityFileIdentifier​(EntityFileIdentifier identifier)
        Copy constructor
        Parameters:
        identifier - EntityFileIdentifier
    • Method Detail

      • getInstanceTypeId

        public java.lang.String getInstanceTypeId()
        Get instance type id defined in conf/system-config.xml. If null, the file is a global file and does not belong to any instance type.
        Returns:
        instance type id
      • getInstanceId

        public java.lang.Long getInstanceId()
        Get instance id. If instance id is >=0 zero, the identifier identifies the specified instance. If null, the identifier identifies instance type, not any specific instance. If it is INSTANCE_PARENT, this identifier identifies an file under the instance parent dir of the instance type.
        Returns:
        instance id
      • getFilePath

        public java.lang.String getFilePath()
        Get path relative to the root directory implied by the instanceType and instanceId values.
        Returns:
        file path
      • getChildPathIdentifier

        public EntityFileIdentifier getChildPathIdentifier​(java.lang.String relativePath)
        Get the identifier for child path.
        Parameters:
        relativePath - relative path under this identifier (folder)
        Returns:
        EntityFileIdentifier instance
      • getParent

        public EntityFileIdentifier getParent()
        Get parent that is a folder.
        Returns:
        EntityFileIdentifier instance for parent
        Since:
        6.0
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • equals

        public boolean equals​(java.lang.Object obj)
        Overrides:
        equals in class java.lang.Object
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object