Class: Fog::Storage::InternetArchive::Directory
Instance Method Summary
collapse
ia_metadata_attribute
#set_metadata_array_headers
Instance Method Details
#acl ⇒ Object
acl for internet archive is always public-read
24
25
26
|
# File 'lib/fog/internet_archive/models/storage/directory.rb', line 24
def acl
'public-read'
end
|
#acl=(new_acl) ⇒ Object
28
29
30
|
# File 'lib/fog/internet_archive/models/storage/directory.rb', line 28
def acl=(new_acl)
'public-read'
end
|
#destroy ⇒ Object
33
34
35
36
|
# File 'lib/fog/internet_archive/models/storage/directory.rb', line 33
def destroy
Fog::Logger.warning("fog: Internet Archive does not support deleting a Bucket (i.e. Item). For details see: See http://archive.org/help/abouts3.txt")
false
end
|
#files ⇒ Object
51
52
53
|
# File 'lib/fog/internet_archive/models/storage/directory.rb', line 51
def files
@files ||= Fog::Storage::InternetArchive::Files.new(:directory => self, :service => service)
end
|
#location ⇒ Object
38
39
40
41
|
# File 'lib/fog/internet_archive/models/storage/directory.rb', line 38
def location
requires :key
attributes[:location] || bucket_location || self.service.region
end
|
#location=(new_location) ⇒ Object
43
44
45
46
47
48
49
|
# File 'lib/fog/internet_archive/models/storage/directory.rb', line 43
def location=(new_location)
if INVALID_LOCATIONS.include?(new_location)
raise ArgumentError, "location must not include any of #{INVALID_LOCATIONS.join(', ')}. See http://docs.amazonwebservices.com/AmazonS3/latest/API/RESTBucketPUT.html"
else
merge_attributes(:location => new_location)
end
end
|
#payer ⇒ Object
55
56
57
58
59
|
# File 'lib/fog/internet_archive/models/storage/directory.rb', line 55
def payer
requires :key
data = service.get_request_payment(key)
data.body['Payer']
end
|
#payer=(new_payer) ⇒ Object
61
62
63
64
65
|
# File 'lib/fog/internet_archive/models/storage/directory.rb', line 61
def payer=(new_payer)
requires :key
service.put_request_payment(key, new_payer)
@payer = new_payer
end
|
#public=(new_public) ⇒ Object
67
68
69
|
# File 'lib/fog/internet_archive/models/storage/directory.rb', line 67
def public=(new_public)
'public-read'
end
|
#public_url ⇒ Object
71
72
73
74
|
# File 'lib/fog/internet_archive/models/storage/directory.rb', line 71
def public_url
requires :key
"http://#{Fog::InternetArchive::DOMAIN_NAME}/details/#{key}"
end
|
#save ⇒ Object
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
|
# File 'lib/fog/internet_archive/models/storage/directory.rb', line 76
def save
requires :key
options = {}
options['x-archive-ignore-preexisting-bucket'] = ignore_preexisting_bucket if ignore_preexisting_bucket
options['x-archive-interactive-priority'] = interactive_priority if interactive_priority
(:collections, options)
(:subjects, options)
if location = attributes[:location] || (self.service.region != 'us-east-1' && self.service.region)
options['LocationConstraint'] = location
end
service.put_bucket(key, options)
true
end
|