xref: /haiku/src/apps/haikudepot/server/ServerIconExportUpdateProcess.h (revision 6aff37d1c79e20748c683ae224bd629f88a5b0be)
1 /*
2  * Copyright 2017, Andrew Lindesay <apl@lindesay.co.nz>.
3  * All rights reserved. Distributed under the terms of the MIT License.
4  */
5 
6 #ifndef SERVER_ICON_PROCESS_H
7 #define SERVER_ICON_PROCESS_H
8 
9 
10 #include "AbstractServerProcess.h"
11 
12 #include <File.h>
13 #include <Path.h>
14 #include <String.h>
15 #include <Url.h>
16 
17 #include "StandardMetaData.h"
18 
19 
20 class ServerIconExportUpdateProcess : public AbstractServerProcess {
21 public:
22 
23 								ServerIconExportUpdateProcess(
24 									const BPath& localStorageDirectoryPath);
25 
26 			status_t			Run();
27 
28 private:
29 			status_t			_Download(BPath& tarGzFilePath);
30 			status_t			_Download(BPath& tarGzFilePath, const BUrl& url,
31 									uint32 redirects, uint32 failures);
32 			BString				_FormFullUrl(const BString& suffix) const;
33 			status_t			_IfModifiedSinceHeaderValue(
34 									BString& headerValue) const;
35 			status_t			_IfModifiedSinceHeaderValue(
36 									BString& headerValue,
37 									BPath& iconMetaDataPath) const;
38 
39 			status_t			_PopulateIconMetaData(
40 									StandardMetaData& iconMetaData, BPath& path)
41 									const;
42 
43 			BString				fBaseUrl;
44 			BPath				fLocalStorageDirectoryPath;
45 
46 };
47 
48 #endif // SERVER_ICON_PROCESS_H
49