23 namespace swissknife {
28 const string local_path =
CreateTempPath(tmp_dir_ +
"/catalog", 0600);
29 assert(!local_path.empty());
31 if (!FetchObject(catalog_hash, local_path)) {
35 const std::string catalog_root_path =
"";
40 catalog_root_path, local_path, catalog_hash);
44 catalog_root_path, local_path, catalog_hash);
59 const string local_path =
CreateTempPath(tmp_dir_ +
"/history", 0600);
60 assert(!local_path.empty());
62 if (history_hash.
IsNull()) {
65 if (NULL == history) {
72 if (!FetchObject(history_hash, local_path))
86 if (history == NULL) {
89 unlink(local_path.c_str());
98 bool Assistant::FetchObject(
const shash::Any &
id,
const string &local_path) {
102 const std::string url = repository_url_ +
"/data/" +
id.MakePath();
110 id.ToStringWithSuffix().c_str(), dl_retval,
download::DownloadManager * download_mgr_
static SqliteHistory * Open(const std::string &file_name)
const history::History * history() const
std::string CreateTempPath(const std::string &path_prefix, const int mode)
assert((mem||(size==0))&&"Out Of Memory")
const std::string & fqrn() const
static SqliteHistory * OpenWritable(const std::string &file_name)
static WritableCatalog * AttachFreely(const std::string &root_path, const std::string &file, const shash::Any &catalog_hash, Catalog *parent=NULL, const bool is_not_root=false)
const char * Code2Ascii(const Failures error)
std::string repository_name() const
const char kSuffixCatalog
void TakeDatabaseFileOwnership()
manifest::Manifest * manifest_
Failures Fetch(JobInfo *info)
shash::Any history() const
virtual void TakeDatabaseFileOwnership()=0
static Catalog * AttachFreely(const std::string &imaginary_mountpoint, const std::string &file, const shash::Any &catalog_hash, Catalog *parent=NULL, const bool is_nested=false)
static SqliteHistory * Create(const std::string &file_name, const std::string &fqrn)
CVMFS_EXPORT void LogCvmfs(const LogSource source, const int mask, const char *format,...)