Package com.avoka.tm.svc
Class SpaceResourceBuilder
java.lang.Object
com.avoka.tm.svc.SpaceResourceBuilder
Provides a SpaceResource value object builder class.
Examples
Please find the SpaceResource builder examples below.
Create a SpaceResource with space id and path
This example shows how to create a SpaceResource
object.
import com.avoka.tm.svc.* import com.avoka.tm.vo.* SpaceResource spaceResource = new SpaceResourceBuilder() .setSpaceId(1) .setResourcePath("/resources/css/test.css") .setFileData(new byte[] {123}) .create()
Update a SpaceResource with space name and path
This example shows how to Update a SpaceResource
object.
import com.avoka.tm.svc.* import com.avoka.tm.vo.* SpaceResource spaceResource= new SpaceResource() .setSpaceName("workspaces") .setResourcePath("/resources/css/test.css") .setFileData(new byte[] {152}) .update()
Create or Update a SpaceResource with space id and path
The example below shows how to create or update a SpaceResource
object.
import com.avoka.tm.svc.* import com.avoka.tm.vo.* SpaceResource spaceResource= new SpaceResource() .setSpaceId(2) .setResourcePath("/resources/css/test.css") .setFileData(new byte[] {156}) .createOrUpdate()
- Since:
- 24.10.0
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptioncreate()
Create a new space resource based on the specified parameters and return the new space resource value object.Create or update the space resource specified by the given parameters, and return current space resource value object.setFileData
(byte[] fileData) Set the file Data parameter.setResourcePath
(String resourcePath) Set the resource path parameter.setSpaceId
(Long spaceId) Set the space id parameter.setSpaceName
(String spaceName) Set the space name parameter.update()
Update the space resource specified by the resource path and space parameter and return the updated space resource value object.
-
Constructor Details
-
SpaceResourceBuilder
@FluentSecurityPermission(permissions={"portal-edit","portal-content-edit","portal-style-edit"}) public SpaceResourceBuilder()Create a SpaceResource service object
-
-
Method Details
-
setSpaceId
Set the space id parameter.- Parameters:
spaceId
- space id- Returns:
- the Space resource builder
-
setSpaceName
Set the space name parameter.- Parameters:
spaceName
- space name- Returns:
- the Space resource builder
-
setResourcePath
Set the resource path parameter.- Parameters:
resourcePath
- resource path- Returns:
- the Space resource builder
-
setFileData
Set the file Data parameter.- Parameters:
fileData
- file Data- Returns:
- the Space resource builder
-
create
Create a new space resource based on the specified parameters and return the new space resource value object.- Returns:
- the newly created space resource value object
- Throws:
IllegalAccessException
-
update
Update the space resource specified by the resource path and space parameter and return the updated space resource value object. This method will throw a IllegalArgumentException if the space resource specified by specified parameters was not found.- Returns:
- the updated space resource value object
- Throws:
IllegalAccessException
-
createOrUpdate
Create or update the space resource specified by the given parameters, and return current space resource value object. If the space resource specified by the resource path and space is not found then a new space resource will be created.- Returns:
- create or update the space resource specified by the given parameters, and return current space resource value object
- Throws:
IllegalAccessException
-