⬅ Back to Main README
Spring Boot integration for the BunnyNet Java client.
This module provides auto-configuration and property binding for Bunny Storage clients, allowing applications to easily integrate with Bunny Storage using Spring Boot.
Both single-region and multi-region storage clients are supported.
Add the Spring module dependency.
implementation("io.github.range79:bunnynetunofficial-spring:VERSION")implementation "io.github.range79:bunnynetunofficial-spring:VERSION"<dependency>
<groupId>io.github.range79</groupId>
<artifactId>bunnynetunofficial-spring</artifactId>
<version>VERSION</version>
</dependency>The Spring starter exposes two configuration groups:
bunnynet.singlebunnynet.multi
Each client can be enabled independently.
bunnynet:
single:
enabled: true
api-key: YOUR_API_KEY
storage-zone: your-storage-zone
region: LONDON_UKWhen enabled, the starter automatically registers a SingleBunnyStorage bean.
bunnynet:
multi:
enabled: true
api-key: YOUR_API_KEYWhen enabled, the starter automatically registers a MultiBunnyStorage bean.
@Service
public class StorageService {
private final SingleBunnyStorage storage;
public StorageService(SingleBunnyStorage storage) {
this.storage = storage;
}
public void upload(PutObjectRequest request) {
storage.uploadFile(request);
}
}@Service
public class MultiStorageService {
private final MultiBunnyStorage storage;
public MultiStorageService(MultiBunnyStorage storage) {
this.storage = storage;
}
public void upload(PutObjectRequest request) {
storage.uploadFile(
request,
"storage-zone",
Region.LONDON_UK
);
}
}| Property | Description |
|---|---|
bunnynet.single.enabled |
Enables the single storage client |
bunnynet.single.api-key |
Bunny Storage API key |
bunnynet.single.storage-zone |
Default storage zone |
bunnynet.single.region |
Default storage region |
| Property | Description |
|---|---|
bunnynet.multi.enabled |
Enables the multi storage client |
bunnynet.multi.api-key |
Bunny Storage API key |
The Spring module automatically registers storage clients using Spring Boot auto-configuration.
Internal configuration classes:
SingleBunnyStorageConfig
MultiBunnyStorageConfig
These classes create and configure the storage clients based on Spring Boot properties.
Spring Application
↓
BunnyNet Spring AutoConfiguration
↓
SingleBunnyStorage / MultiBunnyStorage
↓
BunnyNet Core
↓
Bunny Storage API
- Java 17+
- Spring Boot 3+
This project is licensed under the Apache License 2.0.