DAV-1.3: RFC 4918 WebDAV support

Safe HaskellNone
LanguageHaskell98

Network.Protocol.HTTP.DAV

Synopsis

Documentation

newtype DAVT m a Source

Constructors

DAVT 

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

withDAVContext :: MonadIO m => DAVURL -> (DAVContext -> m a) -> m a Source

caldavReportM :: MonadIO m => DAVT m Document Source

getPropsM :: MonadIO m => DAVT m Document Source

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

Note that the entire request body is buffered in memory. To stream large files use withContentM instead.

withContentM :: MonadIO m => (Response BodyReader -> IO a) -> DAVT m a Source

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

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

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

Note that the entire request body is buffered in memory; not suitable for large files.

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

To send a large file, pass eg a RequestBodyStream containing the file's content.

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

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

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

Normally, DAVT actions act on the url that is provided to eg, evalDAVT. Sometimes, it's useful to adjust the url that is acted on, while remaining in the same DAV session.

inLocation temporarily adjusts the url's path, while performing a DAVT action.

For example:

import System.FilePath.Posix -- posix for url path manipulation

mkColRecursive d = do
  let parent = takeDirectory d
  when (parent /= d) $
    mkColRecursive parent
  inDAVLocation (</> d) mkCol

Note that operations that modify the DAVContext (such as setCreds and setCreds) can be run inside davLocation, but will not have any effect on the calling DAVContext.

getDAVLocation :: Monad m => DAVT m String Source

Gets the path of the url that DAVT actions will act on.

closeDAVContext :: MonadIO m => DAVContext -> m () Source

Deprecated: deprecated because http-client deprecated closeManager

httpManager :: Lens' DAVContext (Maybe Manager) Source

baseRequest :: Lens' DAVContext Request Source