mirror of
https://github.com/fog/fog.git
synced 2022-11-09 13:51:43 -05:00
[local|storage] Add copy method to Local::File.
This fixes fog/fog#735.
This commit is contained in:
parent
553c05ec05
commit
288f5714c2
1 changed files with 7 additions and 0 deletions
|
@ -36,6 +36,13 @@ module Fog
|
|||
@directory
|
||||
end
|
||||
|
||||
def copy(target_directory_key, target_file_key, options={})
|
||||
requires :directory, :key
|
||||
connection.copy_object(directory.key, key, target_directory_key, target_file_key)
|
||||
target_directory = connection.directories.new(:key => target_directory_key)
|
||||
target_directory.files.get(target_file_key)
|
||||
end
|
||||
|
||||
def destroy
|
||||
requires :directory, :key
|
||||
::File.delete(path) if ::File.exists?(path)
|
||||
|
|
Loading…
Add table
Reference in a new issue