libzypp  13.10.6
MediaNFS.h
Go to the documentation of this file.
1 /*---------------------------------------------------------------------\
2 | ____ _ __ __ ___ |
3 | |__ / \ / / . \ . \ |
4 | / / \ V /| _/ _/ |
5 | / /__ | | | | | | |
6 | /_____||_| |_| |_| |
7 | |
8 \---------------------------------------------------------------------*/
12 #ifndef ZYPP_MEDIA_MEDIANFS_H
13 #define ZYPP_MEDIA_MEDIANFS_H
14 
16 
24 #define NFS_MOUNT_TIMEOUT 300
25 
26 namespace zypp {
27  namespace media {
28 
30  //
31  // CLASS NAME : MediaNFS
36  class MediaNFS : public MediaHandler {
37 
38  protected:
39 
40  virtual void attachTo (bool next = false);
41 
42  virtual void releaseFrom( const std::string & ejectDev );
43  virtual void getFile( const Pathname & filename ) const;
44  virtual void getDir( const Pathname & dirname, bool recurse_r ) const;
45  virtual void getDirInfo( std::list<std::string> & retlist,
46  const Pathname & dirname, bool dots = true ) const;
47  virtual void getDirInfo( filesystem::DirContent & retlist,
48  const Pathname & dirname, bool dots = true ) const;
49  virtual bool getDoesFileExist( const Pathname & filename ) const;
50 
51  public:
52 
53  MediaNFS( const Url& url_r,
54  const Pathname & attach_point_hint_r );
55 
56  virtual ~MediaNFS() { try { release(); } catch(...) {} }
57 
58  virtual bool isAttached() const;
59  };
60 
62  } // namespace media
63 } // namespace zypp
64 
65 #endif // ZYPP_MEDIA_MEDIANFS_H
Implementation class for NFS MediaHandler.
Definition: MediaNFS.h:36
virtual bool isAttached() const
True if media is attached.
Definition: MediaNFS.cc:187
virtual bool getDoesFileExist(const Pathname &filename) const
check if a file exists
Definition: MediaNFS.cc:258
virtual void attachTo(bool next=false)
Call concrete handler to attach the media.
Definition: MediaNFS.cc:59
virtual void releaseFrom(const std::string &ejectDev)
Call concrete handler to release the media.
Definition: MediaNFS.cc:200
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.
Definition: MediaNFS.cc:238
MediaNFS(const Url &url_r, const Pathname &attach_point_hint_r)
Definition: MediaNFS.cc:42
Abstract base class for &#39;physical&#39; MediaHandler like MediaCD, etc.
Definition: MediaHandler.h:45
std::list< DirEntry > DirContent
Returned by readdir.
Definition: PathInfo.h:544
virtual void getFile(const Pathname &filename) const
Call concrete handler to provide file below attach point.
Definition: MediaNFS.cc:213
virtual ~MediaNFS()
Definition: MediaNFS.h:56
void release(const std::string &ejectDev="")
Use concrete handler to release the media.
Url manipulation class.
Definition: Url.h:87
virtual void getDir(const Pathname &dirname, bool recurse_r) const
Call concrete handler to provide directory content (not recursive!) below attach point.
Definition: MediaNFS.cc:225