applyCreatedToLocal :: FilePath -> Map Path RemoteFile -> File -> ApiAction Change
applyCreatedToLocal syncDir remoteFiles file =
    let
        createdPath = File.path file
        absoluteTargetFile = combine syncDir (filePath createdPath)
        remoteFile = Map.lookup createdPath remoteFiles
    in
        case remoteFile of
            Just r -> Created <$> download r absoluteTargetFile
            Nothing -> error $ "file to download not found: " ++ show createdPath
applyCreatedToLocal :: FilePath -> Map Path RemoteFile -> File -> ApiAction Change
applyCreatedToLocal syncDir remoteFiles file =
    let
        createdPath = File.path file
        absoluteTargetFile = combine syncDir (filePath createdPath)
        remoteFile = Map.lookup createdPath remoteFiles
    in
        case remoteFile of
            Just r -> Created <$> download r absoluteTargetFile
            Nothing -> error $ "file to download not found: " ++ show createdPath
applyCreatedToLocal syncDir remoteFiles file =
    let
        createdPath = File.path file
        absoluteTargetFile = combine syncDir (filePath createdPath)
        remoteFile = Map.lookup createdPath remoteFiles
    in
        case remoteFile of
            Just r -> Created <$> download r absoluteTargetFile
            Nothing -> error $ "file to download not found: " ++ show createdPath