apps/docs/src/content/docs/en/java-sdk/volume-service.mdx
Service for managing Daytona Volumes.
Volumes provide persistent shared storage that can be mounted into Sandboxes.
public Volume create(String name)
Creates a new volume.
Parameters:
name String - volume nameReturns:
Volume - created VolumeThrows:
io.daytona.sdk.exception.DaytonaException - if creation failspublic List<Volume> list()
Lists all accessible volumes.
Returns:
List\<Volume\> - list of available volumesThrows:
io.daytona.sdk.exception.DaytonaException - if the API request failspublic Volume getByName(String name)
Retrieves a volume by name.
Parameters:
name String - volume nameReturns:
Volume - matching VolumeThrows:
io.daytona.sdk.exception.DaytonaException - if no volume is found or request failspublic void delete(String id)
Deletes a volume by ID.
Parameters:
id String - volume identifierThrows:
io.daytona.sdk.exception.DaytonaException - if deletion fails