#include <MediaHandler.h>
Inheritance diagram for zypp::media::MediaHandler:

Public Types | |
| typedef shared_ptr< MediaHandler > | Ptr |
| typedef shared_ptr< const MediaHandler > | constPtr |
Public Member Functions | |
| MediaHandler (const Url &url_r, const Pathname &attach_point_r, const Pathname &urlpath_below_attachpoint_r, const bool does_download_r) | |
| If the concrete media handler provides a nonempty attach_point, it must be an existing directory. | |
| virtual | ~MediaHandler () |
| Contolling MediaAccess takes care, that attached media is released prior to deleting this. | |
| bool | downloads () const |
| Hint if files are downloaded or not. | |
| std::string | protocol () const |
| Protocol hint for MediaAccess. | |
| Url | url () const |
| Url used. | |
| void | attach (bool next) |
| Use concrete handler to attach the media. | |
| virtual bool | isAttached () const |
| True if media is attached. | |
| Pathname | localRoot () const |
| Return the local directory that corresponds to medias url, no matter if media isAttached or not. | |
| Pathname | localPath (const Pathname &pathname) const |
| Files provided will be available at 'localPath(filename)'. | |
| void | disconnect () |
| Use concrete handler to isconnect media. | |
| void | release (bool eject=false) |
| Use concrete handler to release the media. | |
| void | provideFile (Pathname filename) const |
| Use concrete handler to provide file denoted by path below 'localRoot'. | |
| void | provideFileCopy (Pathname srcFilename, Pathname targetFilename) const |
| Call concrete handler to provide a copy of a file under a different place in the file system (usually not under attach point) as a copy. | |
| void | provideDir (Pathname dirname) const |
| Use concrete handler to provide directory denoted by path below 'localRoot' (not recursive!). | |
| void | provideDirTree (Pathname dirname) const |
| Use concrete handler to provide directory tree denoted by path below 'localRoot' (recursive!!). | |
| void | releaseFile (const Pathname &filename) const |
| Remove filename below localRoot IFF handler downloads files to the local filesystem. | |
| void | releaseDir (const Pathname &dirname) const |
| Remove directory tree below localRoot IFF handler downloads files to the local filesystem. | |
| void | releasePath (Pathname pathname) const |
| Remove pathname below localRoot IFF handler downloads files to the local filesystem. | |
| void | dirInfo (std::list< std::string > &retlist, const Pathname &dirname, bool dots=true) const |
| Return content of directory on media via retlist. | |
| void | dirInfo (filesystem::DirContent &retlist, const Pathname &dirname, bool dots=true) const |
| Basically the same as dirInfo above. | |
| bool | doesFileExist (const Pathname &filename) const |
| check if a file exists | |
Static Public Member Functions | |
| static bool | setAttachPrefix (const Pathname &attach_prefix) |
| static std::string | getRealPath (const std::string &path) |
| static Pathname | getRealPath (const Pathname &path) |
Protected Member Functions | |
| bool | dependsOnParent (MediaAccessId parentId, bool exactIdMatch) |
| Check if the current media handler depends on an another handler specified by media access id. | |
| bool | dependsOnParent () |
| void | resetParentId () |
| Called in case, where the media manager takes over the destruction of the parent id (e.g. | |
| Pathname | attachPoint () const |
| Return the currently used attach point. | |
| void | setAttachPoint (const Pathname &path, bool temp) |
| Set a new attach point. | |
| void | setAttachPoint (const AttachPointRef &ref) |
| Set a (shared) attach point. | |
| AttachPoint | attachPointHint () const |
| Get the actual attach point hint. | |
| void | attachPointHint (const Pathname &path, bool temp) |
| Set the attach point hint as specified by the user. | |
| Pathname | createAttachPoint () const |
| Try to create a default / temporary attach point. | |
| Pathname | createAttachPoint (const Pathname &attach_root) const |
| Try to create a temporary attach point in specified root. | |
| void | removeAttachPoint () |
| Remove unused attach point. | |
| virtual bool | checkAttachPoint (const Pathname &apoint) const |
| Verify if the specified directory as attach point (root) as requires by the particular media handler implementation. | |
| bool | isUseableAttachPoint (const Pathname &path, bool mtab=true) const |
| Ask media manager, if the specified path is already used as attach point or if there are another attach points bellow of it. | |
| std::string | mediaSourceName () const |
| Get the media source name or an empty string. | |
| void | setMediaSource (const MediaSourceRef &ref) |
| Set new media source reference. | |
| AttachedMedia | findAttachedMedia (const MediaSourceRef &media) const |
| Ask the media manager if specified media source is already attached. | |
| AttachedMedia | attachedMedia () const |
| Returns the attached media. | |
| bool | isSharedMedia () const |
| Returns a hint if the media is shared or not. | |
| bool | checkAttached (bool matchMountFs) const |
| Check actual mediaSource attachment against the current mount table of the system. | |
| void | forceRelaseAllMedia (bool matchMountFs, bool autoMountedOny=true) |
| Call to this function will try to release all media matching the currenlty attached media source, that it is able to find in the mount table. | |
| void | forceRelaseAllMedia (const MediaSourceRef &ref, bool matchMountFs, bool autoMountedOnly=true) |
| virtual bool | isAutoMountedMedia (const AttachedMedia &media) |
| virtual void | attachTo (bool next=false)=0 |
| Call concrete handler to attach the media. | |
| virtual void | disconnectFrom () |
| Call concrete handler to disconnect media. | |
| virtual void | releaseFrom (bool eject)=0 |
| Call concrete handler to release the media. | |
| virtual void | forceEject () |
| Call concrete handler to physically eject the media (i.e. | |
| virtual void | getFile (const Pathname &filename) const =0 |
| Call concrete handler to provide file below attach point. | |
| virtual void | getFileCopy (const Pathname &srcFilename, const Pathname &targetFilename) const |
| Call concrete handler to provide a file under a different place in the file system (usually not under attach point) as a copy. | |
| virtual void | getDir (const Pathname &dirname, bool recurse_r) const =0 |
| Call concrete handler to provide directory content (not recursive!) below attach point. | |
| virtual void | getDirInfo (std::list< std::string > &retlist, const Pathname &dirname, bool dots=true) const =0 |
| Call concrete handler to provide a content list of directory on media via retlist. | |
| virtual void | getDirInfo (filesystem::DirContent &retlist, const Pathname &dirname, bool dots=true) const =0 |
| Basically the same as getDirInfo above. | |
| virtual bool | getDoesFileExist (const Pathname &filename) const =0 |
| check if a file exists | |
| void | getDirectoryYast (std::list< std::string > &retlist, const Pathname &dirname, bool dots=true) const |
| Retrieve and if available scan dirname/directory.yast. | |
| void | getDirectoryYast (filesystem::DirContent &retlist, const Pathname &dirname, bool dots=true) const |
| Retrieve and if available scan dirname/directory.yast. | |
Static Protected Member Functions | |
| static bool | checkAttachPoint (const Pathname &apoint, bool empty_dir, bool writeable) |
| Verify if the specified directory as attach point (root) using requested checks. | |
Protected Attributes | |
| const Url | _url |
| Url to handle. | |
| MediaAccessId | _parentId |
| Access Id of media handler we depend on. | |
Private Attributes | |
| MediaSourceRef | _mediaSource |
| The attached media source description reference. | |
| AttachPointRef | _attachPoint |
| This is where the media will be actually attached ("mounted"). | |
| AttachPoint | _AttachPointHint |
| The user provided attach preferred point. | |
| Pathname | _relativeRoot |
| The relative root directory of the data on the media. | |
| bool | _does_download |
| True if concrete handler downloads files to the local filesystem. | |
| time_t | _attach_mtime |
| timestamp of the the last attach verification | |
Static Private Attributes | |
| static Pathname | _attachPrefix |
| User defined default attach point prefix. | |
Friends | |
| class | MediaAccess |
| MediaAccess (MediaManager) needs access to the attachedMedia() function to deliver a shared media source and its attach point to the media manager and then to other media handler instances. | |
| std::ostream & | operator<< (std::ostream &str, const MediaHandler &obj) |
Handles the requests forwarded by MediaAccess. The public interface contains nonvirtual methods, which should do common sanitychecks and logging. For the real action they call virtual methods overloaded by the concrete handler.
Definition at line 43 of file MediaHandler.h.
|
|
Definition at line 47 of file MediaHandler.h. |
|
|
Definition at line 48 of file MediaHandler.h. |
|
||||||||||||||||||||
|
If the concrete media handler provides a nonempty attach_point, it must be an existing directory. On an empty attach_point, MediaHandler will create a temporay directory, which will be erased from destructor. On any error, the attach_point is set to an empty Pathname, which should lead to E_bad_attachpoint. Definition at line 51 of file MediaHandler.cc. References _url, zypp::filesystem::Pathname::asString(), attachPointHint(), ERR, getRealPath(), zypp::Url::getScheme(), and setAttachPoint(). |
|
|
Contolling MediaAccess takes care, that attached media is released prior to deleting this.
Definition at line 102 of file MediaHandler.cc. References removeAttachPoint(). |
|
|
Definition at line 310 of file MediaHandler.cc. References _attachPrefix, zypp::filesystem::Pathname::empty(), and MIL. Referenced by zypp::media::MediaManager::setAttachPrefix(). |
|
|
Definition at line 118 of file MediaHandler.cc. Referenced by zypp::media::MediaDIR::attachTo(), getRealPath(), and MediaHandler(). |
|
|
Definition at line 155 of file MediaHandler.cc. References zypp::filesystem::Pathname::asString(), and getRealPath(). |
|
||||||||||||
|
Check if the current media handler depends on an another handler specified by media access id.
Definition at line 958 of file MediaHandler.cc. References _parentId, zypp::media::MediaManager::getAttachedMedia(), and zypp::media::AttachedMedia::mediaSource. Referenced by zypp::media::MediaAccess::dependsOnParent(). |
|
|
Definition at line 952 of file MediaHandler.cc. References _parentId. |
|
|
Called in case, where the media manager takes over the destruction of the parent id (e.g. while destruction of the media manager). Definition at line 112 of file MediaHandler.cc. References _parentId. Referenced by zypp::media::MediaAccess::resetParentId(). |
|
|
Return the currently used attach point.
Definition at line 212 of file MediaHandler.cc. References _attachPoint. Referenced by zypp::media::MediaISO::attachTo(), zypp::media::MediaDIR::attachTo(), zypp::media::MediaCurl::attachTo(), zypp::media::MediaCurl::MediaCurl(), zypp::media::MediaSMB::releaseFrom(), zypp::media::MediaNFS::releaseFrom(), zypp::media::MediaISO::releaseFrom(), and zypp::media::MediaDISK::releaseFrom(). |
|
||||||||||||
|
Set a new attach point.
Definition at line 227 of file MediaHandler.cc. References _attachPoint, and zypp::RW_pointer< _D, _Traits >::reset(). Referenced by attach(), zypp::media::MediaSMB::attachTo(), zypp::media::MediaNFS::attachTo(), zypp::media::MediaDISK::attachTo(), zypp::media::MediaDIR::attachTo(), zypp::media::MediaCurl::attachTo(), zypp::media::MediaCurl::MediaCurl(), MediaHandler(), and removeAttachPoint(). |
|
|
Set a (shared) attach point.
Definition at line 250 of file MediaHandler.cc. References _attachPoint, and zypp::RW_pointer< _D, _Traits >::reset(). |
|
|
Get the actual attach point hint.
Definition at line 282 of file MediaHandler.cc. References _AttachPointHint. Referenced by attach(), and MediaHandler(). |
|
||||||||||||
|
Set the attach point hint as specified by the user.
Definition at line 267 of file MediaHandler.cc. References _AttachPointHint, zypp::media::AttachPoint::path, and zypp::media::AttachPoint::temp. |
|
|
Try to create a default / temporary attach point. It trys to create it in attachPrefix if avaliable, then in built-in directories.
Definition at line 339 of file MediaHandler.cc. References _attachPrefix, and zypp::filesystem::Pathname::empty(). Referenced by zypp::media::MediaCurl::attachTo(). |
|
|
Try to create a temporary attach point in specified root.
Definition at line 375 of file MediaHandler.cc. References zypp::filesystem::Pathname::absolute(), zypp::filesystem::Pathname::empty(), and ERR. |
|
|
Remove unused attach point. If the attach point is temporary, the attach point directory and all it content will be removed. Definition at line 170 of file MediaHandler.cc. References _attachPoint, _mediaSource, DBG, ERR, INT, MIL, zypp::filesystem::recursive_rmdir(), setAttachPoint(), and zypp::RW_pointer< _D, _Traits >::unique(). Referenced by attach(), zypp::media::MediaSMB::attachTo(), zypp::media::MediaNFS::attachTo(), zypp::media::MediaDISK::attachTo(), release(), and ~MediaHandler(). |
|
|
Verify if the specified directory as attach point (root) as requires by the particular media handler implementation.
Reimplemented in zypp::media::MediaCurl. Definition at line 878 of file MediaHandler.cc. Referenced by zypp::media::MediaCurl::checkAttachPoint(). |
|
||||||||||||||||
|
Verify if the specified directory as attach point (root) using requested checks.
Definition at line 885 of file MediaHandler.cc. References zypp::filesystem::Pathname::absolute(), zypp::filesystem::Pathname::empty(), and ERR. |
|
||||||||||||
|
Ask media manager, if the specified path is already used as attach point or if there are another attach points bellow of it.
Definition at line 436 of file MediaHandler.cc. References zypp::media::MediaManager::isUseableAttachPoint(). Referenced by zypp::media::MediaCurl::attachTo(). |
|
|
Get the media source name or an empty string.
Definition at line 224 of file MediaHandler.h. References _mediaSource. Referenced by zypp::media::MediaCD::releaseFrom(). |
|
|
Set new media source reference.
Definition at line 452 of file MediaHandler.cc. References _mediaSource, and zypp::RW_pointer< _D, _Traits >::reset(). Referenced by attach(), zypp::media::MediaSMB::attachTo(), zypp::media::MediaNFS::attachTo(), and zypp::media::MediaDISK::attachTo(). |
|
|
Ask the media manager if specified media source is already attached.
Definition at line 296 of file MediaHandler.cc. Referenced by zypp::media::MediaSMB::attachTo(), zypp::media::MediaNFS::attachTo(), and zypp::media::MediaDISK::attachTo(). |
|
|
Returns the attached media. Used by MediaManager to find other handlers using the same source.
Definition at line 468 of file MediaHandler.cc. References _attachPoint, and _mediaSource. Referenced by zypp::media::MediaAccess::attachedMedia(), checkAttached(), forceRelaseAllMedia(), and zypp::media::MediaCD::releaseFrom(). |
|
|
Returns a hint if the media is shared or not.
Definition at line 485 of file MediaHandler.cc. References _mediaSource, and zypp::RW_pointer< _D, _Traits >::unique(). Referenced by zypp::media::MediaAccess::isSharedMedia(). |
|
|
Check actual mediaSource attachment against the current mount table of the system. Used to implement isAttached().
Definition at line 499 of file MediaHandler.cc. References _attach_mtime, attachedMedia(), zypp::media::AttachedMedia::attachPoint, DBG, zypp::media::MediaManager::getMountEntries(), zypp::media::MediaManager::getMountTableMTime(), and zypp::media::AttachedMedia::mediaSource. Referenced by zypp::media::MediaSMB::isAttached(), zypp::media::MediaNFS::isAttached(), zypp::media::MediaISO::isAttached(), zypp::media::MediaDISK::isAttached(), and zypp::media::MediaCD::isAttached(). |
|
||||||||||||
|
Call to this function will try to release all media matching the currenlty attached media source, that it is able to find in the mount table. This means also foreign (user) mounts!
Definition at line 780 of file MediaHandler.cc. References attachedMedia(). Referenced by zypp::media::MediaCD::releaseFrom(). |
|
||||||||||||||||
|
Definition at line 785 of file MediaHandler.cc. References zypp::media::MediaManager::getMountEntries(). |
|
|
Reimplemented in zypp::media::MediaCD. Definition at line 774 of file MediaHandler.cc. |
|
|
Call concrete handler to attach the media. Asserted that not already attached, and attachPoint is a directory.
Implemented in zypp::media::MediaCD, zypp::media::MediaCurl, zypp::media::MediaDIR, zypp::media::MediaDISK, zypp::media::MediaISO, zypp::media::MediaNFS, and zypp::media::MediaSMB. Referenced by attach(). |
|
|
Call concrete handler to disconnect media. Asserted that media is attached. This is useful for media which e.g. holds open a connection to a server like FTP. After calling disconnect() the media object still is valid and files are present. After calling disconnect() it's not possible to call provideFile() or provideDir() anymore.
Reimplemented in zypp::media::MediaCurl. Definition at line 323 of file MediaHandler.h. Referenced by disconnect(). |
|
|
Call concrete handler to release the media. If eject is true, and the media is used in one handler instance only, physically eject the media (i.e. CD-ROM). Asserted that media is attached.
Implemented in zypp::media::MediaCD, zypp::media::MediaCurl, zypp::media::MediaDIR, zypp::media::MediaDISK, zypp::media::MediaISO, zypp::media::MediaNFS, and zypp::media::MediaSMB. Referenced by release(). |
|
|
Call concrete handler to physically eject the media (i.e. CD-ROM) in case the media is not attached.. Asserted that media is not attached. Reimplemented in zypp::media::MediaCD. Definition at line 344 of file MediaHandler.h. Referenced by release(). |
|
|
Call concrete handler to provide file below attach point. Default implementation provided, that returns whether a file is located at 'localRoot + filename'. Asserted that media is attached.
Implemented in zypp::media::MediaCD, zypp::media::MediaCurl, zypp::media::MediaDIR, zypp::media::MediaDISK, zypp::media::MediaISO, zypp::media::MediaNFS, and zypp::media::MediaSMB. Definition at line 1228 of file MediaHandler.cc. References zypp::filesystem::PathInfo::isFile(), and localPath(). Referenced by getDirectoryYast(), zypp::media::MediaSMB::getFile(), zypp::media::MediaNFS::getFile(), zypp::media::MediaISO::getFile(), zypp::media::MediaDISK::getFile(), zypp::media::MediaDIR::getFile(), zypp::media::MediaCD::getFile(), getFileCopy(), and provideFile(). |
|
||||||||||||
|
Call concrete handler to provide a file under a different place in the file system (usually not under attach point) as a copy. Media must be attached before by callee. Default implementation provided that calls getFile(srcFilename) and copies the result around.
Reimplemented in zypp::media::MediaCurl. Definition at line 1242 of file MediaHandler.cc. References zypp::filesystem::copy(), getFile(), localPath(), and ZYPP_THROW. Referenced by provideFileCopy(). |
|
||||||||||||
|
Call concrete handler to provide directory content (not recursive!) below attach point. Return E_not_supported_by_media if media does not support retrieval of directory content. Default implementation provided, that returns whether a directory is located at 'localRoot + dirname'. Asserted that media is attached.
Implemented in zypp::media::MediaCD, zypp::media::MediaCurl, zypp::media::MediaDIR, zypp::media::MediaDISK, zypp::media::MediaISO, zypp::media::MediaNFS, and zypp::media::MediaSMB. Definition at line 1262 of file MediaHandler.cc. References zypp::filesystem::PathInfo::isDir(), and localPath(). Referenced by zypp::media::MediaSMB::getDir(), zypp::media::MediaNFS::getDir(), zypp::media::MediaISO::getDir(), zypp::media::MediaDISK::getDir(), zypp::media::MediaDIR::getDir(), zypp::media::MediaCD::getDir(), provideDir(), and provideDirTree(). |
|
||||||||||||||||
|
Call concrete handler to provide a content list of directory on media via retlist. If dots is false entries starting with '.' are not reported. Return E_not_supported_by_media if media does not support retrieval of directory content. Default implementation provided, that returns the content of a directory at 'localRoot + dirnname' retrieved via 'readdir'. Asserted that media is attached and retlist is empty.
Implemented in zypp::media::MediaCD, zypp::media::MediaCurl, zypp::media::MediaDIR, zypp::media::MediaDISK, zypp::media::MediaISO, zypp::media::MediaNFS, and zypp::media::MediaSMB. Definition at line 1284 of file MediaHandler.cc. References zypp::filesystem::PathInfo::isDir(), localPath(), url(), and ZYPP_THROW. Referenced by dirInfo(), zypp::media::MediaSMB::getDirInfo(), zypp::media::MediaNFS::getDirInfo(), zypp::media::MediaISO::getDirInfo(), zypp::media::MediaDISK::getDirInfo(), zypp::media::MediaDIR::getDirInfo(), and zypp::media::MediaCD::getDirInfo(). |
|
||||||||||||||||
|
Basically the same as getDirInfo above. The content list is returned as filesystem::DirContent, which includes name and filetype of each directory entry. Retrieving the filetype usg. requires an additional stat call for each entry, thus it's more expensive than a simple readdir. Asserted that media is attached and retlist is empty.
Implemented in zypp::media::MediaCD, zypp::media::MediaCurl, zypp::media::MediaDIR, zypp::media::MediaDISK, zypp::media::MediaISO, zypp::media::MediaNFS, and zypp::media::MediaSMB. Definition at line 1322 of file MediaHandler.cc. References zypp::filesystem::PathInfo::isDir(), localPath(), url(), and ZYPP_THROW. |
|
|
check if a file exists Asserted that url is a file and not a dir.
Implemented in zypp::media::MediaCD, zypp::media::MediaCurl, zypp::media::MediaDIR, zypp::media::MediaDISK, zypp::media::MediaISO, zypp::media::MediaNFS, and zypp::media::MediaSMB. Definition at line 1357 of file MediaHandler.cc. References zypp::filesystem::PathInfo::isDir(), localPath(), url(), and ZYPP_THROW. Referenced by doesFileExist(), zypp::media::MediaSMB::getDoesFileExist(), zypp::media::MediaNFS::getDoesFileExist(), zypp::media::MediaISO::getDoesFileExist(), zypp::media::MediaDISK::getDoesFileExist(), zypp::media::MediaDIR::getDoesFileExist(), and zypp::media::MediaCD::getDoesFileExist(). |
|
||||||||||||||||
|
Retrieve and if available scan dirname/directory.yast. Asserted that media is attached.
Definition at line 1145 of file MediaHandler.cc. Referenced by zypp::media::MediaCurl::getDirInfo(). |
|
||||||||||||||||
|
Retrieve and if available scan dirname/directory.yast. Asserted that media is attached.
Definition at line 1165 of file MediaHandler.cc. References zypp::bit::asString(), DBG, ERR, getFile(), localPath(), url(), and ZYPP_THROW. |
|
|
Hint if files are downloaded or not.
Definition at line 493 of file MediaHandler.h. References _does_download. Referenced by zypp::media::MediaAccess::downloads(). |
|
|
Protocol hint for MediaAccess.
Definition at line 498 of file MediaHandler.h. References _url, and zypp::Url::getScheme(). Referenced by zypp::media::MediaAccess::dumpOn(), and zypp::media::MediaAccess::protocol(). |
|
|
Url used.
Definition at line 503 of file MediaHandler.h. References _url. Referenced by zypp::media::MediaDISK::attachTo(), zypp::media::MediaDIR::attachTo(), zypp::media::MediaCurl::attachTo(), zypp::media::MediaCD::attachTo(), dirInfo(), doesFileExist(), getDirectoryYast(), getDirInfo(), getDoesFileExist(), zypp::media::MediaCurl::getFileCopy(), zypp::media::operator<<(), provideDir(), provideDirTree(), provideFile(), provideFileCopy(), and zypp::media::MediaAccess::url(). |
|
|
Use concrete handler to attach the media.
Definition at line 630 of file MediaHandler.cc. References attachPointHint(), attachTo(), isAttached(), MIL, zypp::media::AttachPoint::path, removeAttachPoint(), setAttachPoint(), setMediaSource(), zypp::media::AttachPoint::temp, and ZYPP_RETHROW. Referenced by zypp::media::MediaAccess::attach(). |
|
|
True if media is attached.
Reimplemented in zypp::media::MediaCD, zypp::media::MediaDISK, zypp::media::MediaISO, zypp::media::MediaNFS, and zypp::media::MediaSMB. Definition at line 520 of file MediaHandler.h. References _mediaSource. Referenced by attach(), dirInfo(), disconnect(), doesFileExist(), zypp::media::MediaAccess::isAttached(), zypp::media::operator<<(), provideDir(), provideDirTree(), provideFile(), provideFileCopy(), and release(). |
|
|
Return the local directory that corresponds to medias url, no matter if media isAttached or not. Files requested will be available at 'localRoot() + filename' or better 'localPath( filename )'. Returns empty pathname if E_bad_attachpoint Definition at line 233 of file MediaHandler.cc. References _attachPoint, and _relativeRoot. Referenced by localPath(), zypp::media::MediaAccess::localRoot(), and zypp::media::operator<<(). |
|
|
Files provided will be available at 'localPath(filename)'. Returns empty pathname if E_bad_attachpoint Definition at line 661 of file MediaHandler.cc. References zypp::filesystem::Pathname::absolutename(), zypp::filesystem::Pathname::empty(), and localRoot(). Referenced by getDir(), zypp::media::MediaCurl::getDir(), getDirectoryYast(), getDirInfo(), getDoesFileExist(), getFile(), zypp::media::MediaCurl::getFile(), getFileCopy(), zypp::media::MediaAccess::localPath(), and releasePath(). |
|
|
Use concrete handler to isconnect media. This is useful for media which e.g. holds open a connection to a server like FTP. After calling disconnect() the media object still is valid and files are present. After calling disconnect() it's not possible to call provideFile() or provideDir() anymore.
Definition at line 684 of file MediaHandler.cc. References disconnectFrom(), isAttached(), and MIL. Referenced by zypp::media::MediaAccess::disconnect(), and zypp::media::MediaCurl::releaseFrom(). |
|
|
Use concrete handler to release the media.
Definition at line 701 of file MediaHandler.cc. References _mediaSource, DBG, forceEject(), isAttached(), releaseFrom(), removeAttachPoint(), zypp::RW_pointer< _D, _Traits >::reset(), zypp::RW_pointer< _D, _Traits >::unique(), zypp::RW_pointer< _D, _Traits >::use_count(), and ZYPP_RETHROW. Referenced by zypp::media::MediaAccess::close(), zypp::media::MediaAccess::release(), zypp::media::MediaCD::~MediaCD(), zypp::media::MediaCurl::~MediaCurl(), zypp::media::MediaDIR::~MediaDIR(), zypp::media::MediaDISK::~MediaDISK(), zypp::media::MediaISO::~MediaISO(), zypp::media::MediaNFS::~MediaNFS(), and zypp::media::MediaSMB::~MediaSMB(). |
|
|
Use concrete handler to provide file denoted by path below 'localRoot'. Filename is interpreted relative to the attached url and a path prefix is preserved.
Definition at line 1000 of file MediaHandler.cc. References DBG, getFile(), INT, isAttached(), url(), and ZYPP_THROW. Referenced by zypp::media::MediaAccess::provideFile(). |
|
||||||||||||
|
Call concrete handler to provide a copy of a file under a different place in the file system (usually not under attach point) as a copy. Media must be attached before by callee.
Definition at line 987 of file MediaHandler.cc. References DBG, getFileCopy(), INT, isAttached(), url(), and ZYPP_THROW. Referenced by zypp::media::MediaAccess::getFile(). |
|
|
Use concrete handler to provide directory denoted by path below 'localRoot' (not recursive!). dirname is interpreted relative to the attached url and a path prefix is preserved.
Definition at line 1020 of file MediaHandler.cc. References getDir(), INT, isAttached(), MIL, url(), and ZYPP_THROW. Referenced by zypp::media::MediaAccess::provideDir(). |
|
|
Use concrete handler to provide directory tree denoted by path below 'localRoot' (recursive!!). dirname is interpreted relative to the attached url and a path prefix is preserved.
Definition at line 1039 of file MediaHandler.cc. References getDir(), INT, isAttached(), MIL, url(), and ZYPP_THROW. Referenced by zypp::media::MediaAccess::provideDirTree(). |
|
|
Remove filename below localRoot IFF handler downloads files to the local filesystem. Never remove anything from media.
Definition at line 615 of file MediaHandler.h. References releasePath(). Referenced by zypp::media::MediaAccess::releaseFile(). |
|
|
Remove directory tree below localRoot IFF handler downloads files to the local filesystem. Never remove anything from media.
Definition at line 624 of file MediaHandler.h. References releasePath(). Referenced by zypp::media::MediaAccess::releaseDir(). |
|
|
Remove pathname below localRoot IFF handler downloads files to the local filesystem. Never remove anything from media. If pathname denotes a directory it is recursively removed. If pathname is empty or '/' everything below the localRoot is recursively removed. If pathname denotes a file it is unlinked.
Definition at line 1058 of file MediaHandler.cc. References _attachPoint, _does_download, zypp::filesystem::PathInfo::isFile(), localPath(), zypp::filesystem::PathInfo::path(), and zypp::filesystem::unlink(). Referenced by releaseDir(), releaseFile(), and zypp::media::MediaAccess::releasePath(). |
|
||||||||||||||||
|
Return content of directory on media via retlist. If dots is false entries starting with '.' are not reported. The request is forwarded to the concrete handler, which may atempt to retieve the content e.g. via 'readdir' Caution: This is not supported by all media types. Be prepared to handle E_not_supported_by_media.
Definition at line 1084 of file MediaHandler.cc. References getDirInfo(), INT, isAttached(), MIL, url(), and ZYPP_THROW. Referenced by zypp::media::MediaAccess::dirInfo(). |
|
||||||||||||||||
|
Basically the same as dirInfo above. The content is returned as filesystem::DirContent, which includes name and filetype of each directory entry. Retrieving the filetype usg. requires an additional stat call for each entry, thus it's more expensive than a simple readdir. Caution: This is not supported by all media types. Be prepared to handle E_not_supported_by_media.
Definition at line 1106 of file MediaHandler.cc. References getDirInfo(), INT, isAttached(), MIL, url(), and ZYPP_THROW. |
|
|
check if a file exists Asserted that url is a file and not a dir.
Definition at line 1128 of file MediaHandler.cc. References getDoesFileExist(), INT, isAttached(), MIL, url(), and ZYPP_THROW. Referenced by zypp::media::MediaAccess::doesFileExist(). |
|
|
MediaAccess (MediaManager) needs access to the attachedMedia() function to deliver a shared media source and its attach point to the media manager and then to other media handler instances. Further, is needs to be able to forward the dependsOnParent() and resetParentId() functions to the media manager. Definition at line 119 of file MediaHandler.h. |
|
||||||||||||
|
|
|
|
User defined default attach point prefix.
Definition at line 59 of file MediaHandler.h. Referenced by createAttachPoint(), and setAttachPrefix(). |
|
|
The attached media source description reference.
Definition at line 65 of file MediaHandler.h. Referenced by attachedMedia(), isAttached(), isSharedMedia(), mediaSourceName(), release(), removeAttachPoint(), and setMediaSource(). |
|
|
This is where the media will be actually attached ("mounted"). All files are provided bellow this + _relativeRoot directory. Definition at line 71 of file MediaHandler.h. Referenced by attachedMedia(), attachPoint(), localRoot(), releasePath(), removeAttachPoint(), and setAttachPoint(). |
|
|
The user provided attach preferred point. It may contain following values: "", true => create temporary attach point bellow of _attachPrefix or a built-in default and remove it if not needed any more. dir, false => user specified attach point (not removed) Definition at line 83 of file MediaHandler.h. Referenced by attachPointHint(). |
|
|
The relative root directory of the data on the media. See also localRoot() and urlpath_below_attachpoint_r constructor argument. Definition at line 90 of file MediaHandler.h. Referenced by localRoot(). |
|
|
True if concrete handler downloads files to the local filesystem. If true releaseFile/Dir will delete them. Definition at line 96 of file MediaHandler.h. Referenced by downloads(), and releasePath(). |
|
|
timestamp of the the last attach verification
Definition at line 99 of file MediaHandler.h. Referenced by checkAttached(). |
|
|
|
Access Id of media handler we depend on.
Definition at line 110 of file MediaHandler.h. Referenced by zypp::media::MediaISO::attachTo(), dependsOnParent(), zypp::media::MediaISO::releaseFrom(), resetParentId(), and zypp::media::MediaISO::~MediaISO(). |
1.4.6