Class: SBaseDir
- Inherits:
-
Object
show all
- Defined in:
- lib/s3fsr.rb
Instance Method Summary
collapse
Instance Method Details
#can_write_files? ⇒ Boolean
62
63
64
|
# File 'lib/s3fsr.rb', line 62
def can_write_files?
true
end
|
#content_deleted(name) ⇒ Object
65
66
67
|
# File 'lib/s3fsr.rb', line 65
def content_deleted name
get_contents.delete name
end
|
#contents ⇒ Object
86
87
88
|
# File 'lib/s3fsr.rb', line 86
def contents
get_contents.keys
end
|
#create_dir(child_key) ⇒ Object
73
74
75
76
77
78
79
80
81
|
# File 'lib/s3fsr.rb', line 73
def create_dir child_key
if child_key.end_with? "flush" then
@data = nil
return
end
AWS::S3::S3Object.store(child_key + '/', '', bucket)
d = SPrefixDir.new(self, child_key + '/')
get_contents[d.name] = d
end
|
#create_file(child_key, content) ⇒ Object
68
69
70
71
72
|
# File 'lib/s3fsr.rb', line 68
def create_file child_key, content
AWS::S3::S3Object.store(child_key, content, bucket)
f = SFile.new(self, AWS::S3::S3Object.find(child_key, bucket))
get_contents[f.name] = f
end
|
#delete ⇒ Object
82
83
84
85
|
# File 'lib/s3fsr.rb', line 82
def delete
AWS::S3::S3Object.delete @key, bucket
@parent.content_deleted name
end
|
#get(name) ⇒ Object
89
90
91
|
# File 'lib/s3fsr.rb', line 89
def get(name)
get_contents[name]
end
|
#is_directory? ⇒ Boolean
56
57
58
|
# File 'lib/s3fsr.rb', line 56
def is_directory?
true
end
|
#is_file? ⇒ Boolean
59
60
61
|
# File 'lib/s3fsr.rb', line 59
def is_file?
false
end
|
#size ⇒ Object
92
93
94
|
# File 'lib/s3fsr.rb', line 92
def size
0
end
|
#touch ⇒ Object
95
96
97
|
# File 'lib/s3fsr.rb', line 95
def touch
@data = nil
end
|