Safe Haskell | None |
---|---|
Language | Haskell2010 |
This module provides an wrapper API around the file system which does some caching.
- data Provider
- newProvider :: Store -> (FilePath -> IO Bool) -> FilePath -> IO Provider
- resourceList :: Provider -> [Identifier]
- resourceExists :: Provider -> Identifier -> Bool
- resourceFilePath :: Provider -> Identifier -> FilePath
- resourceModified :: Provider -> Identifier -> Bool
- resourceModificationTime :: Provider -> Identifier -> UTCTime
- resourceString :: Provider -> Identifier -> IO String
- resourceLBS :: Provider -> Identifier -> IO ByteString
- resourceMetadata :: Provider -> Identifier -> IO Metadata
- resourceBody :: Provider -> Identifier -> IO String
Constructing resource providers
:: Store | Store to use |
-> (FilePath -> IO Bool) | Should we ignore this file? |
-> FilePath | Search directory |
-> IO Provider | Resulting provider |
Create a resource provider
Querying resource properties
resourceList :: Provider -> [Identifier] Source #
resourceExists :: Provider -> Identifier -> Bool Source #
Check if a given resource exists
resourceFilePath :: Provider -> Identifier -> FilePath Source #
resourceModified :: Provider -> Identifier -> Bool Source #
A resource is modified if it or its metadata has changed
resourceModificationTime :: Provider -> Identifier -> UTCTime Source #
Access to raw resource content
resourceString :: Provider -> Identifier -> IO String Source #
Get the raw body of a resource as string
resourceLBS :: Provider -> Identifier -> IO ByteString Source #
Get the raw body of a resource of a lazy bytestring
Access to metadata and body content
resourceMetadata :: Provider -> Identifier -> IO Metadata Source #
resourceBody :: Provider -> Identifier -> IO String Source #