safe-t-rest 0.0.6 → 0.0.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +13 -0
- data/lib/safe-t-rest.rb +11 -0
- data/safe-t-rest.gemspec +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ee9140c2d479e7d1f0f9db2f211dd1890c4d4dc9
|
4
|
+
data.tar.gz: d99bf04a5f35e10a4844eea944db84a1e7d47c48
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bde559d7b797637e7f096a4d26bebee7f76b357409571a4493144cc91500d2f8793d124a24efe97a4817b3d8be044deade6911a86838b73d95d535f8c9639ee8
|
7
|
+
data.tar.gz: 418c36b26ab33b0e9dd810a0345d5ce19c9c23e2fe25239fb8e1f0e444a990a16c9fcb5c3f7ef477783f68114ca26ce3bd0cf068b4943ae8f8eac10178692851
|
data/README.md
CHANGED
@@ -69,4 +69,17 @@ args = {
|
|
69
69
|
}
|
70
70
|
|
71
71
|
client.iFileUpload(args)
|
72
|
+
```
|
73
|
+
|
74
|
+
# File Download
|
75
|
+
```ruby
|
76
|
+
args = {
|
77
|
+
:file_name => 'file.txt', # The name of the file to download
|
78
|
+
:folder_path => '', # The path of the file
|
79
|
+
:root_folder_id => 417 # My Storage ID
|
80
|
+
}
|
81
|
+
|
82
|
+
file = client.iFileDownload(args) # Get back the file as a base64 string
|
83
|
+
file = Base64.decode64(file) # decode the string
|
84
|
+
File.write('file.txt', file) # write decoded file
|
72
85
|
```
|
data/lib/safe-t-rest.rb
CHANGED
@@ -91,4 +91,15 @@ class SafeTRest
|
|
91
91
|
)
|
92
92
|
end
|
93
93
|
|
94
|
+
def iFileDownload(args)
|
95
|
+
RestClient::Request.execute(
|
96
|
+
:method => :post,
|
97
|
+
:url => @url,
|
98
|
+
:headers => {
|
99
|
+
:servletRequestID => 'MethodRequest',
|
100
|
+
:BusinessLogic => "{Username:'', Password:'', RoleID: '#{@role_id}', ExtensionID: '#{@extenstion_id}', iFileDownload: ['#{@username}', '#{@password}', '#{args[:file_name]}', '#{args[:folder_path]}', #{args[:root_folder_id]}]}"
|
101
|
+
}
|
102
|
+
)
|
103
|
+
end
|
104
|
+
|
94
105
|
end
|
data/safe-t-rest.gemspec
CHANGED