zypp::media::MediaNFS Class Reference

Implementation class for NFS MediaHandler. More...

#include <MediaNFS.h>

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

List of all members.

Public Member Functions

 MediaNFS (const Url &url_r, const Pathname &attach_point_hint_r)
virtual ~MediaNFS ()
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 (const std::string &ejectDev)
 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


Detailed Description

Implementation class for NFS MediaHandler.

See also:
MediaHandler

Definition at line 36 of file MediaNFS.h.


Constructor & Destructor Documentation

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

Definition at line 42 of file MediaNFS.cc.

References MIL.

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

Definition at line 56 of file MediaNFS.h.

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


Member Function Documentation

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

void zypp::media::MediaNFS::releaseFrom ( const std::string &  ejectDev  )  [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.

Parameters:
ejectDev Device to eject. None if empty.
Exceptions:
MediaException 

Implements zypp::media::MediaHandler.

Definition at line 200 of file MediaNFS.cc.

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

void zypp::media::MediaNFS::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 213 of file MediaNFS.cc.

void zypp::media::MediaNFS::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 225 of file MediaNFS.cc.

void zypp::media::MediaNFS::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 238 of file MediaNFS.cc.

Referenced by getDirInfo().

void zypp::media::MediaNFS::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 252 of file MediaNFS.cc.

References getDirInfo().

bool zypp::media::MediaNFS::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 258 of file MediaNFS.cc.

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

True if media is attached.

Reimplemented from zypp::media::MediaHandler.

Definition at line 187 of file MediaNFS.cc.

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

Referenced by attachTo().


The documentation for this class was generated from the following files:

doxygen