xref: /haiku/src/apps/haikudepot/server/ServerPkgDataUpdateProcess.h (revision c237c4ce593ee823d9867fd997e51e4c447f5623)
1 /*
2  * Copyright 2017-2018, Andrew Lindesay <apl@lindesay.co.nz>.
3  * All rights reserved. Distributed under the terms of the MIT License.
4  */
5 #ifndef PACKAGE_DATA_UPDATE_PROCESS_H
6 #define PACKAGE_DATA_UPDATE_PROCESS_H
7 
8 
9 #include "AbstractSingleFileServerProcess.h"
10 
11 #include <File.h>
12 #include <Path.h>
13 #include <String.h>
14 #include <Url.h>
15 
16 #include "Model.h"
17 #include "PackageInfo.h"
18 
19 
20 class ServerPkgDataUpdateProcess : public AbstractSingleFileServerProcess {
21 public:
22 								ServerPkgDataUpdateProcess(
23 									BString depotName,
24 									Model *model,
25 									uint32 serverProcessOptions);
26 	virtual						~ServerPkgDataUpdateProcess();
27 
28 			const char*			Name() const;
29 			const char*			Description() const;
30 
31 protected:
32 	virtual status_t			RunInternal();
33 
34 			status_t			GetStandardMetaDataPath(BPath& path) const;
35 			void				GetStandardMetaDataJsonPath(
36 									BString& jsonPath) const;
37 
38 			BString				UrlPathComponent();
39 			status_t			ProcessLocalData();
40 			status_t			GetLocalPath(BPath& path) const;
41 
42 private:
43 			BString				_DeriveWebAppRepositorySourceCode() const;
44 
45 			Model*				fModel;
46 			BString				fDepotName;
47 			BString				fName;
48 			BString				fDescription;
49 
50 };
51 
52 #endif // PACKAGE_DATA_UPDATE_PROCESS_H
53