DAV-1.3.4: RFC 4918 WebDAV support
Safe HaskellNone
LanguageHaskell98

Network.Protocol.HTTP.DAV

Synopsis

Documentation

newtype DAVT m a Source #

Constructors

DAVT 

Fields

Instances

Instances details
MonadTrans DAVT Source # 
Instance details

Defined in Network.Protocol.HTTP.DAV

Methods

lift :: Monad m => m a -> DAVT m a

Monad m => MonadError String (DAVT m) Source # 
Instance details

Defined in Network.Protocol.HTTP.DAV

Methods

throwError :: String -> DAVT m a

catchError :: DAVT m a -> (String -> DAVT m a) -> DAVT m a

Monad m => MonadState DAVContext (DAVT m) Source # 
Instance details

Defined in Network.Protocol.HTTP.DAV

Methods

get :: DAVT m DAVContext

put :: DAVContext -> DAVT m ()

state :: (DAVContext -> (a, DAVContext)) -> DAVT m a

MonadBase b m => MonadBase b (DAVT m) Source # 
Instance details

Defined in Network.Protocol.HTTP.DAV

Methods

liftBase :: b α -> DAVT m α Source #

Monad m => Monad (DAVT m) Source # 
Instance details

Defined in Network.Protocol.HTTP.DAV

Methods

(>>=) :: DAVT m a -> (a -> DAVT m b) -> DAVT m b

(>>) :: DAVT m a -> DAVT m b -> DAVT m b

return :: a -> DAVT m a

Functor m => Functor (DAVT m) Source # 
Instance details

Defined in Network.Protocol.HTTP.DAV

Methods

fmap :: (a -> b) -> DAVT m a -> DAVT m b

(<$) :: a -> DAVT m b -> DAVT m a

MonadFix m => MonadFix (DAVT m) Source # 
Instance details

Defined in Network.Protocol.HTTP.DAV

Methods

mfix :: (a -> DAVT m a) -> DAVT m a

Monad m => Applicative (DAVT m) Source # 
Instance details

Defined in Network.Protocol.HTTP.DAV

Methods

pure :: a -> DAVT m a

(<*>) :: DAVT m (a -> b) -> DAVT m a -> DAVT m b

liftA2 :: (a -> b -> c) -> DAVT m a -> DAVT m b -> DAVT m c

(*>) :: DAVT m a -> DAVT m b -> DAVT m b

(<*) :: DAVT m a -> DAVT m b -> DAVT m a

MonadThrow m => MonadThrow (DAVT m) Source # 
Instance details

Defined in Network.Protocol.HTTP.DAV

Methods

throwM :: Exception e => e -> DAVT m a Source #

MonadCatch m => MonadCatch (DAVT m) Source # 
Instance details

Defined in Network.Protocol.HTTP.DAV

Methods

catch :: Exception e => DAVT m a -> (e -> DAVT m a) -> DAVT m a Source #

Monad m => MonadPlus (DAVT m) Source # 
Instance details

Defined in Network.Protocol.HTTP.DAV

Methods

mzero :: DAVT m a

mplus :: DAVT m a -> DAVT m a -> DAVT m a

Monad m => Alternative (DAVT m) Source # 
Instance details

Defined in Network.Protocol.HTTP.DAV

Methods

empty :: DAVT m a

(<|>) :: DAVT m a -> DAVT m a -> DAVT m a

some :: DAVT m a -> DAVT m [a]

many :: DAVT m a -> DAVT m [a]

MonadIO m => MonadIO (DAVT m) Source # 
Instance details

Defined in Network.Protocol.HTTP.DAV

Methods

liftIO :: IO a -> DAVT m a

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

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

runDAVContext :: MonadIO m => DAVContext -> DAVT m a -> m (Either String a, DAVContext) 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 #

Instances

Instances details
Default DAVContext Source # 
Instance details

Defined in Network.Protocol.HTTP.DAV

Methods

def :: DAVContext #

Monad m => MonadState DAVContext (DAVT m) 
Instance details

Defined in Network.Protocol.HTTP.DAV

Methods

get :: DAVT m DAVContext

put :: DAVContext -> DAVT m ()

state :: (DAVContext -> (a, DAVContext)) -> DAVT m a

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 #

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 #

moveContentM :: MonadIO m => ByteString -> DAVT m () 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.

mkDAVContext :: MonadIO m => DAVURL -> m DAVContext Source #

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

Deprecated: deprecated because http-client deprecated closeManager

data Depth Source #

Constructors

Depth0 
Depth1 
DepthInfinity 

Instances

Instances details
Read Depth Source # 
Instance details

Defined in Network.Protocol.HTTP.DAV.TH

Methods

readsPrec :: Int -> ReadS Depth

readList :: ReadS [Depth]

readPrec :: ReadPrec Depth

readListPrec :: ReadPrec [Depth]

Show Depth Source # 
Instance details

Defined in Network.Protocol.HTTP.DAV.TH

Methods

showsPrec :: Int -> Depth -> ShowS

show :: Depth -> String

showList :: [Depth] -> ShowS

data DAVContext Source #

Instances

Instances details
Default DAVContext Source # 
Instance details

Defined in Network.Protocol.HTTP.DAV

Methods

def :: DAVContext #

Monad m => MonadState DAVContext (DAVT m) 
Instance details

Defined in Network.Protocol.HTTP.DAV

Methods

get :: DAVT m DAVContext

put :: DAVContext -> DAVT m ()

state :: (DAVContext -> (a, DAVContext)) -> DAVT m a

Orphan instances

Default DAVContext Source # 
Instance details

Methods

def :: DAVContext #