Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

[local|storage] Add copy_object method to Local::Storage.

  • Loading branch information...
commit 553c05ec0597b79d1e20bdc1f528e97237836ff4 1 parent 82d8cba
@benmanns benmanns authored
Showing with 8 additions and 0 deletions.
  1. +8 −0 lib/fog/local/storage.rb
View
8 lib/fog/local/storage.rb
@@ -64,6 +64,14 @@ def local_root
def path_to(partial)
::File.join(@local_root, partial)
end
+
+ def copy_object(source_directory_name, source_object_name, target_directory_name, target_object_name, options={})
+ require 'fileutils'
+ source_path = path_to(::File.join(source_directory_name, source_object_name))
+ target_path = path_to(::File.join(target_directory_name, target_object_name))
+ ::FileUtils.mkdir_p(::File.dirname(source_path))
+ ::FileUtils.copy_file(source_path, target_path)
+ end
end
end
Please sign in to comment.
Something went wrong with that request. Please try again.