1 |
|
|
/** |
2 |
|
|
* This file is part of the CernVM File System |
3 |
|
|
*/ |
4 |
|
|
|
5 |
|
|
#ifndef CVMFS_SYNC_ITEM_TAR_H_ |
6 |
|
|
#define CVMFS_SYNC_ITEM_TAR_H_ |
7 |
|
|
|
8 |
|
|
#include "sync_item.h" |
9 |
|
|
|
10 |
|
|
#include <string> |
11 |
|
|
|
12 |
|
|
#include "directory_entry.h" |
13 |
|
|
#include "duplex_libarchive.h" |
14 |
|
|
#include "ingestion/ingestion_source.h" |
15 |
|
|
#include "platform.h" |
16 |
|
|
#include "sync_union_tarball.h" |
17 |
|
|
#include "util_concurrency.h" |
18 |
|
|
|
19 |
|
|
namespace publish { |
20 |
|
|
|
21 |
|
|
class SyncItemTar : public SyncItem { |
22 |
|
|
friend class SyncUnionTarball; |
23 |
|
|
|
24 |
|
|
public: |
25 |
|
|
virtual catalog::DirectoryEntryBase CreateBasicCatalogDirent() const; |
26 |
|
|
virtual IngestionSource *CreateIngestionSource() const; |
27 |
|
|
virtual void MakePlaceholderDirectory() const { rdonly_type_ = kItemDir; } |
28 |
|
|
virtual SyncItemType GetScratchFiletype() const; |
29 |
|
|
virtual bool IsType(const SyncItemType expected_type) const; |
30 |
|
|
virtual void StatScratch(const bool refresh = false) const; |
31 |
|
|
|
32 |
|
|
protected: |
33 |
|
|
SyncItemTar(const std::string &relative_parent_path, |
34 |
|
|
const std::string &filename, struct archive *archive, |
35 |
|
|
struct archive_entry *entry, Signal *read_archive_signal, |
36 |
|
|
const SyncUnion *union_engine); |
37 |
|
|
|
38 |
|
|
private: |
39 |
|
|
struct archive *archive_; |
40 |
|
|
struct archive_entry *archive_entry_; |
41 |
|
|
platform_stat64 GetStatFromTar() const; |
42 |
|
|
mutable platform_stat64 tar_stat_; |
43 |
|
|
mutable bool obtained_tar_stat_; |
44 |
|
|
Signal *read_archive_signal_; |
45 |
|
|
}; |
46 |
|
|
|
47 |
|
|
} // namespace publish |
48 |
|
|
|
49 |
|
|
#endif // CVMFS_SYNC_ITEM_TAR_H_ |