Package step.resources
Interface ResourceManager
-
- All Known Implementing Classes:
LocalResourceManagerImpl
,RemoteResourceManager
,ResourceManagerImpl
public interface ResourceManager
-
-
Field Summary
Fields Modifier and Type Field Description static String
RESOURCE_TYPE_ATTACHMENT
static String
RESOURCE_TYPE_DATASOURCE
static String
RESOURCE_TYPE_FUNCTIONS
static String
RESOURCE_TYPE_PDF_TEST_SCENARIO_FILE
static String
RESOURCE_TYPE_SECRET
static String
RESOURCE_TYPE_STAGING_CONTEXT_FILES
static String
RESOURCE_TYPE_TEMP
-
Method Summary
-
-
-
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
Resource createResource(String resourceType, InputStream resourceStream, String resourceFileName, boolean checkForDuplicates, ObjectEnricher objectEnricher) throws IOException, SimilarResourceExistingException
- 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
- theObjectEnricher
of the context- Returns:
- the created
Resource
- Throws:
IOException
- an IOException occurs during the callSimilarResourceExistingException
- a similar resource exist
-
saveResourceContent
Resource saveResourceContent(String resourceId, InputStream resourceStream, String resourceFileName) throws IOException
Save the content provided as stream to an existing resource. This creates a newResourceRevision
for theResource
and 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 call
-
saveResource
Resource saveResource(Resource resource) throws IOException
Saved the resource object only- Parameters:
resource
- the resource to be saved- Returns:
- the updated
Resource
- Throws:
IOException
- an IOException occurs during the call
-
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
-
deleteResource
void deleteResource(String resourceId)
Delete the resource and all its revisions- Parameters:
resourceId
- the id of theResource
to be deleted
-
getResourceContent
ResourceRevisionContent getResourceContent(String resourceId) throws IOException
Get the content of an existingResource
- Parameters:
resourceId
- the id of theResource
to be deleted- Returns:
- the content of the resource as stream
- Throws:
IOException
- an IOException occurs during the call
-
getResourceFile
ResourceRevisionFileHandle getResourceFile(String resourceId)
-
getResourceRevisionByResourceId
ResourceRevision getResourceRevisionByResourceId(String resourceId)
-
getResourceRevisionContent
ResourceRevisionContentImpl getResourceRevisionContent(String resourceRevisionId) throws IOException
- Throws:
IOException
-
createResourceContainer
ResourceRevisionContainer createResourceContainer(String resourceType, String resourceFileName) throws IOException
- Throws:
IOException
-
getResourcesRootPath
String getResourcesRootPath()
-
updateResourceContent
Resource updateResourceContent(Resource resource, InputStream resourceStream, String resourceFileName, ResourceRevision revision) throws IOException
- Throws:
IOException
-
saveResourceRevision
ResourceRevision saveResourceRevision(ResourceRevision resourceRevision) throws IOException
- Throws:
IOException
-
-