-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add support for custom template in automatic renaming during up…
- Loading branch information
Showing
10 changed files
with
528 additions
and
109 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,11 @@ | ||
package run.halo.s3os; | ||
|
||
import org.apache.commons.lang3.StringUtils; | ||
|
||
import java.time.LocalDate; | ||
import lombok.experimental.UtilityClass; | ||
|
||
@UtilityClass | ||
public class FilePathUtils { | ||
private FilePathUtils() { | ||
|
||
} | ||
|
||
public static String getFilePathByPlaceholder(String filename) { | ||
LocalDate localDate = LocalDate.now(); | ||
return StringUtils.replaceEach(filename, | ||
new String[] {"${year}","${month}","${day}"}, | ||
new String[] { | ||
String.valueOf(localDate.getYear()), | ||
String.valueOf(localDate.getMonthValue()), | ||
String.valueOf(localDate.getDayOfMonth()) | ||
} | ||
); | ||
public static String getFilePathByPlaceholder(String filePath) { | ||
return PlaceholderReplacer.replacePlaceholders(filePath, ""); | ||
} | ||
} |
Oops, something went wrong.