Potrzebuję wysłać folder z podfolderami na amazon s3. Próbuję przesłać z tym snipetem.Jak wgrać folder z podfolderem do amazon s3?
for (Path path : directoryWalk("/home/rmuhamedgaliev/tmp/eota7tas0cdlg2ufq5mlke7olf/")){
if (!path.getParent().toString().equals("eota7tas0cdlg2ufq5mlke7olf")){
amazonS3Client.putObject("*****", "/plans/eota7tas0cdlg2ufq5mlke7olf/" + path.getParent().toString() + "/" + path.getFileName(), new File(path.toString()));
} else {
amazonS3Client.putObject("*******", "/plans/eota7tas0cdlg2ufq5mlke7olf/" + path.getFileName(), new File(path.toString()));
}
}
Ale ten kod tworzenie pełnych ścieżek plików z ("/ home/rmuhamedgaliev/tmp/eota7tas0cdlg2ufq5mlke7olf"). Jak przesłać go ze ścieżką ("/ planów/eota7tas0cdlg2ufq5mlke7olf/{podfolderów i plików}")
private List<Path> directoryWalk(String path) throws IOException {
final List<Path> files = new ArrayList<>();
Files.walkFileTree(Paths.get(path), new SimpleFileVisitor<Path>() {
@Override
public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) throws IOException {
files.add(file);
return FileVisitResult.CONTINUE;
}
});
return files;
}
Chcę przesłać wszystkie pliki, które są obecne w jednym folderze, takie jak Załóżmy, że mam folderu nazwa „TestMech”, która zawiera liczbę zdjęć, że wszystkie zdjęcia muszę przesłać za pomocą wskaźnika postępu jest to możliwe i w jaki sposób –