Class LocalStorageProvider
java.lang.Object
dev.jensderuiter.minecraft_imagery.storage.LocalStorageProvider
- All Implemented Interfaces:
StorageProvider
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionFetch an image from the local storage.getFileName(String fileName) voidRemove an image from the S3 bucket.store(BufferedImage image) Store an image in the local storage.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface dev.jensderuiter.minecraft_imagery.storage.StorageProvider
downloadUrlEnabled, generateDownloadUrl, getExtension
-
Constructor Details
-
LocalStorageProvider
public LocalStorageProvider()Initialize the Local storage provider. This saves images to the storage/ folder inside the plugin data folder.
-
-
Method Details
-
fetch
Fetch an image from the local storage. Image is in PNG format (TYPE_INT_ARGB).- Specified by:
fetchin interfaceStorageProvider- Parameters:
uuid- The UUID of the image to fetch. You have saved this from the store method.- Returns:
- The image with the specified UUID.
- Throws:
StorageException- When the fetching fails.
-
store
Store an image in the local storage. Will be stored as (generated uuid).png- Specified by:
storein interfaceStorageProvider- Parameters:
image- The image to store.- Returns:
- The UUID of the image you've just stored. Used to retrieve or remove the image.
- Throws:
StorageException- When storing the image fails.
-
remove
Remove an image from the S3 bucket.- Specified by:
removein interfaceStorageProvider- Parameters:
uuid- The UUID of the image to remove. You have saved this from the store method.- Throws:
StorageException- When the deletion fails. Permissions? Already gone?
-
getFileName
- Specified by:
getFileNamein interfaceStorageProvider
-