Package step.resources
Interface ResourceManager
-
- All Known Implementing Classes:
LocalResourceManagerImpl,ResourceManagerImpl
public interface ResourceManager
-
-
Field Summary
Fields Modifier and Type Field Description static StringRESOURCE_TYPE_ATTACHMENTstatic StringRESOURCE_TYPE_DATASOURCEstatic StringRESOURCE_TYPE_FUNCTIONSstatic StringRESOURCE_TYPE_PDF_TEST_SCENARIO_FILEstatic StringRESOURCE_TYPE_SECRETstatic StringRESOURCE_TYPE_STAGING_CONTEXT_FILESstatic StringRESOURCE_TYPE_TEMP
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description step.resources.ResourcecreateResource(String resourceType, boolean isDirectory, InputStream resourceStream, String resourceFileName, boolean checkForDuplicates, step.core.objectenricher.ObjectEnricher objectEnricher)step.resources.ResourcecreateResource(String resourceType, InputStream resourceStream, String resourceFileName, boolean checkForDuplicates, step.core.objectenricher.ObjectEnricher objectEnricher)ResourceRevisionContainercreateResourceContainer(String resourceType, String resourceFileName)voiddeleteResource(String resourceId)Delete the resource and all its revisionsstep.resources.ResourcegetResource(String resourceId)ResourceRevisionContentgetResourceContent(String resourceId)Get the content of an existingResourceResourceRevisionFileHandlegetResourceFile(String resourceId)step.resources.ResourceRevisiongetResourceRevision(String resourceRevisionId)ResourceRevisionContentImplgetResourceRevisionContent(String resourceRevisionId)StringgetResourcesRootPath()booleanresourceExists(String resourceId)Test if a given resource id existsstep.resources.ResourcesaveResource(step.resources.Resource resource)Saved the resource object onlystep.resources.ResourcesaveResourceContent(String resourceId, InputStream resourceStream, String resourceFileName)Save the content provided as stream to an existing resource.step.resources.ResourceRevisionsaveResourceRevision(step.resources.ResourceRevision resourceRevision)
-
-
-
Field Detail
-
RESOURCE_TYPE_PDF_TEST_SCENARIO_FILE
static final String RESOURCE_TYPE_PDF_TEST_SCENARIO_FILE
- See Also:
- Constant Field Values
-
RESOURCE_TYPE_SECRET
static final String RESOURCE_TYPE_SECRET
- See Also:
- Constant Field Values
-
RESOURCE_TYPE_DATASOURCE
static final String RESOURCE_TYPE_DATASOURCE
- See Also:
- Constant Field Values
-
RESOURCE_TYPE_FUNCTIONS
static final String RESOURCE_TYPE_FUNCTIONS
- See Also:
- Constant Field Values
-
RESOURCE_TYPE_STAGING_CONTEXT_FILES
static final String RESOURCE_TYPE_STAGING_CONTEXT_FILES
- See Also:
- Constant Field Values
-
RESOURCE_TYPE_ATTACHMENT
static final String RESOURCE_TYPE_ATTACHMENT
- See Also:
- Constant Field Values
-
RESOURCE_TYPE_TEMP
static final String RESOURCE_TYPE_TEMP
- See Also:
- Constant Field Values
-
-
Method Detail
-
createResource
step.resources.Resource createResource(String resourceType, InputStream resourceStream, String resourceFileName, boolean checkForDuplicates, step.core.objectenricher.ObjectEnricher objectEnricher) throws IOException, SimilarResourceExistingException, InvalidResourceFormatException
- Parameters:
resourceType- the type of the resourceresourceStream- the stream of the resource to be savedresourceFileName- the name of the resource (filename)checkForDuplicates- is duplicate should be checkedobjectEnricher- theObjectEnricherof the context- Returns:
- the created
Resource - Throws:
IOException- an IOException occurs during the callSimilarResourceExistingException- a similar resource existInvalidResourceFormatException
-
createResource
step.resources.Resource createResource(String resourceType, boolean isDirectory, InputStream resourceStream, String resourceFileName, boolean checkForDuplicates, step.core.objectenricher.ObjectEnricher objectEnricher) throws IOException, SimilarResourceExistingException, InvalidResourceFormatException
-
createResourceContainer
ResourceRevisionContainer createResourceContainer(String resourceType, String resourceFileName) throws IOException
- Throws:
IOException
-
resourceExists
boolean resourceExists(String resourceId)
Test if a given resource id exists- Parameters:
resourceId- the id of the resource to test- Returns:
- true if the resource exists
-
getResourceContent
ResourceRevisionContent getResourceContent(String resourceId) throws IOException
Get the content of an existingResource- Parameters:
resourceId- the id of theResourceto be deleted- Returns:
- the content of the resource as stream
- Throws:
IOException- an IOException occurs during the call
-
getResourceFile
ResourceRevisionFileHandle getResourceFile(String resourceId)
-
getResource
step.resources.Resource getResource(String resourceId)
-
getResourceRevisionContent
ResourceRevisionContentImpl getResourceRevisionContent(String resourceRevisionId) throws IOException
- Throws:
IOException
-
getResourceRevision
step.resources.ResourceRevision getResourceRevision(String resourceRevisionId)
-
getResourcesRootPath
String getResourcesRootPath()
-
saveResourceContent
step.resources.Resource saveResourceContent(String resourceId, InputStream resourceStream, String resourceFileName) throws IOException, InvalidResourceFormatException
Save the content provided as stream to an existing resource. This creates a newResourceRevisionfor theResourceand saves the content provided as stream under this revision.- Parameters:
resourceId- the id of the resource to be updatedresourceStream- the stream of the resource to be savedresourceFileName- the name of the resource (filename)- Returns:
- the updated
Resource - Throws:
IOException- an IOException occurs during the callInvalidResourceFormatException
-
saveResource
step.resources.Resource saveResource(step.resources.Resource resource) throws IOExceptionSaved the resource object only- Parameters:
resource- the resource to be saved- Returns:
- the updated
Resource - Throws:
IOException- an IOException occurs during the call
-
saveResourceRevision
step.resources.ResourceRevision saveResourceRevision(step.resources.ResourceRevision resourceRevision) throws IOException- Throws:
IOException
-
deleteResource
void deleteResource(String resourceId)
Delete the resource and all its revisions- Parameters:
resourceId- the id of theResourceto be deleted
-
-