checkAndDownload :: WebDAVConfig -> WebDAVRemoteDir -> FilePath -> MaybeT IO ()
checkAndDownload cfg rdir fpath = do
    b <- liftIO $ doesFileExistInDAV cfg rdir fpath
    guard b
    liftIO $ downloadFile False cfg rdir fpath 
    liftIO $ putStrLn $ fpath ++ " is successfully downloaded"

{- 
main :: IO ()
main = do 
  print $   combine [("ttest",1,2,3,4,5,[(100,33),(200,34)])
                    ,("ttest2",1,2,3,4,5,[(100,47),(200,39)]) ]
-}
checkAndDownload :: WebDAVConfig -> WebDAVRemoteDir -> FilePath -> MaybeT IO ()
checkAndDownload cfg rdir fpath = do
    b <- liftIO $ doesFileExistInDAV cfg rdir fpath
    guard b
    liftIO $ downloadFile False cfg rdir fpath 
    liftIO $ putStrLn $ fpath ++ " is successfully downloaded"

{- 
main :: IO ()
main = do 
  print $   combine [("ttest",1,2,3,4,5,[(100,33),(200,34)])
                    ,("ttest2",1,2,3,4,5,[(100,47),(200,39)]) ]
-}
checkAndDownload cfg rdir fpath = do
    b <- liftIO $ doesFileExistInDAV cfg rdir fpath
    guard b
    liftIO $ downloadFile False cfg rdir fpath 
    liftIO $ putStrLn $ fpath ++ " is successfully downloaded"

{- 
main :: IO ()
main = do 
  print $   combine [("ttest",1,2,3,4,5,[(100,33),(200,34)])
                    ,("ttest2",1,2,3,4,5,[(100,47),(200,39)]) ]
-}