Package tech.muyan.utils
Class StorageUtils
- java.lang.Object
-
- tech.muyan.utils.StorageUtils
-
public class StorageUtils extends java.lang.Object
Utility class for attachment operations.
-
-
Constructor Summary
Constructors Constructor Description StorageUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static StorageFieldValue
createStorageFileDomain(java.lang.String fileName, java.lang.String mimeType, java.io.InputStream inputStream)
Creates a StorageFieldValue object representing a file in the system.
-
-
-
Method Detail
-
createStorageFileDomain
public static StorageFieldValue createStorageFileDomain(java.lang.String fileName, java.lang.String mimeType, java.io.InputStream inputStream)
Creates a StorageFieldValue object representing a file in the system. The actual storage location of the file depends on the DynamicConfig setting with key "attachment.storageEngine". It can be either stored in an S3-compatible storage or in the local file system.- Parameters:
fileName
- The name of the file to be storedmimeType
- The MIME type of the fileinputStream
- An InputStream containing the file data- Returns:
- A StorageFieldValue object representing the stored file
- Throws:
java.lang.IllegalStateException
- if the method is called without proper platform implementation
-
-