DAV-0.6.1: RFC 4918 WebDAV support

Safe Haskell | None

Network.Protocol.HTTP.DAV

Synopsis

- newtype DAVT m a = DAVT {
  - runDAVT :: EitherT String (StateT DAVContext m) a
  }
- evalDAVT :: MonadIO m => String -> DAVT m a -> m (Either String a)
- setCreds :: MonadIO m => ByteString -> ByteString -> DAVT m ()
- setDepth :: MonadIO m => Maybe Depth -> DAVT m ()
- setResponseTimeout :: MonadIO m => Maybe Int -> DAVT m ()
- setUserAgent :: MonadIO m => ByteString -> DAVT m ()
- data DAVContext = DAVContext {
  - _allowedMethods :: [ByteString]
  - _baseRequest :: Request
  - _basicusername :: ByteString
  - _basicpassword :: ByteString
  - _complianceClasses :: [ByteString]
  - _depth :: Maybe Depth
  - _httpManager :: Manager
  - _lockToken :: Maybe ByteString
  - _userAgent :: ByteString
  }
- getProps :: String -> ByteString -> ByteString -> Maybe Depth -> IO Document
- getPropsAndContent :: String -> ByteString -> ByteString -> IO (Document, (Maybe ByteString, ByteString))
- putContentAndProps :: String -> ByteString -> ByteString -> (Document, (Maybe ByteString, ByteString)) -> IO ()
- putContent :: String -> ByteString -> ByteString -> (Maybe ByteString, ByteString) -> IO ()
- deleteContent :: String -> ByteString -> ByteString -> IO ()
- moveContent :: String -> ByteString -> ByteString -> ByteString -> IO ()
- makeCollection :: String -> ByteString -> ByteString -> IO Bool
- caldavReport :: String -> ByteString -> ByteString -> IO Document
- caldavReportM :: MonadIO m => DAVT m Document
- delContentM :: MonadIO m => DAVT m ()
- getPropsM :: MonadIO m => DAVT m Document
- getContentM :: MonadIO m => DAVT m (Maybe ByteString, ByteString)
- mkCol :: (MonadIO m, MonadBase IO m, MonadBaseControl IO m) => DAVT m Bool
- moveContentM :: MonadIO m => ByteString -> DAVT m ()
- putPropsM :: MonadIO m => Document -> DAVT m ()
- putContentM :: MonadIO m => (Maybe ByteString, ByteString) -> DAVT m ()
- withLockIfPossible :: (MonadIO m, MonadBase IO m, MonadBaseControl IO m) => Bool -> DAVT m a -> DAVT m a
- withLockIfPossibleForDelete :: (MonadIO m, MonadBase IO m, MonadBaseControl IO m) => Bool -> DAVT m a -> DAVT m a
- data Depth
  - = Depth0
  - | Depth1
  - | DepthInfinity
- data DAVContext = DAVContext {
  - _allowedMethods :: [ByteString]
  - _baseRequest :: Request
  - _basicusername :: ByteString
  - _basicpassword :: ByteString
  - _complianceClasses :: [ByteString]
  - _depth :: Maybe Depth
  - _httpManager :: Manager
  - _lockToken :: Maybe ByteString
  - _userAgent :: ByteString
  }
- userAgent :: Lens' DAVContext ByteString
- lockToken :: Lens' DAVContext (Maybe ByteString)
- httpManager :: Lens' DAVContext Manager
- depth :: Lens' DAVContext (Maybe Depth)
- complianceClasses :: Lens' DAVContext [ByteString]
- basicusername :: Lens' DAVContext ByteString
- basicpassword :: Lens' DAVContext ByteString
- baseRequest :: Lens' DAVContext Request
- allowedMethods :: Lens' DAVContext [ByteString]

# Documentation

newtype DAVT m a Source

Constructors

DAVT |

Fields

runDAVT :: EitherT String (StateT DAVContext m) a

Instances

MonadTrans DAVT |
Monad m => MonadError String (DAVT m) |
Monad m => MonadState DAVContext (DAVT m) |
MonadBase b m => MonadBase b (DAVT m) |
MonadBaseControl b m => MonadBaseControl b (DAVT m) |
Monad m => Monad (DAVT m) |
Monad m => Functor (DAVT m) |
MonadFix m => MonadFix (DAVT m) |
Monad m => MonadPlus (DAVT m) |
Monad m => Applicative (DAVT m) |
MonadIO m => MonadIO (DAVT m) |

evalDAVT :: MonadIO m => String -> DAVT m a -> m (Either String a)Source

setCreds :: MonadIO m => ByteString -> ByteString -> DAVT m ()Source

setDepth :: MonadIO m => Maybe Depth -> DAVT m ()Source

setResponseTimeout :: MonadIO m => Maybe Int -> DAVT m ()Source

setUserAgent :: MonadIO m => ByteString -> DAVT m ()Source

data DAVContext Source

Constructors

DAVContext |

Fields

_allowedMethods :: [ByteString]
_baseRequest :: Request
_basicusername :: ByteString
_basicpassword :: ByteString
_complianceClasses :: [ByteString]
_depth :: Maybe Depth
_httpManager :: Manager
_lockToken :: Maybe ByteString
_userAgent :: ByteString

Instances

Monad m => MonadState DAVContext (DAVT m) |

getProps :: String -> ByteString -> ByteString -> Maybe Depth -> IO Document Source

Deprecated: This function will be removed in favor of getPropsM

getPropsAndContent :: String -> ByteString -> ByteString -> IO (Document, (Maybe ByteString, ByteString))Source

Deprecated: This function will be removed in favor of getPropsM and getContentM

putContentAndProps :: String -> ByteString -> ByteString -> (Document, (Maybe ByteString, ByteString)) -> IO ()Source

Deprecated: This function will be removed in favor of putContentM and putPropsM

putContent :: String -> ByteString -> ByteString -> (Maybe ByteString, ByteString) -> IO ()Source

Deprecated: This function will be removed in favor of putContentM

deleteContent :: String -> ByteString -> ByteString -> IO ()Source

Deprecated: This function will be removed in favor of delContentM

moveContent :: String -> ByteString -> ByteString -> ByteString -> IO ()Source

Deprecated: This function will be removed in favor of moveContentM

makeCollection :: String -> ByteString -> ByteString -> IO Bool Source

Deprecated: This function will be removed in favor of mkCol

Creates a WebDAV collection, which is similar to a directory.

Returns False if the collection could not be made due to an intermediate collection not existing. (Ie, collection abcd cannot be made until collection ab/c exists.)

caldavReport :: String -> ByteString -> ByteString -> IO Document Source

Deprecated: This function will be removed in favor of caldavReportM

caldavReportM :: MonadIO m => DAVT m Document Source

delContentM :: MonadIO m => DAVT m ()Source

getPropsM :: MonadIO m => DAVT m Document Source

getContentM :: MonadIO m => DAVT m (Maybe ByteString, ByteString)Source

mkCol :: (MonadIO m, MonadBase IO m, MonadBaseControl IO m) => DAVT m Bool Source

moveContentM :: MonadIO m => ByteString -> DAVT m ()Source

putPropsM :: MonadIO m => Document -> DAVT m ()Source

putContentM :: MonadIO m => (Maybe ByteString, ByteString) -> DAVT m ()Source

withLockIfPossible :: (MonadIO m, MonadBase IO m, MonadBaseControl IO m) => Bool -> DAVT m a -> DAVT m aSource

withLockIfPossibleForDelete :: (MonadIO m, MonadBase IO m, MonadBaseControl IO m) => Bool -> DAVT m a -> DAVT m aSource

data Depth Source

Constructors

Depth0 |
Depth1 |
DepthInfinity |

Instances

Read Depth |
Show Depth |

data DAVContext Source

Constructors

DAVContext |

Fields

_allowedMethods :: [ByteString]
_baseRequest :: Request
_basicusername :: ByteString
_basicpassword :: ByteString
_complianceClasses :: [ByteString]
_depth :: Maybe Depth
_httpManager :: Manager
_lockToken :: Maybe ByteString
_userAgent :: ByteString

Instances

Monad m => MonadState DAVContext (DAVT m) |

userAgent :: Lens' DAVContext ByteString Source

lockToken :: Lens' DAVContext (Maybe ByteString)Source

httpManager :: Lens' DAVContext Manager Source

depth :: Lens' DAVContext (Maybe Depth)Source

complianceClasses :: Lens' DAVContext [ByteString]Source

basicusername :: Lens' DAVContext ByteString Source

basicpassword :: Lens' DAVContext ByteString Source

baseRequest :: Lens' DAVContext Request Source

allowedMethods :: Lens' DAVContext [ByteString]Source