10d1478b71e53104bc762fbca6c262b3acb35ab4
[platform/upstream/libzypp.git] / zypp / media / MediaNFS.h
1 /*---------------------------------------------------------------------\
2 |                          ____ _   __ __ ___                          |
3 |                         |__  / \ / / . \ . \                         |
4 |                           / / \ V /|  _/  _/                         |
5 |                          / /__ | | | | | |                           |
6 |                         /_____||_| |_| |_|                           |
7 |                                                                      |
8 \---------------------------------------------------------------------*/
9 /** \file zypp/media/MediaNFS.h
10  *
11 */
12 #ifndef ZYPP_MEDIA_MEDIANFS_H
13 #define ZYPP_MEDIA_MEDIANFS_H
14
15 #include "zypp/media/MediaHandler.h"
16
17 /**
18  * Value of NFS mount minor timeout (passed to <code>timeo</code> option
19  * of the NFS mount) in tenths of a second.
20  *
21  * The value of 300 should give a major timeout after 3.5 minutes
22  * for UDP and 1.5 minutes for TCP. (#350309)
23  */
24 #define NFS_MOUNT_TIMEOUT 300
25
26 namespace zypp {
27   namespace media {
28
29     ///////////////////////////////////////////////////////////////////
30     //
31     //  CLASS NAME : MediaNFS
32     /**
33      * @short Implementation class for NFS MediaHandler
34      * @see MediaHandler
35      **/
36     class MediaNFS : public MediaHandler {
37
38       protected:
39
40         virtual void attachTo (bool next = false);
41         
42         /** \deprecated in favor of releaseFrom(string&) */
43         virtual void releaseFrom( bool eject ) ZYPP_DEPRECATED;
44         virtual void releaseFrom( const std::string & ejectDev );
45         virtual void getFile( const Pathname & filename ) const;
46         virtual void getDir( const Pathname & dirname, bool recurse_r ) const;
47         virtual void getDirInfo( std::list<std::string> & retlist,
48                                  const Pathname & dirname, bool dots = true ) const;
49         virtual void getDirInfo( filesystem::DirContent & retlist,
50                                  const Pathname & dirname, bool dots = true ) const;
51         virtual bool getDoesFileExist( const Pathname & filename ) const;
52
53       public:
54
55         MediaNFS( const Url&       url_r,
56                   const Pathname & attach_point_hint_r );
57
58         virtual ~MediaNFS() { try { release(); } catch(...) {} }
59
60         virtual bool isAttached() const;
61     };
62
63     ///////////////////////////////////////////////////////////////////
64   } // namespace media
65 } // namespace zypp
66
67 #endif // ZYPP_MEDIA_MEDIANFS_H