mirror of
https://github.com/continew-org/continew-starter.git
synced 2025-09-19 12:57:10 +08:00
refactor(storage): 修复对象存储路径拼接问题
This commit is contained in:
@@ -71,16 +71,29 @@ public class StorageUtils {
|
||||
}
|
||||
|
||||
/**
|
||||
* 默认路径地址 格式 2024/03/10/
|
||||
* 本地存储默认路径地址 格式
|
||||
* <p>mac/linux : 2024/03/10/</>
|
||||
* <p>windows : 2024\03\10\</>
|
||||
*
|
||||
* @return {@link String }
|
||||
*/
|
||||
public static String defaultPath() {
|
||||
public static String localDefaultPath() {
|
||||
LocalDate today = LocalDate.now();
|
||||
return Paths.get(String.valueOf(today.getYear()), String.valueOf(today.getMonthValue()), String.valueOf(today
|
||||
.getDayOfMonth())) + StringConstants.SLASH;
|
||||
}
|
||||
|
||||
/**
|
||||
* 对象存储默认路径 格式 2024/03/10/
|
||||
*
|
||||
* @return {@link String }
|
||||
*/
|
||||
public static String ossDefaultPath() {
|
||||
LocalDate today = LocalDate.now();
|
||||
return today.getYear() + StringConstants.SLASH + today.getMonthValue() + StringConstants.SLASH + today
|
||||
.getDayOfMonth() + StringConstants.SLASH;
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据 endpoint 判断是否带有 http 或 https,如果没有则加上 http 前缀。
|
||||
*
|
||||
|
Reference in New Issue
Block a user