Class: SBucketsDir
Instance Method Summary
collapse
Methods inherited from SBaseDir
#content_deleted, #contents, #get, #is_directory?, #is_file?, #size, #touch
Constructor Details
Returns a new instance of SBucketsDir.
212
213
214
|
# File 'lib/s3fsr.rb', line 212
def initialize
@data = nil
end
|
Instance Method Details
#can_write_files? ⇒ Boolean
215
216
217
|
# File 'lib/s3fsr.rb', line 215
def can_write_files?
false
end
|
#create_dir(child_key) ⇒ Object
221
222
223
224
225
|
# File 'lib/s3fsr.rb', line 221
def create_dir child_key
AWS::S3::Bucket.create(child_key)
d = SBucketDir.new(self, child_key)
get_contents[d.name] = d
end
|
#create_file(child_key, content) ⇒ Object
218
219
220
|
# File 'lib/s3fsr.rb', line 218
def create_file child_key, content
raise 'cannot create files outside of a bucket'
end
|
#delete ⇒ Object
226
227
228
|
# File 'lib/s3fsr.rb', line 226
def delete
raise 'cannot delete the buckets dir'
end
|
#name ⇒ Object
229
230
231
|
# File 'lib/s3fsr.rb', line 229
def name
return 'buckets'
end
|
#path_to_key(child_key) ⇒ Object
232
233
234
235
236
|
# File 'lib/s3fsr.rb', line 232
def path_to_key child_key
i = child_key.index('/')
i != nil ? child_key[i+1..-1] : child_key
end
|