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)
85 DBG <<
"Going to release file " << file
86 <<
" from media number " << media_nr << endl;
95 bool dots,
unsigned media_nr )
105 media_mgr.
dirInfo(media, retlist, dirname, dots);
160 provide( boost::ref(op), resource, options, deltafile );
169 provide( boost::ref(op), resource, options, Pathname() );
184 ProvideFileOptions options,
185 const Pathname &deltafile )
188 unsigned media_nr(resource.
medianr());
199 bool deltafileset =
false;
203 DBG <<
"Going to try to provide " << (resource.
optional() ?
"optional" :
"") <<
" file " << file
204 <<
" from media number " << media_nr << endl;
220 unsigned int devindex = 0;
221 vector<string> devices;
228 DBG <<
"Media couldn't provide file " << file <<
" , releasing." << endl;
236 MIL <<
"Failed to release media " << media << endl;
264 MIL <<
"Can't provide file. Non-Interactive mode." << endl;
272 user = report->requestMedia (
283 MIL <<
"ProvideFile exception caught, callback answer: " << user << endl;
287 DBG <<
"Aborting" << endl;
288 AbortRequestException aexcp(
"Aborting requested by user");
289 aexcp.remember(excp);
294 DBG <<
"Skipping" << endl;
295 SkipRequestException nexcp(
"User-requested skipping of a file");
296 nexcp.remember(excp);
301 DBG <<
"Eject: try to release" << endl;
305 devindex < devices.size() ? devices[devindex] :
"");
311 DBG <<
"Going to try again" << endl;
313 media_mgr.
close(media);
322 DBG <<
"Don't know, let's ABORT" << endl;
335 ProvideFileOptions options )
342 provide( boost::ref(op), resource, options, Pathname());
346 provide( boost::ref(op), resource, options, Pathname());
382 WAR <<
"Verifier not found" << endl;
392 if (scheme ==
"cd" || scheme ==
"dvd")
395 DBG <<
"Rewriting url " << url_r << endl;
411 DBG <<
"Url rewrite result: " << url << endl;
425 DBG <<
"Url rewrite result: " << url << endl;
434 DBG <<
"Releasing all media IDs held by this MediaSetAccess" << endl;
436 for (MediaMap::const_iterator m =
_medias.begin(); m !=
_medias.end(); ++m)
437 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.
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)
#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.
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.
std::string asUserString() const
Translated error message as string suitable for the user.
#define IMPL_PTR_TYPE(NAME)