@Component public class OSSFileUploaderComponent extends java.lang.Object implements FileUploader
限定符和类型 | 字段和说明 |
---|---|
private CacheEntity<java.lang.Short,software.amazon.awssdk.services.s3.S3Client> |
cache |
private ConfigDataComponent |
configDataComponent |
private CacheEntity<java.lang.Short,software.amazon.awssdk.services.s3.presigner.S3Presigner> |
presignerCache |
构造器和说明 |
---|
OSSFileUploaderComponent() |
限定符和类型 | 方法和说明 |
---|---|
void |
clear() |
void |
clear(short siteId) |
boolean |
enablePrefix(short siteId,
boolean privatefile) |
static boolean |
enableUpload(java.util.Map<java.lang.String,java.lang.String> config,
boolean privatefile) |
boolean |
enableUpload(short siteId,
boolean privatefile) |
java.lang.String |
getCacheCode() |
software.amazon.awssdk.services.s3.S3Client |
getClient(short siteId,
boolean privatefile,
java.util.Map<java.lang.String,java.lang.String> config) |
java.lang.String |
getPrefix(short siteId,
boolean privatefile) |
software.amazon.awssdk.services.s3.presigner.S3Presigner |
getPresigner(short siteId,
java.util.Map<java.lang.String,java.lang.String> config) |
java.lang.String |
getPrivateFileUrl(short siteId,
int expiryMinutes,
java.lang.String filepath) |
void |
initCache(CacheEntityFactory cacheEntityFactory) |
FileUploadResult |
upload(short siteId,
byte[] file,
boolean privatefile,
java.lang.String filepath,
java.util.Locale locale) |
FileUploadResult |
upload(short siteId,
org.springframework.web.multipart.MultipartFile file,
boolean privatefile,
java.lang.String filepath,
java.util.Locale locale) |
private ConfigDataComponent configDataComponent
private CacheEntity<java.lang.Short,software.amazon.awssdk.services.s3.S3Client> cache
private CacheEntity<java.lang.Short,software.amazon.awssdk.services.s3.presigner.S3Presigner> presignerCache
public software.amazon.awssdk.services.s3.presigner.S3Presigner getPresigner(short siteId, java.util.Map<java.lang.String,java.lang.String> config)
public software.amazon.awssdk.services.s3.S3Client getClient(short siteId, boolean privatefile, java.util.Map<java.lang.String,java.lang.String> config)
public boolean enableUpload(short siteId, boolean privatefile)
enableUpload
在接口中 FileUploader
public boolean enablePrefix(short siteId, boolean privatefile)
enablePrefix
在接口中 FileUploader
public static boolean enableUpload(java.util.Map<java.lang.String,java.lang.String> config, boolean privatefile)
public java.lang.String getPrivateFileUrl(short siteId, int expiryMinutes, java.lang.String filepath)
getPrivateFileUrl
在接口中 FileUploader
public java.lang.String getPrefix(short siteId, boolean privatefile)
getPrefix
在接口中 FileUploader
public FileUploadResult upload(short siteId, org.springframework.web.multipart.MultipartFile file, boolean privatefile, java.lang.String filepath, java.util.Locale locale) throws java.io.IOException
upload
在接口中 FileUploader
java.io.IOException
public FileUploadResult upload(short siteId, byte[] file, boolean privatefile, java.lang.String filepath, java.util.Locale locale) throws java.io.IOException
upload
在接口中 FileUploader
java.io.IOException
public void initCache(CacheEntityFactory cacheEntityFactory) throws java.lang.ClassNotFoundException, java.lang.InstantiationException, java.lang.IllegalAccessException
cacheEntityFactory
- java.lang.IllegalAccessException
java.lang.InstantiationException
java.lang.ClassNotFoundException
public java.lang.String getCacheCode()
getCacheCode
在接口中 FileUploader