mirror of https://github.com/halo-dev/halo
Merge branch 'dev' of github.com:halo-dev/halo into dev
commit
ede23329d5
|
@ -0,0 +1,17 @@
|
||||||
|
name: Java CI
|
||||||
|
|
||||||
|
on: [push]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v1
|
||||||
|
- name: Set up JDK 1.8
|
||||||
|
uses: actions/setup-java@v1
|
||||||
|
with:
|
||||||
|
java-version: 1.8
|
||||||
|
- name: Build with Gradle
|
||||||
|
run: ./gradlew build
|
|
@ -39,6 +39,7 @@ import java.util.LinkedHashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
import java.util.stream.Stream;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Backup service implementation.
|
* Backup service implementation.
|
||||||
|
@ -177,9 +178,9 @@ public class BackupServiceImpl implements BackupService {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<BackupDTO> listHaloBackups() {
|
public List<BackupDTO> listHaloBackups() {
|
||||||
try {
|
// Build backup dto
|
||||||
// Build backup dto
|
try (Stream<Path> subPathStream = Files.list(Paths.get(haloProperties.getBackupDir()))) {
|
||||||
return Files.list(Paths.get(haloProperties.getBackupDir()))
|
return subPathStream
|
||||||
.filter(backupPath -> StringUtils.startsWithIgnoreCase(backupPath.getFileName().toString(), HaloConst.HALO_BACKUP_PREFIX))
|
.filter(backupPath -> StringUtils.startsWithIgnoreCase(backupPath.getFileName().toString(), HaloConst.HALO_BACKUP_PREFIX))
|
||||||
.map(this::buildBackupDto)
|
.map(this::buildBackupDto)
|
||||||
.sorted((leftBackup, rightBackup) -> {
|
.sorted((leftBackup, rightBackup) -> {
|
||||||
|
|
Loading…
Reference in New Issue