File tree Expand file tree Collapse file tree 3 files changed +14
-0
lines changed
Expand file tree Collapse file tree 3 files changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -136,6 +136,10 @@ def delete_folder(folder_path)
136136 @file . delete_folder ( folder_path )
137137 end
138138
139+ def copy_folder ( source_folder_path , destination_path )
140+ @file . copy_folder ( source_folder_path , destination_path )
141+ end
142+
139143 def phash_distance ( first , second )
140144 # Get hamming distance between two phash(image hash) to check
141145 # similarity between images
Original file line number Diff line number Diff line change @@ -7,6 +7,7 @@ module URL
77 BULK_FILE_DELETE = "/batch/deleteByFileIds"
88 UPLOAD = "/upload"
99 REMOTE_METADATA_FULL_URL = "https://api.imagekit.io/v1/metadata"
10+ BULK_BASE_URL = 'https://api.imagekit.io/v1/bulkJobs'
1011 end
1112 end
1213end
Original file line number Diff line number Diff line change @@ -187,6 +187,15 @@ def delete_folder(folder_path)
187187 @req_obj . request ( 'delete' , url , @req_obj . create_headers , payload )
188188 end
189189
190+ def copy_folder ( source_folder_path , destination_path )
191+ if source_folder_path == '' || source_folder_path . nil? || destination_path == '' || destination_path . nil?
192+ raise ArgumentError , 'parameters required'
193+ end
194+ url = "#{ constants . BULK_BASE_URL } /copyFolder"
195+ payload = { 'sourceFolderPath' : source_folder_path , 'destinationPath' : destination_path }
196+ @req_obj . request ( 'post' , url , @req_obj . create_headers , payload )
197+ end
198+
190199 def validate_upload_options ( options )
191200
192201 # Validates upload value, checks if params are valid,
You can’t perform that action at this time.
0 commit comments