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() );
188 ProvideFileOptions options,
189 const Pathname &deltafile )
192 unsigned media_nr(resource.
medianr());
203 bool deltafileset =
false;
207 DBG <<
"Going to try to provide " << (resource.
optional() ?
"optional" :
"") <<
" file " << file
208 <<
" from media number " << media_nr << endl;
224 unsigned int devindex = 0;
225 vector<string> devices;
232 DBG <<
"Media couldn't provide file " << file <<
" , releasing." << endl;
240 MIL <<
"Failed to release media " << media << endl;
268 MIL <<
"Can't provide file. Non-Interactive mode." << endl;
276 user = report->requestMedia (
287 MIL <<
"ProvideFile exception caught, callback answer: " << user << endl;
291 DBG <<
"Aborting" << endl;
292 AbortRequestException aexcp(
"Aborting requested by user");
293 aexcp.remember(excp);
298 DBG <<
"Skipping" << endl;
299 SkipRequestException nexcp(
"User-requested skipping of a file");
300 nexcp.remember(excp);
305 DBG <<
"Eject: try to release" << endl;
309 media_mgr.
release (media, devindex < devices.size() ? devices[devindex] :
"");
320 DBG <<
"Going to try again" << endl;
322 media_mgr.
close(media);
331 DBG <<
"Don't know, let's ABORT" << endl;
344 ProvideFileOptions options )
351 provide( boost::ref(op), resource, options, Pathname());
355 provide( boost::ref(op), resource, options, Pathname());
391 WAR <<
"Verifier not found" << endl;
401 if (scheme ==
"cd" || scheme ==
"dvd")
404 DBG <<
"Rewriting url " << url_r << endl;
420 DBG <<
"Url rewrite result: " << url << endl;
434 DBG <<
"Url rewrite result: " << url << endl;
443 DBG <<
"Releasing all media IDs held by this MediaSetAccess" << endl;
445 for (MediaMap::const_iterator m =
_medias.begin(); m !=
_medias.end(); ++m)
446 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.
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)