Class EntityFileIdentifier
- java.lang.Object
-
- com.znize.platform.entity.persistence.EntityFileIdentifier
-
- All Implemented Interfaces:
java.io.Serializable
public class EntityFileIdentifier extends java.lang.Object implements java.io.SerializableEntityFileIdentifier that is used to uniquely identify an entity that is a EntityFile.- Since:
- 5.13
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected java.lang.StringfilePathstatic java.lang.LongINSTANCE_PARENTinstance id for instance parent, which is not referencing any instance.protected java.lang.LonginstanceIdprotected java.lang.StringinstanceTypeId
-
Constructor Summary
Constructors Constructor Description EntityFileIdentifier(EntityFileIdentifier identifier)Copy constructorEntityFileIdentifier(Instance instance, java.lang.String filePath)ConstructorEntityFileIdentifier(java.lang.String instanceTypeId, java.lang.Long instanceId, java.lang.String filePath)Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(java.lang.Object obj)EntityFileIdentifiergetChildPathIdentifier(java.lang.String relativePath)Get the identifier for child path.java.lang.StringgetFilePath()Get path relative to the root directory implied by the instanceType and instanceId values.java.lang.LonggetInstanceId()Get instance id.java.lang.StringgetInstanceTypeId()Get instance type id defined in conf/system-config.xml.EntityFileIdentifiergetParent()Get parent that is a folder.inthashCode()java.lang.StringtoString()
-
-
-
Constructor Detail
-
EntityFileIdentifier
public EntityFileIdentifier(Instance instance, java.lang.String filePath)
Constructor- Parameters:
instance- an instancefilePath- 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 idinstanceId- instance idfilePath- 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:
hashCodein classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equalsin classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-