mirror of
https://github.com/fog/fog.git
synced 2022-11-09 13:51:43 -05:00
[local|storage] Add copy_object method to Local::Storage.
This commit is contained in:
parent
82d8cbabc2
commit
553c05ec05
1 changed files with 8 additions and 0 deletions
|
@ -64,6 +64,14 @@ module Fog
|
|||
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
|
||||
|
|
Loading…
Reference in a new issue