File tree Expand file tree Collapse file tree
DriveBackup/src/main/java/ratismal/drivebackup/uploaders/s3 Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -63,7 +63,8 @@ public void test(File testFile) {
6363 public void uploadFile (File file , String type ) {
6464 type = normalizeType (type );
6565 try {
66- String key = type + "/" + file .getName ();
66+ String destination = getRemoteSaveDirectory ();
67+ String key = destination + "/" + type + "/" + file .getName ();
6768 minioClient .uploadObject (UploadObjectArgs .builder ().bucket (bucket ).object (key ).filename (file .getAbsolutePath ()).build ());
6869 try {
6970 pruneBackups (type );
@@ -87,7 +88,8 @@ public void pruneBackups(String type) throws Exception {
8788 if (fileLimit == -1 ) {
8889 return ;
8990 }
90- TreeMap <ZonedDateTime , Item > files = getZipFiles (type );
91+ String destination = getRemoteSaveDirectory ();
92+ TreeMap <ZonedDateTime , Item > files = getZipFiles (destination + "/" +type );
9193 if (files .size () > fileLimit ) {
9294 Map <String , String > placeholders = new HashMap <>(3 );
9395 placeholders .put ("file-count" , String .valueOf (files .size ()));
You can’t perform that action at this time.
0 commit comments