31 MediaSetAccess::MediaSetAccess(
const Url &
url,
32 const Pathname & prefered_attach_point)
34 , _prefAttachPoint(prefered_attach_point)
39 const Pathname & prefered_attach_point)
41 , _prefAttachPoint(prefered_attach_point)
50 for (
const auto & mm :
_medias )
51 manager.
close( mm.second );
87 DBG <<
"Going to release file " << file
88 <<
" from media number " << media_nr << endl;
97 bool dots,
unsigned media_nr )
107 media_mgr.
dirInfo(media, retlist, dirname, dots);
164 provide( boost::ref(op), resource, options, deltafile );
173 provide( boost::ref(op), resource, options, Pathname() );
202 ProvideFileOptions options,
203 const Pathname &deltafile )
206 unsigned media_nr(resource.
medianr());
217 bool deltafileset =
false;
221 DBG <<
"Going to try to provide " << (resource.
optional() ?
"optional" :
"") <<
" file " << file
222 <<
" from media number " << media_nr << endl;
238 unsigned int devindex = 0;
239 vector<string> devices;
246 DBG <<
"Media couldn't provide file " << file <<
" , releasing." << endl;
254 MIL <<
"Failed to release media " << media << endl;
282 MIL <<
"Can't provide file. Non-Interactive mode." << endl;
290 user = report->requestMedia (
301 MIL <<
"ProvideFile exception caught, callback answer: " << user << endl;
305 DBG <<
"Aborting" << endl;
306 AbortRequestException aexcp(
"Aborting requested by user");
307 aexcp.remember(excp);
312 DBG <<
"Skipping" << endl;
313 SkipRequestException nexcp(
"User-requested skipping of a file");
314 nexcp.remember(excp);
319 DBG <<
"Eject: try to release" << endl;
323 media_mgr.
release (media, devindex < devices.size() ? devices[devindex] :
"");
334 DBG <<
"Going to try again" << endl;
336 media_mgr.
close(media);
345 DBG <<
"Don't know, let's ABORT" << endl;
358 ProvideFileOptions options )
365 provide( boost::ref(op), resource, options, Pathname());
369 provide( boost::ref(op), resource, options, Pathname());
401 WAR <<
"Verifier not found" << endl;
411 if (scheme ==
"cd" || scheme ==
"dvd")
414 DBG <<
"Rewriting url " << url_r << endl;
430 DBG <<
"Url rewrite result: " << url << endl;
444 DBG <<
"Url rewrite result: " << url << endl;
453 DBG <<
"Releasing all media IDs held by this MediaSetAccess" << endl;
455 for (MediaMap::const_iterator m =
_medias.begin(); m !=
_medias.end(); ++m)
456 manager.
release(m->second,
"");
void setQueryParam(const std::string ¶m, const std::string &value)
Set or add value for the specified query parameter.
#define ZYPP_THROW(EXCPT)
Drops a logline and throws the Exception.
Store and operate with byte count.
std::string getPathName(EEncoding eflag=zypp::url::E_DECODED) const
Returns the path name from the URL.
ProvideFileExistenceOperation()
void operator()(media::MediaAccessId media, const Pathname &file)
#define ZYPP_RETHROW(EXCPT)
Drops a logline and rethrows, updating the CodeLocation.
void setPathName(const std::string &path, EEncoding eflag=zypp::url::E_DECODED)
Set the path name.
Do not differentiate case.
std::list< DirEntry > DirContent
Returned by readdir.
void operator()(media::MediaAccessId media, const Pathname &file)
std::string getQueryParam(const std::string ¶m, EEncoding eflag=zypp::url::E_DECODED) const
Return the value for the specified query parameter.
std::string numstring(char n, int w=0)
ByteCount expectedFileSize
#define ZYPP_CAUGHT(EXCPT)
Drops a logline telling the Exception was caught (in order to handle it).
Regular expression match result.
Base class for Exception.
void operator()(media::MediaAccessId media, const Pathname &file)
Wrapper for const correct access via Smart pointer types.
std::string asUserHistory() const
A single (multiline) string composed of asUserString and historyAsString.
bool regex_match(const std::string &s, smatch &matches, const regex ®ex)
regex ZYPP_STR_REGEX regex ZYPP_STR_REGEX
void operator()(media::MediaAccessId media, const Pathname &file)
std::string getScheme() const
Returns the scheme name of the URL.
#define IMPL_PTR_TYPE(NAME)