zypp::media::MediaSMB Class Reference

#include <MediaSMB.h>

Inheritance diagram for zypp::media::MediaSMB:
[legend]

List of all members.

Public Member Functions

 MediaSMB (const Url &url_r, const Pathname &attach_point_hint_r)
virtual ~MediaSMB ()
virtual bool isAttached () const
 True if media is attached.

Protected Member Functions

virtual void attachTo (bool next=false)
 Call concrete handler to attach the media.
virtual void releaseFrom (bool eject)
 Call concrete handler to release the media.
virtual void getFile (const Pathname &filename) const
 Call concrete handler to provide file below attach point.
virtual void getDir (const Pathname &dirname, bool recurse_r) const
 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
 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
 Basically the same as getDirInfo above.
virtual bool getDoesFileExist (const Pathname &filename) const
 check if a file exists
void mountAsCIFS ()
 MediaCIFS rewrites the vfstype to "cifs" within it's constructor.

Private Attributes

const char * _vfstype
 vfstype for mount.


Detailed Description

Implementation class for SMB MediaHandler NOTE: The implementation currently serves both, "smb" and "cifs" URL's, but passes "cifs" to the mount command in any case.
See also:
MediaHandler

Definition at line 31 of file MediaSMB.h.


Constructor & Destructor Documentation

zypp::media::MediaSMB::MediaSMB ( const Url url_r,
const Pathname &  attach_point_hint_r 
)

Definition at line 95 of file MediaSMB.cc.

References MIL.

virtual zypp::media::MediaSMB::~MediaSMB (  )  [inline, virtual]

Definition at line 65 of file MediaSMB.h.

References zypp::media::MediaHandler::release().


Member Function Documentation

void zypp::media::MediaSMB::attachTo ( bool  next = false  )  [protected, virtual]

Call concrete handler to attach the media.

Asserted that not already attached, and attachPoint is a directory.

Parameters:
next try next available device in turn until end of device list is reached (for media which are accessible through multiple devices like cdroms).
Exceptions:
MediaException 

Implements zypp::media::MediaHandler.

Definition at line 118 of file MediaSMB.cc.

References zypp::media::MediaHandler::_url, _vfstype, zypp::ui::asString(), zypp::media::MediaHandler::attachPoint(), zypp::media::AttachedMedia::attachPoint, zypp::media::MediaHandler::createAttachPoint(), DBG, zypp::media::MediaHandler::findAttachedMedia(), zypp::Url::getHost(), zypp::Url::getPassword(), zypp::Url::getPathName(), zypp::Url::getQueryParam(), zypp::media::getShare(), zypp::Url::getUsername(), isAttached(), zypp::media::MediaHandler::isUseableAttachPoint(), zypp::media::AttachedMedia::mediaSource, zypp::media::Mount::mount(), zypp::filesystem::TmpPath::path(), zypp::media::MediaHandler::removeAttachPoint(), zypp::media::MediaHandler::setAttachPoint(), zypp::media::MediaHandler::setMediaSource(), zypp::media::Mount::umount(), zypp::media::MediaHandler::url(), ZYPP_CAUGHT, and ZYPP_THROW.

void zypp::media::MediaSMB::releaseFrom ( bool  eject  )  [protected, virtual]

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.

Exceptions:
MediaException 

Implements zypp::media::MediaHandler.

Definition at line 282 of file MediaSMB.cc.

References zypp::ui::asString(), zypp::media::MediaHandler::attachPoint(), and zypp::media::Mount::umount().

void zypp::media::MediaSMB::getFile ( const Pathname &  filename  )  const [protected, virtual]

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.

Exceptions:
MediaException 

Implements zypp::media::MediaHandler.

Definition at line 296 of file MediaSMB.cc.

References zypp::media::MediaHandler::getFile().

void zypp::media::MediaSMB::getDir ( const Pathname &  dirname,
bool  recurse_r 
) const [protected, virtual]

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.

Exceptions:
MediaException 

Implements zypp::media::MediaHandler.

Definition at line 308 of file MediaSMB.cc.

References zypp::media::MediaHandler::getDir().

void zypp::media::MediaSMB::getDirInfo ( std::list< std::string > &  retlist,
const Pathname &  dirname,
bool  dots = true 
) const [protected, virtual]

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.

Exceptions:
MediaException 

Implements zypp::media::MediaHandler.

Definition at line 321 of file MediaSMB.cc.

References zypp::media::MediaHandler::getDirInfo().

void zypp::media::MediaSMB::getDirInfo ( filesystem::DirContent retlist,
const Pathname &  dirname,
bool  dots = true 
) const [protected, virtual]

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.

Exceptions:
MediaException 

Implements zypp::media::MediaHandler.

Definition at line 335 of file MediaSMB.cc.

References zypp::media::MediaHandler::getDirInfo().

bool zypp::media::MediaSMB::getDoesFileExist ( const Pathname &  filename  )  const [protected, virtual]

check if a file exists

Asserted that url is a file and not a dir.

Exceptions:
MediaException 

Implements zypp::media::MediaHandler.

Definition at line 341 of file MediaSMB.cc.

References zypp::media::MediaHandler::getDoesFileExist().

void zypp::media::MediaSMB::mountAsCIFS (  )  [inline, protected]

MediaCIFS rewrites the vfstype to "cifs" within it's constructor.

Definition at line 58 of file MediaSMB.h.

References _vfstype.

Referenced by zypp::media::MediaCIFS::MediaCIFS().

bool zypp::media::MediaSMB::isAttached (  )  const [virtual]

True if media is attached.

Reimplemented from zypp::media::MediaHandler.

Definition at line 269 of file MediaSMB.cc.

References zypp::media::MediaHandler::checkAttached().

Referenced by attachTo().


Member Data Documentation

const char* zypp::media::MediaSMB::_vfstype [private]

vfstype for mount.

This is either "smbfs" or "cifs" (rewritten by MediaCIFS). Obsolete: vfstype is allways "cifs".

Definition at line 40 of file MediaSMB.h.

Referenced by attachTo(), and mountAsCIFS().


The documentation for this class was generated from the following files:
Generated on Tue Sep 25 19:23:21 2007 for libzypp by  doxygen 1.5.3