void Source_Ref::release()
{ _pimpl->release(); }
+
+ void Source_Ref::reattach(const Pathname &attach_point,
+ bool temporary)
+ { _pimpl->reattach(attach_point, temporary)
media::MediaVerifierRef Source_Ref::verifier(unsigned media_nr)
{ return _pimpl->verifier(media_nr); }
void release();
/**
+ * Reattach the source if it is not mounted, but downloaded,
+ * to different directory
+ *
+ * \throws Exception
+ */
+ void reattach(const Pathname &attach_point,
+ bool temporary = false);
+
+ /**
* Provide a media verifier suitable for the given media number
*/
media::MediaVerifierRef verifier(unsigned media_nr);
}
}
+ void SourceManager::reattachSources(const Pathname &attach_point,
+ bool temporary)
+ {
+ for (SourceMap::iterator it = _sources.begin();
+ it != _sources.end(); it++)
+ {
+ it->second->reattach(attach_point, temporary);
+ }
+ }
+
+
void SourceManager::removeSource(const std::string & alias_r)
{
for (SourceMap::iterator it = _sources.begin(); it != _sources.end(); ++it)
void releaseAllSources();
/**
+ * Reattach all sources which are not mounted, but downloaded,
+ * to different directory
+ *
+ * \throws Exception
+ */
+ void reattachSources(const Pathname &attach_point,
+ bool temporary = false);
+
+ /**
* Disable all registered sources
*/
#warning: this could be done by providing iterator-like methods
medias[medianr] = media_id;
}
+ void MediaSet::reattach(const Pathname &attach_point,
+ bool temporary)
+ {
+ media::MediaManager media_mgr;
+ for (MediaMap::iterator it = medias.begin(); it != medias.end(); it++)
+ {
+ Url url = media_mgr.url(it->second);
+ std::string scheme = url.getScheme();
+ if (scheme == "http" || scheme == "ftp" || scheme == "https" || scheme == "ftps")
+ {
+ media_mgr.reattach(it->second, attach_point, temporary);
+ }
+ }
+ }
+
void MediaSet::reset()
{
medias = MediaMap();
media::MediaAccessId getMediaAccessId (media::MediaNr medianr, bool no_attach = false);
/** Redirect specified media to a new MediaId */
void redirect (media::MediaNr medianr, media::MediaAccessId media_id);
+ /**
+ * Reattach the source if it is not mounted, but downloaded,
+ * to different directory
+ *
+ * \throws Exception
+ */
+ void reattach(const Pathname &attach_point,
+ bool temporary = false);
/** Reset the handles to the medias */
void reset();
/**
media::MediaAccessId id = media_mgr.open(new_url);
_media_set->redirect(media_nr, id);
}
+ void SourceImpl::reattach(const Pathname &attach_point,
+ bool temporary)
+ {
+ _media_set->reattach(attach_point, temporary);
+ }
void SourceImpl::release()
{
virtual void redirect(unsigned media_nr, const Url & new_url);
/**
+ * Reattach the source if it is not mounted, but downloaded,
+ * to different directory
+ *
+ * \throws Exception
+ */
+ void reattach(const Pathname &attach_point,
+ bool temporary = false);
+ /**
* Release all medias attached by the source
*/
void release();