-
Notifications
You must be signed in to change notification settings - Fork 0
/
cachedata.py
286 lines (221 loc) · 6.98 KB
/
cachedata.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
class Cache:
def __init__(self):
# Name of the file
self.__filename = ""
# Cache entry location
self.__entry_location = ""
self.__rankings_location = ""
# URL data
self.__url = ""
self.__url_length = ""
self.__url_location = ""
self.__range_url = ""
self.__range_url_length = ""
self.__range_url_location = ""
# Content data
self.__content_size = ""
self.__content_location = ""
# Server HTTP response data
self.__response_size = ""
self.__response_location = ""
# Time related data
self.__last_accessed_time = ""
self.__entry_created_time = ""
self.__partial_entry_created_time = ""
self.__last_modified_time = ""
self.__expiry_time = ""
self.__response_time = ""
# Other data retrieved from server HTTP response
self.__server_response = ""
self.__content_encoding = ""
self.__etag = ""
self.__max_age = ""
self.__content_type = ""
self.__server_name = ""
self.__server_ip = ""
# Hash values
self.__md5 = ""
self.__sha1 = ""
self.__sha256 = ""
# File name getter & setter
@property
def filename(self):
return self.__filename
@filename.setter
def filename(self, filename):
self.__filename = filename
# Cache entry location getter & setter
@property
def entry_location(self):
return self.__entry_location
@entry_location.setter
def entry_location(self, entry_location):
self.__entry_location = entry_location
@property
def rankings_location(self):
return self.__rankings_location
@rankings_location.setter
def rankings_location(self, rankings_location):
self.__rankings_location = rankings_location
# URL data getters & setters
@property
def url(self):
return self.__url
@url.setter
def url(self, url):
self.__url = url
@property
def url_length(self):
return self.__url_length
@url_length.setter
def url_length(self, url_length):
self.__url_length = url_length
@property
def url_location(self):
return self.__url_location
@url_location.setter
def url_location(self, url_location):
self.__url_location = url_location
@property
def range_url(self):
return self.__range_url
@range_url.setter
def range_url(self, range_url):
self.__range_url = range_url
@property
def range_url_length(self):
return self.__range_url_length
@range_url_length.setter
def range_url_length(self, range_url_length):
self.__range_url_length = range_url_length
@property
def range_url_location(self):
return self.__range_url_location
@range_url_location.setter
def range_url_location(self, range_url_location):
self.__range_url_location = range_url_location
# Content data getters and setters
@property
def content_size(self):
return self.__content_size
@content_size.setter
def content_size(self, content_size):
self.__content_size = content_size
@property
def content_location(self):
return self.__content_location
@content_location.setter
def content_location(self, content_location):
self.__content_location = content_location
# Server HTTP response data getters and setters
@property
def response_size(self):
return self.__response_size
@response_size.setter
def response_size(self, response_size):
self.__response_size = response_size
@property
def response_location(self):
return self.__response_location
@response_location.setter
def response_location(self, response_location):
self.__response_location = response_location
# Time related data getters and setters
@property
def last_accessed_time(self):
return self.__last_accessed_time
@last_accessed_time.setter
def last_accessed_time(self, last_accessed_time):
self.__last_accessed_time = last_accessed_time
@property
def entry_created_time(self):
return self.__entry_created_time
@entry_created_time.setter
def entry_created_time(self, entry_created_time):
self.__entry_created_time = entry_created_time
@property
def partial_entry_created_time(self):
return self.__partial_entry_created_time
@partial_entry_created_time.setter
def partial_entry_created_time(self, partial_entry_created_time):
self.__partial_entry_created_time = partial_entry_created_time
@property
def last_modified_time(self):
return self.__last_modified_time
@last_modified_time.setter
def last_modified_time(self, last_modified_time):
self.__last_modified_time = last_modified_time
@property
def expiry_time(self):
return self.__expiry_time
@expiry_time.setter
def expiry_time(self, expiry_time):
self.__expiry_time = expiry_time
@property
def response_time(self):
return self.__response_time
@response_time.setter
def response_time(self, response_time):
self.__response_time = response_time
# Getters and setters for other data retrieved from server HTTP response
@property
def server_response(self):
return self.__server_response
@server_response.setter
def server_response(self, server_response):
self.__server_response = server_response
@property
def content_encoding(self):
return self.__content_encoding
@content_encoding.setter
def content_encoding(self, content_encoding):
self.__content_encoding = content_encoding
@property
def etag(self):
return self.__etag
@etag.setter
def etag(self, etag):
self.__etag = etag
@property
def max_age(self):
return self.__max_age
@max_age.setter
def max_age(self, max_age):
self.__max_age = max_age
@property
def content_type(self):
return self.__content_type
@content_type.setter
def content_type(self, content_type):
self.__content_type = content_type
@property
def server_name(self):
return self.__server_name
@server_name.setter
def server_name(self, server_name):
self.__server_name = server_name
@property
def server_ip(self):
return self.__server_ip
@server_ip.setter
def server_ip(self, server_ip):
self.__server_ip = server_ip
# Hash values getters and setters
@property
def md5(self):
return self.__md5
@md5.setter
def md5(self, md5):
self.__md5 = md5
@property
def sha1(self):
return self.__sha1
@sha1.setter
def sha1(self, sha1):
self.__sha1 = sha1
@property
def sha256(self):
return self.__sha256
@sha256.setter
def sha256(self, sha256):
self.__sha256 = sha256