Class: Files::Folder
- Inherits:
-
Object
- Object
- Files::Folder
- Defined in:
- lib/files.com/models/folder.rb
Instance Attribute Summary collapse
-
#attributes ⇒ Object
readonly
Returns the value of attribute attributes.
-
#options ⇒ Object
readonly
Returns the value of attribute options.
- #pos ⇒ Object
Class Method Summary collapse
- .[](*_) ⇒ Object
- .chdir(path, &block) ⇒ Object
- .children(path, _encoding = "") ⇒ Object
- .chroot(*args) ⇒ Object
-
.create(path, params = {}, options = {}) ⇒ Object
Parameters: path (required) - string - Path to operate on.
- .delete(path, params = {}, options = {}) ⇒ Object
- .destroy(path, params = {}, options = {}) ⇒ Object
- .each_child(path, _encoding = "", &block) ⇒ Object
- .empty?(*_args) ⇒ Boolean
- .entries(path) ⇒ Object
- .exist?(*args) ⇒ Boolean
- .find(path, params = {}, options = {}) ⇒ Object
- .foreach(path, _encoding = "", params = {}, options = {}, &block) ⇒ Object
- .get(path, params = {}, options = {}) ⇒ Object
- .getwd(*_args) ⇒ Object
- .glob(*_) ⇒ Object
- .home(*_args) ⇒ Object
-
.list_for(path, params = {}, options = {}) ⇒ Object
Parameters: cursor - string - Send cursor to resume an existing list from the point at which you left off.
- .mkdir(path, params = {}, options = {}) ⇒ Object
- .open(*args, &block) ⇒ Object
- .pwd(*_args) ⇒ Object
- .rmdir(path) ⇒ Object
- .unlink(path) ⇒ Object
- .update(path, params = {}, options = {}) ⇒ Object
Instance Method Summary collapse
-
#bundle_registration_code ⇒ Object
string.
- #bundle_registration_code=(value) ⇒ Object
- #close(*args) ⇒ Object
- #contents ⇒ Object
-
#crc32 ⇒ Object
string - File CRC32 checksum.
- #crc32=(value) ⇒ Object
-
#created_at ⇒ Object
date-time - File created date/time.
-
#created_by_api_key_id ⇒ Object
int64 - ID of the API key that created the file/folder.
- #created_by_api_key_id=(value) ⇒ Object
-
#created_by_as2_incoming_message_id ⇒ Object
int64 - ID of the AS2 Incoming Message that created the file/folder.
- #created_by_as2_incoming_message_id=(value) ⇒ Object
-
#created_by_automation_id ⇒ Object
int64 - ID of the Automation that created the file/folder.
- #created_by_automation_id=(value) ⇒ Object
-
#created_by_bundle_registration_id ⇒ Object
int64 - ID of the Bundle Registration that created the file/folder.
- #created_by_bundle_registration_id=(value) ⇒ Object
-
#created_by_id ⇒ Object
int64 - User ID of the User who created the file/folder.
- #created_by_id=(value) ⇒ Object
-
#created_by_inbox_id ⇒ Object
int64 - ID of the Inbox that created the file/folder.
- #created_by_inbox_id=(value) ⇒ Object
-
#created_by_remote_server_id ⇒ Object
int64 - ID of the Remote Server that created the file/folder.
- #created_by_remote_server_id=(value) ⇒ Object
-
#created_by_sync_id ⇒ Object
int64 - ID of the Sync that created the file/folder.
- #created_by_sync_id=(value) ⇒ Object
-
#custom_metadata ⇒ Object
object - Custom metadata map of keys and values.
- #custom_metadata=(value) ⇒ Object
-
#display_name ⇒ Object
string - File/Folder display name.
- #display_name=(value) ⇒ Object
-
#download_uri ⇒ Object
string - Link to download file.
- #download_uri=(value) ⇒ Object
- #each(&block) ⇒ Object
- #fileno ⇒ Object
-
#headers ⇒ Object
object - Used for internal url management.
- #headers=(value) ⇒ Object
-
#id ⇒ Object
int64 - File/Folder ID.
- #id=(value) ⇒ Object
-
#initialize(*args) ⇒ Folder
constructor
A new instance of Folder.
-
#internal_download_uri ⇒ Object
string - For use with internal services and should also be with headers and socks_ips.
- #internal_download_uri=(value) ⇒ Object
-
#is_locked ⇒ Object
boolean - Is this folder locked and unable to be modified?.
- #is_locked=(value) ⇒ Object
-
#last_modified_by_api_key_id ⇒ Object
int64 - ID of the API key that last modified the file/folder.
- #last_modified_by_api_key_id=(value) ⇒ Object
-
#last_modified_by_automation_id ⇒ Object
int64 - ID of the Automation that last modified the file/folder.
- #last_modified_by_automation_id=(value) ⇒ Object
-
#last_modified_by_bundle_registration_id ⇒ Object
int64 - ID of the Bundle Registration that last modified the file/folder.
- #last_modified_by_bundle_registration_id=(value) ⇒ Object
-
#last_modified_by_id ⇒ Object
int64 - User ID of the User who last modified the file/folder.
- #last_modified_by_id=(value) ⇒ Object
-
#last_modified_by_remote_server_id ⇒ Object
int64 - ID of the Remote Server that last modified the file/folder.
- #last_modified_by_remote_server_id=(value) ⇒ Object
-
#last_modified_by_sync_id ⇒ Object
int64 - ID of the Sync that last modified the file/folder.
- #last_modified_by_sync_id=(value) ⇒ Object
-
#md5 ⇒ Object
string - File MD5 checksum.
- #md5=(value) ⇒ Object
-
#mime_type ⇒ Object
string - MIME Type.
- #mime_type=(value) ⇒ Object
-
#mkdir_parents ⇒ Object
boolean - Create parent directories if they do not exist?.
- #mkdir_parents=(value) ⇒ Object
-
#mtime ⇒ Object
date-time - File last modified date/time, according to the server.
- #mtime=(value) ⇒ Object
-
#path ⇒ Object
string - File/Folder path.
- #path=(value) ⇒ Object
-
#path_absolute ⇒ Object
string - File/Folder absolute path for Bundle Trusted Relay use.
- #path_absolute=(value) ⇒ Object
-
#permissions ⇒ Object
string - A short string representing the current user's permissions.
- #permissions=(value) ⇒ Object
-
#preview ⇒ Object
Preview - File preview.
- #preview=(value) ⇒ Object
-
#preview_id ⇒ Object
int64 - File preview ID.
- #preview_id=(value) ⇒ Object
-
#priority_color ⇒ Object
string - Bookmark/priority color of file/folder.
- #priority_color=(value) ⇒ Object
-
#provided_mtime ⇒ Object
date-time - File last modified date/time, according to the client who set it.
- #provided_mtime=(value) ⇒ Object
- #read(*_args) ⇒ Object
-
#region ⇒ Object
string - Region location.
- #region=(value) ⇒ Object
-
#remote_server_id ⇒ Object
int64 - Used for internal bandwidth tracking.
- #remote_server_id=(value) ⇒ Object
- #rewind ⇒ Object
- #save ⇒ Object
- #seek(pos) ⇒ Object
-
#sha1 ⇒ Object
string - File SHA1 checksum.
- #sha1=(value) ⇒ Object
-
#sha256 ⇒ Object
string - File SHA256 checksum.
- #sha256=(value) ⇒ Object
-
#size ⇒ Object
int64 - File/Folder size.
- #size=(value) ⇒ Object
-
#socks_ips ⇒ Object
array(string) - Used for internal url management.
- #socks_ips=(value) ⇒ Object
- #stats ⇒ Object
- #subfolders_locked=(value) ⇒ Object
-
#subfolders_locked? ⇒ Boolean
boolean - Are subfolders locked and unable to be modified?.
- #tell ⇒ Object
- #to_path ⇒ Object
-
#type ⇒ Object
string - Type:
directoryorfile. - #type=(value) ⇒ Object
Constructor Details
#initialize(*args) ⇒ Folder
Returns a new instance of Folder.
103 104 105 106 107 |
# File 'lib/files.com/models/folder.rb', line 103 def initialize(*args) @attributes = (args[0].is_a?(Hash) && args[0]) || {} @options = (args[1].is_a?(Hash) && args[1]) || {} @attributes['path'] = args[0] if args[0].is_a?(String) end |
Instance Attribute Details
#attributes ⇒ Object (readonly)
Returns the value of attribute attributes.
5 6 7 |
# File 'lib/files.com/models/folder.rb', line 5 def attributes @attributes end |
#options ⇒ Object (readonly)
Returns the value of attribute options.
5 6 7 |
# File 'lib/files.com/models/folder.rb', line 5 def @options end |
#pos ⇒ Object
127 128 129 |
# File 'lib/files.com/models/folder.rb', line 127 def pos @pos ||= 0 end |
Class Method Details
.[](*_) ⇒ Object
7 8 9 |
# File 'lib/files.com/models/folder.rb', line 7 def self.[](*_) raise NotImplementedError end |
.chdir(path, &block) ⇒ Object
11 12 13 14 15 16 17 18 19 |
# File 'lib/files.com/models/folder.rb', line 11 def self.chdir(path, &block) raise Errno::ENOENT.new(path) if exist? path if block yield path else @@path ||= path end end |
.children(path, _encoding = "") ⇒ Object
21 22 23 |
# File 'lib/files.com/models/folder.rb', line 21 def self.children(path, _encoding = "") Folder.new(path).contents.map(&:path) end |
.chroot(*args) ⇒ Object
25 |
# File 'lib/files.com/models/folder.rb', line 25 def self.chroot(*args); end |
.create(path, params = {}, options = {}) ⇒ Object
Parameters:
path (required) - string - Path to operate on.
mkdir_parents - boolean - Create parent directories if they do not exist?
provided_mtime - string - User provided modification time.
bundle_registration_code - string
583 584 585 586 587 588 589 590 591 592 593 |
# File 'lib/files.com/models/folder.rb', line 583 def self.create(path, params = {}, = {}) params ||= {} params[:path] = path raise InvalidParameterError.new("Bad parameter: path must be an String") if params[:path] and !params[:path].is_a?(String) raise InvalidParameterError.new("Bad parameter: provided_mtime must be an String") if params[:provided_mtime] and !params[:provided_mtime].is_a?(String) raise InvalidParameterError.new("Bad parameter: bundle_registration_code must be an String") if params[:bundle_registration_code] and !params[:bundle_registration_code].is_a?(String) raise MissingParameterError.new("Parameter missing: path") unless params[:path] response, = Api.send_request("/folders/#{params[:path]}", :post, params, ) File.new(response.data, ) end |
.delete(path, params = {}, options = {}) ⇒ Object
27 28 29 |
# File 'lib/files.com/models/folder.rb', line 27 def self.delete(path, params = {}, = {}) File.delete(path, params, ) end |
.destroy(path, params = {}, options = {}) ⇒ Object
31 32 33 |
# File 'lib/files.com/models/folder.rb', line 31 def self.destroy(path, params = {}, = {}) File.destroy(path, params, ) end |
.each_child(path, _encoding = "", &block) ⇒ Object
35 36 37 |
# File 'lib/files.com/models/folder.rb', line 35 def self.each_child(path, _encoding = "", &block) Folder.new(path).each(&block) end |
.empty?(*_args) ⇒ Boolean
39 40 41 |
# File 'lib/files.com/models/folder.rb', line 39 def self.empty?(*_args) Folder.new(path).contents.empty? end |
.entries(path) ⇒ Object
43 44 45 |
# File 'lib/files.com/models/folder.rb', line 43 def self.entries(path) list(path) end |
.exist?(*args) ⇒ Boolean
47 48 49 |
# File 'lib/files.com/models/folder.rb', line 47 def self.exist?(*args) File.exist?(*args) end |
.find(path, params = {}, options = {}) ⇒ Object
51 52 53 |
# File 'lib/files.com/models/folder.rb', line 51 def self.find(path, params = {}, = {}) File.find(path, params, ) end |
.foreach(path, _encoding = "", params = {}, options = {}, &block) ⇒ Object
59 60 61 |
# File 'lib/files.com/models/folder.rb', line 59 def self.foreach(path, _encoding = "", params = {}, = {}, &block) list_for(path, params, ).each { |x| block.call(x) } end |
.get(path, params = {}, options = {}) ⇒ Object
55 56 57 |
# File 'lib/files.com/models/folder.rb', line 55 def self.get(path, params = {}, = {}) File.get(path, params, ) end |
.getwd(*_args) ⇒ Object
63 64 65 |
# File 'lib/files.com/models/folder.rb', line 63 def self.getwd(*_args) pwd end |
.glob(*_) ⇒ Object
67 68 69 |
# File 'lib/files.com/models/folder.rb', line 67 def self.glob(*_) raise NotImplementedError end |
.home(*_args) ⇒ Object
71 72 73 |
# File 'lib/files.com/models/folder.rb', line 71 def self.home(*_args) "" end |
.list_for(path, params = {}, options = {}) ⇒ Object
Parameters:
cursor - string - Send cursor to resume an existing list from the point at which you left off. Get a cursor from an existing list via the X-Files-Cursor-Next header or the X-Files-Cursor-Prev header.
per_page - int64 - Number of records to show per page. (Max: 10000, 1,000 or less is recommended).
path (required) - string - Path to operate on.
action - string - Action to take. Can be `count`, `size`, `permissions`, or blank.
bundle_registration_code - string
preview_size - string - Request a preview size. Can be `small` (default), `large`, `xlarge`, or `pdf`.
sort_by - object - Search by field and direction. Valid fields are `path`, `size`, `modified_at_datetime`, `provided_modified_at`. Valid directions are `asc` and `desc`. Defaults to `{"path":"asc"}`.
search - string - If specified, will search the folders/files list by name. Ignores text before last `/`. This is the same API used by the search bar in the web UI when running 'Search This Folder'. Search results are a best effort, not real time, and not guaranteed to perfectly match the latest folder listing. Results may be truncated if more than 1,000 possible matches exist. This field should only be used for ad-hoc (human) searching, and not as part of an automated process.
search_custom_metadata_key - string - If provided, the search string in `search` will search for files where this custom metadata key matches the value sent in `search`. Set this to `*` to allow any metadata key to match the value sent in `search`.
search_all - boolean - Search entire site? If true, we will search the entire site. Do not provide a path when using this parameter. This is the same API used by the search bar in the web UI when running 'Search All Files'. Search results are a best effort, not real time, and not guaranteed to match every file. This field should only be used for ad-hoc (human) searching, and not as part of an automated process.
with_previews - boolean - Include file previews?
with_priority_color - boolean - Include file priority color information?
type - string - Type of objects to return. Can be `folder` or `file`.
modified_at_datetime - string - If provided, will only return files/folders modified after this time. Can be used only in combination with `type` filter.
557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 |
# File 'lib/files.com/models/folder.rb', line 557 def self.list_for(path, params = {}, = {}) params ||= {} params[:path] = path raise InvalidParameterError.new("Bad parameter: cursor must be an String") if params[:cursor] and !params[:cursor].is_a?(String) raise InvalidParameterError.new("Bad parameter: per_page must be an Integer") if params[:per_page] and !params[:per_page].is_a?(Integer) raise InvalidParameterError.new("Bad parameter: path must be an String") if params[:path] and !params[:path].is_a?(String) raise InvalidParameterError.new("Bad parameter: action must be an String") if params[:action] and !params[:action].is_a?(String) raise InvalidParameterError.new("Bad parameter: bundle_registration_code must be an String") if params[:bundle_registration_code] and !params[:bundle_registration_code].is_a?(String) raise InvalidParameterError.new("Bad parameter: preview_size must be an String") if params[:preview_size] and !params[:preview_size].is_a?(String) raise InvalidParameterError.new("Bad parameter: sort_by must be an Hash") if params[:sort_by] and !params[:sort_by].is_a?(Hash) raise InvalidParameterError.new("Bad parameter: search must be an String") if params[:search] and !params[:search].is_a?(String) raise InvalidParameterError.new("Bad parameter: search_custom_metadata_key must be an String") if params[:search_custom_metadata_key] and !params[:search_custom_metadata_key].is_a?(String) raise InvalidParameterError.new("Bad parameter: type must be an String") if params[:type] and !params[:type].is_a?(String) raise InvalidParameterError.new("Bad parameter: modified_at_datetime must be an String") if params[:modified_at_datetime] and !params[:modified_at_datetime].is_a?(String) raise MissingParameterError.new("Parameter missing: path") unless params[:path] List.new(File, params) do Api.send_request("/folders/#{params[:path]}", :get, params, ) end end |
.mkdir(path, params = {}, options = {}) ⇒ Object
75 76 77 |
# File 'lib/files.com/models/folder.rb', line 75 def self.mkdir(path, params = {}, = {}) create(path, params, ) end |
.open(*args, &block) ⇒ Object
79 80 81 82 83 84 85 |
# File 'lib/files.com/models/folder.rb', line 79 def self.open(*args, &block) if block.nil? new *args else yield new *args end end |
.pwd(*_args) ⇒ Object
87 88 89 |
# File 'lib/files.com/models/folder.rb', line 87 def self.pwd(*_args) @@path ||= "" end |
.rmdir(path) ⇒ Object
91 92 93 |
# File 'lib/files.com/models/folder.rb', line 91 def self.rmdir(path) delete(path) end |
.unlink(path) ⇒ Object
95 96 97 |
# File 'lib/files.com/models/folder.rb', line 95 def self.unlink(path) delete(path) end |
Instance Method Details
#bundle_registration_code ⇒ Object
string
528 529 530 |
# File 'lib/files.com/models/folder.rb', line 528 def bundle_registration_code @attributes[:bundle_registration_code] end |
#bundle_registration_code=(value) ⇒ Object
532 533 534 |
# File 'lib/files.com/models/folder.rb', line 532 def bundle_registration_code=(value) @attributes[:bundle_registration_code] = value end |
#close(*args) ⇒ Object
109 |
# File 'lib/files.com/models/folder.rb', line 109 def close(*args); end |
#contents ⇒ Object
119 120 121 |
# File 'lib/files.com/models/folder.rb', line 119 def contents @contents ||= Folder.list(path, {}, @options) end |
#crc32 ⇒ Object
string - File CRC32 checksum. This is sometimes delayed, so if you get a blank response, wait and try again.
366 367 368 |
# File 'lib/files.com/models/folder.rb', line 366 def crc32 @attributes[:crc32] end |
#crc32=(value) ⇒ Object
370 371 372 |
# File 'lib/files.com/models/folder.rb', line 370 def crc32=(value) @attributes[:crc32] = value end |
#created_at ⇒ Object
date-time - File created date/time
289 290 291 |
# File 'lib/files.com/models/folder.rb', line 289 def created_at @attributes[:created_at] end |
#created_by_api_key_id ⇒ Object
int64 - ID of the API key that created the file/folder
190 191 192 |
# File 'lib/files.com/models/folder.rb', line 190 def created_by_api_key_id @attributes[:created_by_api_key_id] end |
#created_by_api_key_id=(value) ⇒ Object
194 195 196 |
# File 'lib/files.com/models/folder.rb', line 194 def created_by_api_key_id=(value) @attributes[:created_by_api_key_id] = value end |
#created_by_as2_incoming_message_id ⇒ Object
int64 - ID of the AS2 Incoming Message that created the file/folder
199 200 201 |
# File 'lib/files.com/models/folder.rb', line 199 def @attributes[:created_by_as2_incoming_message_id] end |
#created_by_as2_incoming_message_id=(value) ⇒ Object
203 204 205 |
# File 'lib/files.com/models/folder.rb', line 203 def (value) @attributes[:created_by_as2_incoming_message_id] = value end |
#created_by_automation_id ⇒ Object
int64 - ID of the Automation that created the file/folder
208 209 210 |
# File 'lib/files.com/models/folder.rb', line 208 def created_by_automation_id @attributes[:created_by_automation_id] end |
#created_by_automation_id=(value) ⇒ Object
212 213 214 |
# File 'lib/files.com/models/folder.rb', line 212 def created_by_automation_id=(value) @attributes[:created_by_automation_id] = value end |
#created_by_bundle_registration_id ⇒ Object
int64 - ID of the Bundle Registration that created the file/folder
217 218 219 |
# File 'lib/files.com/models/folder.rb', line 217 def created_by_bundle_registration_id @attributes[:created_by_bundle_registration_id] end |
#created_by_bundle_registration_id=(value) ⇒ Object
221 222 223 |
# File 'lib/files.com/models/folder.rb', line 221 def created_by_bundle_registration_id=(value) @attributes[:created_by_bundle_registration_id] = value end |
#created_by_id ⇒ Object
int64 - User ID of the User who created the file/folder
181 182 183 |
# File 'lib/files.com/models/folder.rb', line 181 def created_by_id @attributes[:created_by_id] end |
#created_by_id=(value) ⇒ Object
185 186 187 |
# File 'lib/files.com/models/folder.rb', line 185 def created_by_id=(value) @attributes[:created_by_id] = value end |
#created_by_inbox_id ⇒ Object
int64 - ID of the Inbox that created the file/folder
226 227 228 |
# File 'lib/files.com/models/folder.rb', line 226 def created_by_inbox_id @attributes[:created_by_inbox_id] end |
#created_by_inbox_id=(value) ⇒ Object
230 231 232 |
# File 'lib/files.com/models/folder.rb', line 230 def created_by_inbox_id=(value) @attributes[:created_by_inbox_id] = value end |
#created_by_remote_server_id ⇒ Object
int64 - ID of the Remote Server that created the file/folder
235 236 237 |
# File 'lib/files.com/models/folder.rb', line 235 def created_by_remote_server_id @attributes[:created_by_remote_server_id] end |
#created_by_remote_server_id=(value) ⇒ Object
239 240 241 |
# File 'lib/files.com/models/folder.rb', line 239 def created_by_remote_server_id=(value) @attributes[:created_by_remote_server_id] = value end |
#created_by_sync_id ⇒ Object
int64 - ID of the Sync that created the file/folder
244 245 246 |
# File 'lib/files.com/models/folder.rb', line 244 def created_by_sync_id @attributes[:created_by_sync_id] end |
#created_by_sync_id=(value) ⇒ Object
248 249 250 |
# File 'lib/files.com/models/folder.rb', line 248 def created_by_sync_id=(value) @attributes[:created_by_sync_id] = value end |
#custom_metadata ⇒ Object
object - Custom metadata map of keys and values. Limited to 32 keys, 256 characters per key and 1024 characters per value.
253 254 255 |
# File 'lib/files.com/models/folder.rb', line 253 def @attributes[:custom_metadata] end |
#custom_metadata=(value) ⇒ Object
257 258 259 |
# File 'lib/files.com/models/folder.rb', line 257 def (value) @attributes[:custom_metadata] = value end |
#display_name ⇒ Object
string - File/Folder display name
262 263 264 |
# File 'lib/files.com/models/folder.rb', line 262 def display_name @attributes[:display_name] end |
#display_name=(value) ⇒ Object
266 267 268 |
# File 'lib/files.com/models/folder.rb', line 266 def display_name=(value) @attributes[:display_name] = value end |
#download_uri ⇒ Object
string - Link to download file. Provided only in response to a download request.
483 484 485 |
# File 'lib/files.com/models/folder.rb', line 483 def download_uri @attributes[:download_uri] end |
#download_uri=(value) ⇒ Object
487 488 489 |
# File 'lib/files.com/models/folder.rb', line 487 def download_uri=(value) @attributes[:download_uri] = value end |
#each(&block) ⇒ Object
111 112 113 |
# File 'lib/files.com/models/folder.rb', line 111 def each(&block) contents.each { |x| block.call(x) } end |
#fileno ⇒ Object
115 116 117 |
# File 'lib/files.com/models/folder.rb', line 115 def fileno stats.id end |
#headers ⇒ Object
object - Used for internal url management
456 457 458 |
# File 'lib/files.com/models/folder.rb', line 456 def headers @attributes[:headers] end |
#headers=(value) ⇒ Object
460 461 462 |
# File 'lib/files.com/models/folder.rb', line 460 def headers=(value) @attributes[:headers] = value end |
#id ⇒ Object
int64 - File/Folder ID. Used only for ExaVault compatibility API. Do not use for other purposes, as this value will not always be set.
154 155 156 |
# File 'lib/files.com/models/folder.rb', line 154 def id @attributes[:id] end |
#id=(value) ⇒ Object
158 159 160 |
# File 'lib/files.com/models/folder.rb', line 158 def id=(value) @attributes[:id] = value end |
#internal_download_uri ⇒ Object
string - For use with internal services and should also be with headers and socks_ips
474 475 476 |
# File 'lib/files.com/models/folder.rb', line 474 def internal_download_uri @attributes[:internal_download_uri] end |
#internal_download_uri=(value) ⇒ Object
478 479 480 |
# File 'lib/files.com/models/folder.rb', line 478 def internal_download_uri=(value) @attributes[:internal_download_uri] = value end |
#is_locked ⇒ Object
boolean - Is this folder locked and unable to be modified?
438 439 440 |
# File 'lib/files.com/models/folder.rb', line 438 def is_locked @attributes[:is_locked] end |
#is_locked=(value) ⇒ Object
442 443 444 |
# File 'lib/files.com/models/folder.rb', line 442 def is_locked=(value) @attributes[:is_locked] = value end |
#last_modified_by_api_key_id ⇒ Object
int64 - ID of the API key that last modified the file/folder
303 304 305 |
# File 'lib/files.com/models/folder.rb', line 303 def last_modified_by_api_key_id @attributes[:last_modified_by_api_key_id] end |
#last_modified_by_api_key_id=(value) ⇒ Object
307 308 309 |
# File 'lib/files.com/models/folder.rb', line 307 def last_modified_by_api_key_id=(value) @attributes[:last_modified_by_api_key_id] = value end |
#last_modified_by_automation_id ⇒ Object
int64 - ID of the Automation that last modified the file/folder
312 313 314 |
# File 'lib/files.com/models/folder.rb', line 312 def last_modified_by_automation_id @attributes[:last_modified_by_automation_id] end |
#last_modified_by_automation_id=(value) ⇒ Object
316 317 318 |
# File 'lib/files.com/models/folder.rb', line 316 def last_modified_by_automation_id=(value) @attributes[:last_modified_by_automation_id] = value end |
#last_modified_by_bundle_registration_id ⇒ Object
int64 - ID of the Bundle Registration that last modified the file/folder
321 322 323 |
# File 'lib/files.com/models/folder.rb', line 321 def last_modified_by_bundle_registration_id @attributes[:last_modified_by_bundle_registration_id] end |
#last_modified_by_bundle_registration_id=(value) ⇒ Object
325 326 327 |
# File 'lib/files.com/models/folder.rb', line 325 def last_modified_by_bundle_registration_id=(value) @attributes[:last_modified_by_bundle_registration_id] = value end |
#last_modified_by_id ⇒ Object
int64 - User ID of the User who last modified the file/folder
294 295 296 |
# File 'lib/files.com/models/folder.rb', line 294 def last_modified_by_id @attributes[:last_modified_by_id] end |
#last_modified_by_id=(value) ⇒ Object
298 299 300 |
# File 'lib/files.com/models/folder.rb', line 298 def last_modified_by_id=(value) @attributes[:last_modified_by_id] = value end |
#last_modified_by_remote_server_id ⇒ Object
int64 - ID of the Remote Server that last modified the file/folder
330 331 332 |
# File 'lib/files.com/models/folder.rb', line 330 def last_modified_by_remote_server_id @attributes[:last_modified_by_remote_server_id] end |
#last_modified_by_remote_server_id=(value) ⇒ Object
334 335 336 |
# File 'lib/files.com/models/folder.rb', line 334 def last_modified_by_remote_server_id=(value) @attributes[:last_modified_by_remote_server_id] = value end |
#last_modified_by_sync_id ⇒ Object
int64 - ID of the Sync that last modified the file/folder
339 340 341 |
# File 'lib/files.com/models/folder.rb', line 339 def last_modified_by_sync_id @attributes[:last_modified_by_sync_id] end |
#last_modified_by_sync_id=(value) ⇒ Object
343 344 345 |
# File 'lib/files.com/models/folder.rb', line 343 def last_modified_by_sync_id=(value) @attributes[:last_modified_by_sync_id] = value end |
#md5 ⇒ Object
string - File MD5 checksum. This is sometimes delayed, so if you get a blank response, wait and try again.
375 376 377 |
# File 'lib/files.com/models/folder.rb', line 375 def md5 @attributes[:md5] end |
#md5=(value) ⇒ Object
379 380 381 |
# File 'lib/files.com/models/folder.rb', line 379 def md5=(value) @attributes[:md5] = value end |
#mime_type ⇒ Object
string - MIME Type. This is determined by the filename extension and is not stored separately internally.
402 403 404 |
# File 'lib/files.com/models/folder.rb', line 402 def mime_type @attributes[:mime_type] end |
#mime_type=(value) ⇒ Object
406 407 408 |
# File 'lib/files.com/models/folder.rb', line 406 def mime_type=(value) @attributes[:mime_type] = value end |
#mkdir_parents ⇒ Object
boolean - Create parent directories if they do not exist?
519 520 521 |
# File 'lib/files.com/models/folder.rb', line 519 def mkdir_parents @attributes[:mkdir_parents] end |
#mkdir_parents=(value) ⇒ Object
523 524 525 |
# File 'lib/files.com/models/folder.rb', line 523 def mkdir_parents=(value) @attributes[:mkdir_parents] = value end |
#mtime ⇒ Object
date-time - File last modified date/time, according to the server. This is the timestamp of the last Files.com operation of the file, regardless of what modified timestamp was sent.
348 349 350 |
# File 'lib/files.com/models/folder.rb', line 348 def mtime @attributes[:mtime] end |
#mtime=(value) ⇒ Object
352 353 354 |
# File 'lib/files.com/models/folder.rb', line 352 def mtime=(value) @attributes[:mtime] = value end |
#path ⇒ Object
string - File/Folder path. This must be slash-delimited, but it must neither start nor end with a slash. Maximum of 5000 characters.
163 164 165 |
# File 'lib/files.com/models/folder.rb', line 163 def path @attributes[:path] end |
#path=(value) ⇒ Object
167 168 169 |
# File 'lib/files.com/models/folder.rb', line 167 def path=(value) @attributes[:path] = value end |
#path_absolute ⇒ Object
string - File/Folder absolute path for Bundle Trusted Relay use
172 173 174 |
# File 'lib/files.com/models/folder.rb', line 172 def path_absolute @attributes[:path_absolute] end |
#path_absolute=(value) ⇒ Object
176 177 178 |
# File 'lib/files.com/models/folder.rb', line 176 def path_absolute=(value) @attributes[:path_absolute] = value end |
#permissions ⇒ Object
string - A short string representing the current user's permissions. Can be r (Read),w (Write),d (Delete), l (List) or any combination
420 421 422 |
# File 'lib/files.com/models/folder.rb', line 420 def @attributes[:permissions] end |
#permissions=(value) ⇒ Object
424 425 426 |
# File 'lib/files.com/models/folder.rb', line 424 def (value) @attributes[:permissions] = value end |
#preview ⇒ Object
Preview - File preview
510 511 512 |
# File 'lib/files.com/models/folder.rb', line 510 def preview @attributes[:preview] end |
#preview=(value) ⇒ Object
514 515 516 |
# File 'lib/files.com/models/folder.rb', line 514 def preview=(value) @attributes[:preview] = value end |
#preview_id ⇒ Object
int64 - File preview ID
501 502 503 |
# File 'lib/files.com/models/folder.rb', line 501 def preview_id @attributes[:preview_id] end |
#preview_id=(value) ⇒ Object
505 506 507 |
# File 'lib/files.com/models/folder.rb', line 505 def preview_id=(value) @attributes[:preview_id] = value end |
#priority_color ⇒ Object
string - Bookmark/priority color of file/folder
492 493 494 |
# File 'lib/files.com/models/folder.rb', line 492 def priority_color @attributes[:priority_color] end |
#priority_color=(value) ⇒ Object
496 497 498 |
# File 'lib/files.com/models/folder.rb', line 496 def priority_color=(value) @attributes[:priority_color] = value end |
#provided_mtime ⇒ Object
date-time - File last modified date/time, according to the client who set it. Files.com allows desktop, FTP, SFTP, and WebDAV clients to set modified at times. This allows Desktop<->Cloud syncing to preserve modified at times.
357 358 359 |
# File 'lib/files.com/models/folder.rb', line 357 def provided_mtime @attributes[:provided_mtime] end |
#provided_mtime=(value) ⇒ Object
361 362 363 |
# File 'lib/files.com/models/folder.rb', line 361 def provided_mtime=(value) @attributes[:provided_mtime] = value end |
#read(*_args) ⇒ Object
133 134 135 |
# File 'lib/files.com/models/folder.rb', line 133 def read(*_args) contents[@pos] end |
#region ⇒ Object
string - Region location
411 412 413 |
# File 'lib/files.com/models/folder.rb', line 411 def region @attributes[:region] end |
#region=(value) ⇒ Object
415 416 417 |
# File 'lib/files.com/models/folder.rb', line 415 def region=(value) @attributes[:region] = value end |
#remote_server_id ⇒ Object
int64 - Used for internal bandwidth tracking
447 448 449 |
# File 'lib/files.com/models/folder.rb', line 447 def remote_server_id @attributes[:remote_server_id] end |
#remote_server_id=(value) ⇒ Object
451 452 453 |
# File 'lib/files.com/models/folder.rb', line 451 def remote_server_id=(value) @attributes[:remote_server_id] = value end |
#rewind ⇒ Object
137 138 139 |
# File 'lib/files.com/models/folder.rb', line 137 def rewind @pos = 0 end |
#save ⇒ Object
536 537 538 539 540 |
# File 'lib/files.com/models/folder.rb', line 536 def save new_obj = Folder.create(path, @attributes, @options) @attributes = new_obj.attributes true end |
#seek(pos) ⇒ Object
141 142 143 |
# File 'lib/files.com/models/folder.rb', line 141 def seek(pos) @pos = pos end |
#sha1 ⇒ Object
string - File SHA1 checksum. This is sometimes delayed, so if you get a blank response, wait and try again.
384 385 386 |
# File 'lib/files.com/models/folder.rb', line 384 def sha1 @attributes[:sha1] end |
#sha1=(value) ⇒ Object
388 389 390 |
# File 'lib/files.com/models/folder.rb', line 388 def sha1=(value) @attributes[:sha1] = value end |
#sha256 ⇒ Object
string - File SHA256 checksum. This is sometimes delayed, so if you get a blank response, wait and try again.
393 394 395 |
# File 'lib/files.com/models/folder.rb', line 393 def sha256 @attributes[:sha256] end |
#sha256=(value) ⇒ Object
397 398 399 |
# File 'lib/files.com/models/folder.rb', line 397 def sha256=(value) @attributes[:sha256] = value end |
#size ⇒ Object
int64 - File/Folder size
280 281 282 |
# File 'lib/files.com/models/folder.rb', line 280 def size @attributes[:size] end |
#size=(value) ⇒ Object
284 285 286 |
# File 'lib/files.com/models/folder.rb', line 284 def size=(value) @attributes[:size] = value end |
#socks_ips ⇒ Object
array(string) - Used for internal url management
465 466 467 |
# File 'lib/files.com/models/folder.rb', line 465 def socks_ips @attributes[:socks_ips] end |
#socks_ips=(value) ⇒ Object
469 470 471 |
# File 'lib/files.com/models/folder.rb', line 469 def socks_ips=(value) @attributes[:socks_ips] = value end |
#stats ⇒ Object
123 124 125 |
# File 'lib/files.com/models/folder.rb', line 123 def stats @stats ||= File.download(@filename, { action: 'stat' }, @options) end |
#subfolders_locked=(value) ⇒ Object
433 434 435 |
# File 'lib/files.com/models/folder.rb', line 433 def subfolders_locked=(value) @attributes[:subfolders_locked?] = value end |
#subfolders_locked? ⇒ Boolean
boolean - Are subfolders locked and unable to be modified?
429 430 431 |
# File 'lib/files.com/models/folder.rb', line 429 def subfolders_locked? @attributes[:subfolders_locked?] end |
#tell ⇒ Object
145 146 147 |
# File 'lib/files.com/models/folder.rb', line 145 def tell @pos end |
#to_path ⇒ Object
149 150 151 |
# File 'lib/files.com/models/folder.rb', line 149 def to_path path end |
#type ⇒ Object
string - Type: directory or file.
271 272 273 |
# File 'lib/files.com/models/folder.rb', line 271 def type @attributes[:type] end |
#type=(value) ⇒ Object
275 276 277 |
# File 'lib/files.com/models/folder.rb', line 275 def type=(value) @attributes[:type] = value end |