Package org.xwiki.resource.temporary
Class TemporaryResourceReference
- java.lang.Object
-
- org.xwiki.resource.AbstractResourceReference
-
- org.xwiki.resource.entity.EntityResourceReference
-
- org.xwiki.resource.temporary.TemporaryResourceReference
-
- All Implemented Interfaces:
ResourceReference
public class TemporaryResourceReference extends org.xwiki.resource.entity.EntityResourceReference
Points to a temporary Resource that's been generated by some XWiki process (For example the Formula Macro generates images of rendered formulas, the Chart Macro generates images of rendered chart data, etc).- Since:
- 6.1M2
- Version:
- $Id: a7c36f8a3404daabe9c70d77d5e7b30153af61b4 $
-
-
Field Summary
Fields Modifier and Type Field Description static ResourceType
TYPE
Represents a Temporary Resource Type.
-
Constructor Summary
Constructors Constructor Description TemporaryResourceReference(String moduleId, String resourceName)
TemporaryResourceReference(String moduleId, String resourceName, EntityReference owningEntityReference)
TemporaryResourceReference(String moduleId, List<String> resourcePath, EntityReference owningEntityReference)
Create a new temporary resource reference.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(Object object)
String
getModuleId()
EntityReference
getOwningEntityReference()
String
getResourceName()
List<String>
getResourcePath()
int
hashCode()
-
Methods inherited from class org.xwiki.resource.entity.EntityResourceReference
getAction, getEntityReference, getLocale, getRevision, setAction, setEntityReference, setLocale, setRevision, toString
-
Methods inherited from class org.xwiki.resource.AbstractResourceReference
addParameter, getParameters, getParameterValue, getParameterValues, getType, setParameter, setType
-
-
-
-
Field Detail
-
TYPE
public static final ResourceType TYPE
Represents a Temporary Resource Type.
-
-
Constructor Detail
-
TemporaryResourceReference
public TemporaryResourceReference(String moduleId, List<String> resourcePath, EntityReference owningEntityReference)
Create a new temporary resource reference.- Parameters:
moduleId
- seegetModuleId()
resourcePath
- seegetResourcePath()
owningEntityReference
- seegetOwningEntityReference()
-
TemporaryResourceReference
public TemporaryResourceReference(String moduleId, String resourceName, EntityReference owningEntityReference)
- Parameters:
moduleId
- seegetModuleId()
resourceName
- seegetResourceName()
owningEntityReference
- seegetOwningEntityReference()
-
TemporaryResourceReference
public TemporaryResourceReference(String moduleId, String resourceName)
- Parameters:
moduleId
- seegetModuleId()
resourceName
- seegetResourceName()
-
-
Method Detail
-
getOwningEntityReference
public EntityReference getOwningEntityReference()
- Returns:
- the reference to the entity owning the current temporary resource. This can be used for example to verify that the user asking for the temporary resource has the permission to view the owning entity before letting him access the temporary resource.
-
getResourceName
public String getResourceName()
- Returns:
- the name of the temporary resource (e.g. the temporary file name of a generated image)
-
getResourcePath
public List<String> getResourcePath()
- Returns:
- the path to the temporary resource (within the namespace defined by the module id)
-
getModuleId
public String getModuleId()
- Returns:
- the module id, a free name (used as a namespace) allowing several components to generate temporary resources for the same entity
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classorg.xwiki.resource.entity.EntityResourceReference
-
equals
public boolean equals(Object object)
- Overrides:
equals
in classorg.xwiki.resource.entity.EntityResourceReference
-
-