text:
NSString const *OCWebDAVContentTypeKey		= @"getcontenttype";
NSString const *OCWebDAVETagKey				= @"getetag";
NSString const *OCWebDAVCTagKey				= @"getctag";
NSString const *OCWebDAVCreationDateKey		= @"creationdate";
NSString const *OCWebDAVModificationDateKey	= @"modificationdate";

@interface OCWebDAVClient()

- (void)mr_listPath:(NSString *)path depth:(NSUInteger)depth onCommunication:
(OCCommunication *)sharedOCCommunication
            success:(void(^)(NSHTTPURLResponse *, id))success
            failure:(void(^)(NSHTTPURLResponse *, id  _Nullable responseObject, NSError *))failure;

@end

@implementation OCWebDAVClient

- (id) init {

    self = [super init];

    if (self != nil) {
        self.defaultHeaders = [NSMutableDictionary new];
    }

    return self;
}

- (void)setAuthorizationHeaderWithUsername:(NSString *)username password:(NSString *)password {
	NSString *basicAuthCredentials = [NSString stringWithFormat:@"%@:%@", username, password];

    [self.defaultHeaders setObject:[NSString stringWithFormat:@"Basic %@", [UtilsFramework AFBase64EncodedStringFromString: basicAuthCredentials]] forKey:@"Authorization"];
}

- (void)setAuthorizationHeaderWithCookie:(NSString *) cookieString {
    [self.defaultHeaders setObject:cookieString forKey:@"Cookie"];
}

- (void)setAuthorizationHeaderWithToken:(NSString *)token {
    [self.defaultHeaders setObject:token forKey:@"Authorization"];
}

- (void)setDefaultHeader:(NSString *)header value:(NSString *)value {
    [self.defaultHeaders setObject:value forKey:header];
}

- (void)setUserAgent:(NSString *)userAgent{
    [self.defaultHeaders setObject:userAgent forKey:@"User-Agent"];
}

#pragma mark - Main network operation token

- (NSURLSessionDataTask *)mr_operationWithRequest:(NSMutableURLRequest *)request
                            retryingNumberOfTimes:(NSInteger)ntimes
                                  onCommunication:(OCCommunication *)sharedOCCommunication
                             withUserSessionToken:(NSString*)token success:(void(^)(NSHTTPURLResponse *operation, id response, NSString *token))success failure:(void(^)(NSHTTPURLResponse *operation, id  _Nullable responseObject, NSError *error, NSString *token))failure {

    //If is not nil is a redirection so we keep the original url server
    if (!self.originalUrlServer) {
        self.originalUrlServer = [request.URL absoluteString];
    }

    NSLog(@"Before adding cookies, Main Request with token");
//    NSLog(@"Before adding cookies, Main Request with token for userId:%@ username:%@ url:%@  headers-> %@ ",sharedOCCommunication.credDto.userId, sharedOCCommunication.credDto.userName,request.URL, request.allHTTPHeaderFields);

    if (sharedOCCommunication.isCookiesAvailable) {
        //We add the cookies of that URL
        request = [UtilsFramework getRequestWithCookiesByRequest:request andOriginalUrlServer:self.originalUrlServer];
    } else {
        [UtilsFramework deleteAllCookies];
    }

    //NSLog(@"Main Request with token for userId:%@ username:%@ url:%@  headers-> %@ ",sharedOCCommunication.credDto.userId, sharedOCCommunication.credDto.userName,request.URL, request.allHTTPHeaderFields);

    __block   NSURLSessionDataTask *sessionDataTask;

    sessionDataTask = [sharedOCCommunication.networkSessionManager dataTaskWithRequest:request completionHandler:^(NSURLResponse * _Nonnull response, id  _Nullable responseObject, NSError * _Nullable error) {
        if (!error) {
            success((NSHTTPURLResponse*)response,responseObject, token);
        } else {
            if (((NSHTTPURLResponse*)response).statusCode == 401
                && sharedOCCommunication.credDto.authenticationMethod == AuthenticationMethodBEARER_TOKEN
                && sharedOCCommunication.credDto.userId != nil) {
                if (ntimes <= 0) {
                    if (failure) {
                        failure((NSHTTPURLResponse*)response, responseObject, error, token);
                    }
                } else {

                    //get refresh token
                    OCOAuth2Manager* oAuth2Manager = [OCOAuth2Manager new];
                    oAuth2Manager.trustedCertificatesStore = sharedOCCommunication.trustedCertificatesStore;
                    [oAuth2Manager refreshAuthDataByOAuth2Configuration:sharedOCCommunication.oauth2Configuration
                                                          withBaseURL:sharedOCCommunication.credDto.baseURL
                                                         refreshToken:sharedOCCommunication.credDto.refreshToken
                                                            userAgent:sharedOCCommunication.userAgent
                                              success:^(OCCredentialsDto *userCredDto) {

                                                  //set and store new credentials

                                                  userCredDto.userId = sharedOCCommunication.credDto.userId;
                                                  userCredDto.baseURL = sharedOCCommunication.credDto.baseURL;
                                                  userCredDto.userDisplayName = sharedOCCommunication.credDto.userDisplayName;
                                                  [sharedOCCommunication setCredentials:userCredDto];

                                                  [request setValue:[NSString stringWithFormat:@"Bearer %@", userCredDto.accessToken] forHTTPHeaderField:@"Authorization"];

                                                  if (sharedOCCommunication.credentialsStorage != nil) {
                                                      [sharedOCCommunication.credentialsStorage saveCredentials:sharedOCCommunication.credDto];
                                                  }

                                                  sessionDataTask = [self mr_operationWithRequest:request
                                                                            retryingNumberOfTimes:(ntimes -1)
                                                                onCommunication:sharedOCCommunication
                                                           withUserSessionToken:token
                                                                        success:success
                                                                        failure:failure
                                                   ];
                                                  [self setRedirectionBlockOnDatataskWithOCCommunication:sharedOCCommunication andSessionManager:sharedOCCommunication.networkSessionManager];
                                                  [sessionDataTask resume];

                                              } failure:^(NSError *error) {
                                                  failure(nil, nil, error, nil);

                                              }];
                }
            } else {
                failure((NSHTTPURLResponse*)response, responseObject, error, token);
            }
        }
    }];

    return sessionDataTask;
}

- (NSURLSessionDataTask *)mr_operationWithRequest:(NSMutableURLRequest *)request
                                  taskDescription:(NSString *)taskDescription
                            retryingNumberOfTimes:(NSInteger)ntimes
                                  onCommunication:(OCCommunication *)sharedOCCommunication
                                          success:(void(^)(NSHTTPURLResponse *, id))success
                                          failure:(void(^)(NSHTTPURLResponse *, id  _Nullable responseObject, NSError *))failure {

    //If is not nil is a redirection so we keep the original url server
    if (!self.originalUrlServer) {
        self.originalUrlServer = [request.URL absoluteString];
    }

    NSLog(@"Before adding cookies");
    //NSLog(@"Before adding cookies, Request for userId:%@ username:%@ url:%@ headers-> %@ ",sharedOCCommunication.credDto.userId, sharedOCCommunication.credDto.userName,request.URL, request.allHTTPHeaderFields);

    if (sharedOCCommunication.isCookiesAvailable) {
        //We add the cookies of that URL
        request = [UtilsFramework getRequestWithCookiesByRequest:request andOriginalUrlServer:self.originalUrlServer];
    } else {
        [UtilsFramework deleteAllCookies];
    }

    NSLog(@"Request for userId:%@ username:%@ url:%@ headers-> %@ ",sharedOCCommunication.credDto.userId, sharedOCCommunication.credDto.userName,request.URL, request.allHTTPHeaderFields);

    __block NSURLSessionDataTask *sessionDataTask;

    sessionDataTask = [sharedOCCommunication.networkSessionManager dataTaskWithRequest:request completionHandler:^(NSURLResponse * _Nonnull response, id  _Nullable responseObject, NSError * _Nullable error) {
        if (!error) {
            success((NSHTTPURLResponse*)response,responseObject);
        } else {

            if (((NSHTTPURLResponse*)response).statusCode == 401
                && sharedOCCommunication.credDto.authenticationMethod == AuthenticationMethodBEARER_TOKEN
                && sharedOCCommunication.credDto.userId != nil) {
                if (ntimes <= 0) {
                    if (failure) {
                        failure((NSHTTPURLResponse*)response, responseObject, error);
                    }
                } else {

                    //get refresh token
                    OCOAuth2Manager* oAuth2Manager = [OCOAuth2Manager new];
                    oAuth2Manager.trustedCertificatesStore = sharedOCCommunication.trustedCertificatesStore;
                    [oAuth2Manager refreshAuthDataByOAuth2Configuration:sharedOCCommunication.oauth2Configuration
                                                            withBaseURL:sharedOCCommunication.credDto.baseURL
                                                           refreshToken:sharedOCCommunication.credDto.refreshToken
                                                              userAgent:sharedOCCommunication.userAgent
                                                                success:^(OCCredentialsDto *userCredDto) {

                                                                    //set and store new credentials

                                                                    userCredDto.userId = sharedOCCommunication.credDto.userId;
                                                                    userCredDto.baseURL = sharedOCCommunication.credDto.baseURL;
                                                                    userCredDto.userDisplayName = sharedOCCommunication.credDto.userDisplayName;
                                                                    [sharedOCCommunication setCredentials:userCredDto];
                                                                    [request setValue:[NSString stringWithFormat:@"Bearer %@", userCredDto.accessToken] forHTTPHeaderField:@"Authorization"];

                                                                    if (sharedOCCommunication.credentialsStorage != nil) {
                                                                        [sharedOCCommunication.credentialsStorage saveCredentials:sharedOCCommunication.credDto];
                                                                    }

                                                                    sessionDataTask = [self mr_operationWithRequest:request
                                                                                taskDescription:taskDescription
                                                                                retryingNumberOfTimes:(ntimes - 1)
                                                                                onCommunication:sharedOCCommunication
                                                                                success:success
                                                                                failure:failure
                                                                                ];
                                                                    if (taskDescription) {
                                                                        [sessionDataTask setTaskDescription:[[NSString alloc] initWithString:taskDescription]];
                                                                    }
                                                                    [self setRedirectionBlockOnDatataskWithOCCommunication:sharedOCCommunication andSessionManager:sharedOCCommunication.networkSessionManager];
                                                                    [sessionDataTask resume];

                                                                } failure:^(NSError *error) {
                                                                    failure(nil,nil,error);
                                                                }];
                }
            } else {
                failure((NSHTTPURLResponse*)response, responseObject, error);

            }
        }
    }];

    if (taskDescription) {
        [sessionDataTask setTaskDescription:[[NSString alloc] initWithString:taskDescription]];
    }

    return sessionDataTask;
}

#pragma mark - Main network operation
- (NSURLSessionDataTask *)mr_operationWithRequest:(NSMutableURLRequest *)request
                            retryingNumberOfTimes:(NSInteger)ntimes
                                  onCommunication:(OCCommunication *)sharedOCCommunication
                                          success:(void(^)(NSHTTPURLResponse *, id))success
                                          failure:(void(^)(NSHTTPURLResponse *, id  _Nullable responseObject, NSError *))failure {

    //If is not nil is a redirection so we keep the original url server
    if (!self.originalUrlServer) {
        self.originalUrlServer = [request.URL absoluteString];
    }

    NSLog(@"Before adding cookies");
    //NSLog(@"Before adding cookies, Request for userId:%@ username:%@ url:%@ headers-> %@ ",sharedOCCommunication.credDto.userId, sharedOCCommunication.credDto.userName,request.URL, request.allHTTPHeaderFields);

    if (sharedOCCommunication.isCookiesAvailable) {
        //We add the cookies of that URL
        request = [UtilsFramework getRequestWithCookiesByRequest:request andOriginalUrlServer:self.originalUrlServer];
    } else {
        [UtilsFramework deleteAllCookies];
    }

    NSLog(@"Request for userId:%@ username:%@ url:%@ headers-> %@ ",sharedOCCommunication.credDto.userId, sharedOCCommunication.credDto.userName,request.URL, request.allHTTPHeaderFields);

    __block NSURLSessionDataTask *sessionDataTask;

    sessionDataTask = [sharedOCCommunication.networkSessionManager dataTaskWithRequest:request completionHandler:^(NSURLResponse * _Nonnull response, id  _Nullable responseObject, NSError * _Nullable error) {
        if (!error) {
            success((NSHTTPURLResponse*)response,responseObject);
        } else {

            if (((NSHTTPURLResponse*)response).statusCode == 401
                && sharedOCCommunication.credDto.authenticationMethod == AuthenticationMethodBEARER_TOKEN
                && sharedOCCommunication.credDto.userId != nil) {
                if (ntimes <= 0) {
                    if (failure) {
                        failure((NSHTTPURLResponse*)response, responseObject, error);
                    }
                } else {

                    //get refresh token
                    OCOAuth2Manager* oAuth2Manager = [OCOAuth2Manager new];
                    oAuth2Manager.trustedCertificatesStore = sharedOCCommunication.trustedCertificatesStore;
                    [oAuth2Manager refreshAuthDataByOAuth2Configuration:sharedOCCommunication.oauth2Configuration
                                                          withBaseURL:sharedOCCommunication.credDto.baseURL
                                                         refreshToken:sharedOCCommunication.credDto.refreshToken
                                                            userAgent:sharedOCCommunication.userAgent
                    success:^(OCCredentialsDto *userCredDto) {

                        //set and store new credentials

                        userCredDto.userId = sharedOCCommunication.credDto.userId;
                        userCredDto.baseURL = sharedOCCommunication.credDto.baseURL;
                        userCredDto.userDisplayName = sharedOCCommunication.credDto.userDisplayName;
                        [sharedOCCommunication setCredentials:userCredDto];
                        [request setValue:[NSString stringWithFormat:@"Bearer %@", userCredDto.accessToken] forHTTPHeaderField:@"Authorization"];

                        if (sharedOCCommunication.credentialsStorage != nil) {
                            [sharedOCCommunication.credentialsStorage saveCredentials:sharedOCCommunication.credDto];
                        }

                        sessionDataTask = [self mr_operationWithRequest:request retryingNumberOfTimes:(ntimes - 1)
                                      onCommunication:sharedOCCommunication
                                              success:success
                                              failure:failure
                        ];
                        [self setRedirectionBlockOnDatataskWithOCCommunication:sharedOCCommunication andSessionManager:sharedOCCommunication.networkSessionManager];
                        [sessionDataTask resume];

                    } failure:^(NSError *error) {
                        failure(nil,nil,error);
                    }];
                }
            } else {
                failure((NSHTTPURLResponse*)response, responseObject, error);

            }
        }
    }];

    return sessionDataTask;
}

- (NSMutableURLRequest *)requestWithMethod:(NSString *)method path:(NSString *)path parameters:(NSDictionary *)parameters {

    NSMutableURLRequest *request = [[AFHTTPRequestSerializer new] requestWithMethod:method URLString:path parameters:nil error:nil];
    [request setAllHTTPHeaderFields:self.defaultHeaders];

    [request setCachePolicy: NSURLRequestReloadIgnoringLocalCacheData];
    [request setTimeoutInterval: k_timeout_webdav];

    return request;
}

- (NSMutableURLRequest *)sharedRequestWithMethod:(NSString *)method path:(NSString *)path parameters:(NSDictionary *)parameters {

    NSMutableURLRequest *request = [[AFHTTPRequestSerializer new] requestWithMethod:method URLString:path parameters:nil error:nil];

    [request setAllHTTPHeaderFields:self.defaultHeaders];

    //NSMutableURLRequest *request = [super requestWithMethod:method path:path parameters:parameters];
    [request setCachePolicy: NSURLRequestReloadIgnoringLocalCacheData];
    [request setTimeoutInterval: k_timeout_webdav];
    //Header for use the OC API CALL
    NSString *ocs_apiquests = @"true";
    [request setValue:ocs_apiquests forHTTPHeaderField:k_api_header_request];
    [request setValue:@"application/x-www-form-urlencoded" forHTTPHeaderField:@"Content-Type"];
    [request addValue:@"gzip, deflate" forHTTPHeaderField:@"Accept-Encoding"];

    return request;
}

- (void)movePath:(NSString *)source toPath:(NSString *)destination
 onCommunication:(OCCommunication *)sharedOCCommunication
         success:(void(^)(NSHTTPURLResponse *, id))success
         failure:(void(^)(NSHTTPURLResponse *, id  _Nullable responseObject, NSError *))failure {
    _requestMethod = @"MOVE";
    NSMutableURLRequest *request = [self requestWithMethod:_requestMethod path:source parameters:nil];
    [request setValue:destination forHTTPHeaderField:@"Destination"];
	[request setValue:@"T" forHTTPHeaderField:@"Overwrite"];
	NSURLSessionDataTask *sessionDataTask = [self mr_operationWithRequest:request retryingNumberOfTimes:k_retry_ntimes onCommunication:sharedOCCommunication success:success failure:failure];
    [self setRedirectionBlockOnDatataskWithOCCommunication:sharedOCCommunication andSessionManager:sharedOCCommunication.networkSessionManager];
    [sessionDataTask resume];
}

- (void)deletePath:(NSString *)path
   onCommunication:(OCCommunication *)sharedOCCommunication
           success:(void(^)(NSHTTPURLResponse *, id))success
           failure:(void(^)(NSHTTPURLResponse *, id  _Nullable responseObject, NSError *))failure {

    _requestMethod = @"DELETE";
    NSMutableURLRequest *request = [self requestWithMethod:_requestMethod path:path parameters:nil];
	NSURLSessionDataTask *sessionDataTask = [self mr_operationWithRequest:request retryingNumberOfTimes:k_retry_ntimes onCommunication:sharedOCCommunication success:success failure:failure];
    [self setRedirectionBlockOnDatataskWithOCCommunication:sharedOCCommunication andSessionManager:sharedOCCommunication.networkSessionManager];
    [sessionDataTask resume];
}

- (void)mr_listPath:(NSString *)path depth:(NSUInteger)depth onCommunication:
(OCCommunication *)sharedOCCommunication
            success:(void(^)(NSHTTPURLResponse *, id))success
            failure:(void(^)(NSHTTPURLResponse *, id  _Nullable responseObject, NSError *))failure {
	NSParameterAssert(success);

    _requestMethod = @"PROPFIND";
	NSMutableURLRequest *request = [self requestWithMethod:_requestMethod path:path parameters:nil];
	NSString *depthHeader = nil;
	if (depth <= 0)
		depthHeader = @"0";
	else if (depth == 1)
		depthHeader = @"1";
	else
		depthHeader = @"infinity";
    [request setValue: depthHeader forHTTPHeaderField: @"Depth"];

    [request setHTTPBody:[@"<?xml version=\"1.0\" encoding=\"UTF-8\"?><D:propfind xmlns:D=\"DAV:\"><D:prop><D:resourcetype/><D:getlastmodified/><size xmlns=\"http://owncloud.org/ns\"/><D:creationdate/><fileid xmlns=\"http://owncloud.org/ns\"/><D:getcontentlength/><D:displayname/><D:quota-available-bytes/><D:getetag/><permissions xmlns=\"http://owncloud.org/ns\"/><D:quota-used-bytes/><D:getcontenttype/><privatelink xmlns=\"http://owncloud.org/ns\"/></D:prop></D:propfind>" dataUsingEncoding:NSUTF8StringEncoding]];
    [request setValue:@"application/xml" forHTTPHeaderField:@"Content-Type"];

    NSURLSessionDataTask *sessionDataTask = [self mr_operationWithRequest:request retryingNumberOfTimes:k_retry_ntimes onCommunication:sharedOCCommunication success:success failure:failure];
    [self setRedirectionBlockOnDatataskWithOCCommunication:sharedOCCommunication andSessionManager:sharedOCCommunication.networkSessionManager];
    [sessionDataTask resume];
}

- (void)mr_listPath:(NSString *)path depth:(NSUInteger)depth withUserSessionToken:(NSString*)token onCommunication:
(OCCommunication *)sharedOCCommunication
            success:(void(^)(NSHTTPURLResponse *operation, id response, NSString *token))success
            failure:(void(^)(NSHTTPURLResponse *response, id  _Nullable responseObject, NSError *, NSString *token))failure {
    NSParameterAssert(success);

    _requestMethod = @"PROPFIND";
    NSMutableURLRequest *request = [self requestWithMethod:_requestMethod path:path parameters:nil];
    NSString *depthHeader = nil;
    if (depth <= 0)
        depthHeader = @"0";
    else if (depth == 1)
        depthHeader = @"1";
    else
        depthHeader = @"infinity";
    [request setValue: depthHeader forHTTPHeaderField: @"Depth"];

    [request setHTTPBody:[@"<?xml version=\"1.0\" encoding=\"UTF-8\"?><D:propfind xmlns:D=\"DAV:\"><D:prop><D:resourcetype/><D:getlastmodified/><size xmlns=\"http://owncloud.org/ns\"/><D:creationdate/><fileid xmlns=\"http://owncloud.org/ns\"/><D:getcontentlength/><D:displayname/><D:quota-available-bytes/><D:getetag/><permissions xmlns=\"http://owncloud.org/ns\"/><D:quota-used-bytes/><D:getcontenttype/><privatelink xmlns=\"http://owncloud.org/ns\"/></D:prop></D:propfind>" dataUsingEncoding:NSUTF8StringEncoding]];
    [request setValue:@"application/xml" forHTTPHeaderField:@"Content-Type"];

    NSURLSessionDataTask *sessionDataTask = [self mr_operationWithRequest:request retryingNumberOfTimes:k_retry_ntimes onCommunication:sharedOCCommunication withUserSessionToken:token success:success failure:failure];
    [self setRedirectionBlockOnDatataskWithOCCommunication:sharedOCCommunication andSessionManager:sharedOCCommunication.networkSessionManager];
    [sessionDataTask resume];
}

- (void)propertiesOfPath:(NSString *)path
         onCommunication: (OCCommunication *)sharedOCCommunication
                 success:(void(^)(NSHTTPURLResponse *, id ))success
                 failure:(void(^)(NSHTTPURLResponse *, id  _Nullable responseObject, NSError *))failure {
	[self mr_listPath:path depth:0 onCommunication:sharedOCCommunication success:success failure:failure];
}

- (void)listPath:(NSString *)path
 onCommunication:(OCCommunication *)sharedOCCommunication
         success:(void(^)(NSHTTPURLResponse *, id))success
         failure:(void(^)(NSHTTPURLResponse *, id  _Nullable responseObject, NSError *))failure {
	[self mr_listPath:path depth:1 onCommunication:sharedOCCommunication success:success failure:failure];
}

- (void)listPath:(NSString *)path
 onCommunication:(OCCommunication *)sharedOCCommunication withUserSessionToken:(NSString *)token
         success:(void(^)(NSHTTPURLResponse *, id, NSString *token))success
         failure:(void(^)(NSHTTPURLResponse *, id  _Nullable responseObject, NSError *, NSString *token))failure {
    [self mr_listPath:path depth:1 withUserSessionToken:token onCommunication:sharedOCCommunication success:success failure:failure];
}

#pragma mark - download requests

- (NSURLSessionDownloadTask *)downloadTaskWithRequest:(NSMutableURLRequest *)request
                                               toPath:(NSString *)localDestination
                                      defaultPriority:(BOOL)defaultPriority
                                retryingNumberOfTimes:(NSInteger)ntimes
                                      onCommunication:(OCCommunication *)sharedOCCommunication
                                             progress:(void(^)(NSProgress *progress))downloadProgress
                                              success:(void(^)(NSURLResponse *response, NSURL *filePath))success failure:(void(^)(NSURLResponse *response, NSError *error))failure {

    NSURL *localDestinationUrl = [NSURL fileURLWithPath:localDestination];

    __block NSURLSessionDownloadTask *downloadTask = [sharedOCCommunication.downloadSessionManager downloadTaskWithRequest:request progress:^(NSProgress * _Nonnull progress) {
        downloadProgress(progress);
    } destination:^NSURL * _Nonnull(NSURL * _Nonnull targetPath, NSURLResponse * _Nonnull response) {

        if (((NSHTTPURLResponse*)response).statusCode == 401) {
            return nil;
        } else {
            return localDestinationUrl;
        }
    } completionHandler:^(NSURLResponse * _Nonnull response, NSURL * _Nullable filePath, NSError * _Nullable error) {

        if (!error) {
            success(response,filePath);
        } else {
            if (((NSHTTPURLResponse*)response).statusCode == 401
                && sharedOCCommunication.credDto.authenticationMethod == AuthenticationMethodBEARER_TOKEN
                && sharedOCCommunication.credDto.userId != nil) {
                if (ntimes <= 0) {
                    if (failure) {
                        failure(response, error);
                    }
                } else {
                    //get refresh token
                    OCOAuth2Manager* oAuth2Manager = [OCOAuth2Manager new];
                    oAuth2Manager.trustedCertificatesStore = sharedOCCommunication.trustedCertificatesStore;
                    [oAuth2Manager refreshAuthDataByOAuth2Configuration:sharedOCCommunication.oauth2Configuration
                                                          withBaseURL:sharedOCCommunication.credDto.baseURL
                                                         refreshToken:sharedOCCommunication.credDto.refreshToken
                                                            userAgent:sharedOCCommunication.userAgent
                    success:^(OCCredentialsDto *userCredDto) {

                        //set and store new credentials

                        userCredDto.userId = sharedOCCommunication.credDto.userId;
                        userCredDto.baseURL = sharedOCCommunication.credDto.baseURL;
                        userCredDto.userDisplayName = sharedOCCommunication.credDto.userDisplayName;
                        [sharedOCCommunication setCredentials:userCredDto];

                        [request setValue:[NSString stringWithFormat:@"Bearer %@", userCredDto.accessToken] forHTTPHeaderField:@"Authorization"];

                        if (sharedOCCommunication.credentialsStorage != nil) {
                            [sharedOCCommunication.credentialsStorage saveCredentials:sharedOCCommunication.credDto];
                        }

                        downloadTask = [self downloadTaskWithRequest:request
                                                              toPath:localDestination
                                                     defaultPriority:defaultPriority
                                               retryingNumberOfTimes:(ntimes -1)
                                                     onCommunication:sharedOCCommunication
                                                            progress:downloadProgress
                                                             success:success
                                                             failure:failure];

                        [self setRedirectionBlockOnDatataskWithOCCommunication:sharedOCCommunication andSessionManager:sharedOCCommunication.downloadSessionManager];
                        [downloadTask resume];

                    } failure:^(NSError *error) {
                        failure(response, error);
                    }];
                }

            } else {
                failure(response, error);
            }
        }
    }];

    return downloadTask;
}

- (NSURLSessionDownloadTask *)downloadWithSessionPath:(NSString *)remoteSource
                                               toPath:(NSString *)localDestination
                                      defaultPriority:(BOOL)defaultPriority
                                      onCommunication:(OCCommunication *)sharedOCCommunication
                                             progress:(void(^)(NSProgress *progress))downloadProgress
                                              success:(void(^)(NSURLResponse *response, NSURL *filePath))success
                                              failure:(void(^)(NSURLResponse *response, NSError *error))failure {

    NSMutableURLRequest *request = [self requestWithMethod:@"GET" path:remoteSource parameters:nil];

    //If is not nil is a redirection so we keep the original url server
    if (!self.originalUrlServer) {
        self.originalUrlServer = [request.URL absoluteString];
    }

    //We add the cookies of that URL
    request = [UtilsFramework getRequestWithCookiesByRequest:request andOriginalUrlServer:self.originalUrlServer];

    NSURLSessionDownloadTask *downloadTask = [self downloadTaskWithRequest:request
                                                                    toPath:localDestination
                                                           defaultPriority:defaultPriority
                                                     retryingNumberOfTimes:k_retry_ntimes
                                                           onCommunication:sharedOCCommunication
                                                                  progress:downloadProgress
                                                                   success:success
                                                                   failure:failure];

    [self setRedirectionBlockOnDatataskWithOCCommunication:sharedOCCommunication andSessionManager:sharedOCCommunication.downloadSessionManager];

    if (defaultPriority) {
         [downloadTask resume];
    }

    return downloadTask;
}

- (void)makeCollection:(NSString *)path onCommunication:
(OCCommunication *)sharedOCCommunication
               success:(void(^)(NSHTTPURLResponse *, id))success
               failure:(void(^)(NSHTTPURLResponse *, id  _Nullable responseObject, NSError *))failure {
    _requestMethod = @"MKCOL";
	NSMutableURLRequest *request = [self requestWithMethod:_requestMethod path:path parameters:nil];
    NSURLSessionDataTask *sessionDataTask = [self mr_operationWithRequest:request retryingNumberOfTimes:k_retry_ntimes onCommunication:sharedOCCommunication success:success failure:failure];
    [self setRedirectionBlockOnDatataskWithOCCommunication:sharedOCCommunication andSessionManager:sharedOCCommunication.networkSessionManager];
    [sessionDataTask resume];
}

#pragma mark - upload requests

- (NSURLSessionUploadTask *)uploadTaskWithRequest:(NSMutableURLRequest *)request
                                      fromFileURL:(NSURL *)fileURL
                            retryingNumberOfTimes:(NSInteger)ntimes
                                  onCommunication:(OCCommunication *)sharedOCCommunication
                                         progress:(void(^)(NSProgress *progress))uploadProgress
                                          success:(void(^)(NSURLResponse *, NSString *))success
                                          failure:(void(^)(NSURLResponse *, id, NSError *))failure {

    __block NSURLSessionUploadTask *uploadTask = [sharedOCCommunication.uploadSessionManager uploadTaskWithRequest:request fromFile:fileURL progress:^(NSProgress * _Nonnull progress) {
        uploadProgress(progress);
    } completionHandler:^(NSURLResponse * _Nonnull response, id  _Nullable responseObject, NSError * _Nullable error) {
        if (!error) {
            success(response,responseObject);
        } else {
            if ( ((NSHTTPURLResponse*)response).statusCode == 401
                && sharedOCCommunication.credDto.authenticationMethod == AuthenticationMethodBEARER_TOKEN
                && sharedOCCommunication.credDto.userId != nil){
                if (ntimes <= 0) {
                    if (failure) {
                        failure(response, responseObject, error);
                    }
                } else {
                    //get refresh token
                    OCOAuth2Manager* oAuth2Manager = [OCOAuth2Manager new];
                    oAuth2Manager.trustedCertificatesStore = sharedOCCommunication.trustedCertificatesStore;
                    [oAuth2Manager refreshAuthDataByOAuth2Configuration:sharedOCCommunication.oauth2Configuration
                                                          withBaseURL:sharedOCCommunication.credDto.baseURL
                                                         refreshToken:sharedOCCommunication.credDto.refreshToken
                                                            userAgent:sharedOCCommunication.userAgent
                                                              success:^(OCCredentialsDto *userCredDto) {

                                                                  //set and store new credentials

                                                                  userCredDto.userId = sharedOCCommunication.credDto.userId;
                                                                  userCredDto.baseURL = sharedOCCommunication.credDto.baseURL;
                                                                  userCredDto.userDisplayName = sharedOCCommunication.credDto.userDisplayName;
                                                                  [sharedOCCommunication setCredentials:userCredDto];

                                                                  [request setValue:[NSString stringWithFormat:@"Bearer %@", userCredDto.accessToken] forHTTPHeaderField:@"Authorization"];

                                                                  if (sharedOCCommunication.credentialsStorage != nil) {
                                                                      [sharedOCCommunication.credentialsStorage saveCredentials:sharedOCCommunication.credDto];
                                                                  }

                                                                  uploadTask = [self uploadTaskWithRequest:request
                                                                                fromFileURL:fileURL
                                                                                retryingNumberOfTimes:(ntimes -1)
                                                                                onCommunication:sharedOCCommunication
                                                                                progress:uploadProgress
                                                                                success:success
                                                                                failure:failure];
                                                                  [self setRedirectionBlockOnDatataskWithOCCommunication:sharedOCCommunication andSessionManager:sharedOCCommunication.uploadSessionManager];
                                                                  [uploadTask resume];

                                                              } failure:^(NSError *error) {
                                                                  failure(response, responseObject, error);
                                                              }];
                }
            } else {
                failure(response, responseObject, error);
            }
        }
    }];

    return uploadTask;
}

- (NSURLSessionUploadTask *)putWithSessionLocalPath:(NSString *)localSource
                                       atRemotePath:(NSString *)remoteDestination
                                    onCommunication:(OCCommunication *)sharedOCCommunication
                                           progress:(void(^)(NSProgress *progress))uploadProgress
                                            success:(void(^)(NSURLResponse *, NSString *))success
                                            failure:(void(^)(NSURLResponse *, id, NSError *))failure
                               failureBeforeRequest:(void(^)(NSError *)) failureBeforeRequest {

    NSFileManager *fileManager = [NSFileManager defaultManager];

    if (localSource == nil || ![fileManager fileExistsAtPath:localSource]) {
        NSMutableDictionary* details = [NSMutableDictionary dictionary];
        [details setValue:@"You are trying upload a file that does not exist" forKey:NSLocalizedDescriptionKey];

        NSError *error = [NSError errorWithDomain:k_domain_error_code code:OCErrorFileToUploadDoesNotExist userInfo:details];

        failureBeforeRequest(error);

        return nil;
    } else {

        NSMutableURLRequest *request = [self requestWithMethod:@"PUT" path:remoteDestination parameters:nil];
        [request setTimeoutInterval:k_timeout_upload];
        [request setValue:[NSString stringWithFormat:@"%lld", [UtilsFramework getSizeInBytesByPath:localSource]] forHTTPHeaderField:@"Content-Length"];
        [request setCachePolicy:NSURLRequestReloadIgnoringLocalCacheData];

        //If is not nil is a redirection so we keep the original url server
        if (!self.originalUrlServer) {
            self.originalUrlServer = [request.URL absoluteString];
        }

        NSLog(@"Before adding cookies, Request put");
//        NSLog(@"Before adding cookies, Request put for userId:%@ username:%@ url:%@ headers-> %@ ",sharedOCCommunication.credDto.userId, sharedOCCommunication.credDto.userName,request.URL, request.allHTTPHeaderFields);

        if (sharedOCCommunication.isCookiesAvailable) {
            //We add the cookies of that URL
            request = [UtilsFramework getRequestWithCookiesByRequest:request andOriginalUrlServer:self.originalUrlServer];
        } else {
            [UtilsFramework deleteAllCookies];
        }

       // NSLog(@"Request put for userId:%@ username:%@ url:%@ headers-> %@ ",sharedOCCommunication.credDto.userId, sharedOCCommunication.credDto.userName,request.URL, request.allHTTPHeaderFields);

        NSURL *file = [NSURL fileURLWithPath:localSource];

        sharedOCCommunication.uploadSessionManager.responseSerializer = [AFHTTPResponseSerializer serializer];

        NSURLSessionUploadTask *uploadTask = [self uploadTaskWithRequest:request
                                                             fromFileURL:file
                                                   retryingNumberOfTimes:k_retry_ntimes
                                                         onCommunication:sharedOCCommunication
                                                                progress:uploadProgress
                                                                 success:success
                                                                 failure:failure];

        [self setRedirectionBlockOnDatataskWithOCCommunication:sharedOCCommunication andSessionManager:sharedOCCommunication.uploadSessionManager];
        [uploadTask resume];

        return uploadTask;
    }
}

- (void) requestUserDataOfServer:(NSString * _Nonnull) path
                  onCommunication:(OCCommunication * _Nonnull)sharedOCCommunication
                          success:(void(^ _Nonnull)(NSHTTPURLResponse * _Nonnull, id _Nonnull))success
                          failure:(void(^ _Nonnull)(NSHTTPURLResponse * _Nonnull, id  _Nullable responseObject, NSError * _Nonnull))failure {

    NSString *apiUserUrl = nil;
    apiUserUrl = [NSString stringWithFormat:@"%@%@", path, k_api_user_url_json];

    _requestMethod = @"GET";

    NSMutableURLRequest *request = [self sharedRequestWithMethod:_requestMethod path: apiUserUrl parameters: nil];
    [request setValue:@"application/xml" forHTTPHeaderField:@"Content-Type"];

    NSURLSessionDataTask *sessionDataTask = [self mr_operationWithRequest:request retryingNumberOfTimes:k_retry_ntimes onCommunication:sharedOCCommunication success:success failure:failure];
    [self setRedirectionBlockOnDatataskWithOCCommunication:sharedOCCommunication andSessionManager:sharedOCCommunication.networkSessionManager];
    [sessionDataTask resume];
}

- (void) requestUserNameOfServer:(NSString * _Nonnull) path
                        byCookie:(NSString * _Nonnull) cookieString
                 onCommunication:(OCCommunication * _Nonnull)sharedOCCommunication
                         success:(void(^ _Nonnull)(NSHTTPURLResponse * _Nonnull, id _Nonnull))success
                         failure:(void(^ _Nonnull)(NSHTTPURLResponse * _Nonnull, id  _Nullable responseObject, NSError * _Nonnull))failure {

    NSString *apiUserUrl = nil;
    apiUserUrl = [NSString stringWithFormat:@"%@%@", path, k_api_user_url_json];

    _requestMethod = @"GET";

    NSMutableURLRequest *request = [self sharedRequestWithMethod:_requestMethod path: apiUserUrl parameters: nil];
	[request setValue:@"application/xml" forHTTPHeaderField:@"Content-Type"];

    NSURLSessionDataTask *sessionDataTask = [self mr_operationWithRequest:request retryingNumberOfTimes:k_retry_ntimes onCommunication:sharedOCCommunication success:success failure:failure];
    [self setRedirectionBlockOnDatataskWithOCCommunication:sharedOCCommunication andSessionManager:sharedOCCommunication.networkSessionManager];
    [sessionDataTask resume];
}

- (void) simpleHEADRequest: (NSString *)path
                  onCommunication:(OCCommunication *)sharedOCCommunication
                  success:(void(^)(NSHTTPURLResponse *operation, id responseObject))success
                  failure:(void(^)(NSHTTPURLResponse *operation, id  _Nullable responseObject, NSError *error))failure {

    NSMutableURLRequest *originRequest = [self sharedRequestWithMethod:@"HEAD" path: path parameters: nil];

    NSString *taskDescription = k_universal_links_key;

    NSURLSessionDataTask *sessionDataTask = [self mr_operationWithRequest:originRequest
                                                          taskDescription:taskDescription
                                                    retryingNumberOfTimes:k_retry_ntimes
                                                          onCommunication:sharedOCCommunication
                                                                  success:^(NSHTTPURLResponse *response , id responseObject) {
            success(response, responseObject);

    } failure:^(NSHTTPURLResponse *response, id  _Nullable responseObject, NSError *error) {
        failure(response, responseObject, [UtilsFramework getErrorByCodeId:OCErrorPrivateLinkRedirectionFailed]);
    }];
    [self setRedirectionBlockOnDatataskWithOCCommunication:sharedOCCommunication andSessionManager:sharedOCCommunication.networkSessionManager];
    [sessionDataTask resume];
}

- (void) getStatusOfTheServer:(NSString *)serverPath onCommunication:
(OCCommunication *)sharedOCCommunication success:(void(^)(NSHTTPURLResponse *operation, id responseObject))success
                            failure:(void(^)(NSHTTPURLResponse *operation, id  _Nullable responseObject, NSError *error))failure  {

    NSString *urlString = [NSString stringWithFormat:@"%@%@", serverPath, k_server_information_json];

    _requestMethod = @"GET";

    NSMutableURLRequest *request = [self sharedRequestWithMethod:_requestMethod path: urlString parameters: nil];

    NSURLSessionDataTask *sessionDataTask = [self mr_operationWithRequest:request retryingNumberOfTimes:k_retry_ntimes onCommunication:sharedOCCommunication success:success failure:failure];
    [self setRedirectionBlockOnDatataskWithOCCommunication:sharedOCCommunication andSessionManager:sharedOCCommunication.networkSessionManager];
    [sessionDataTask resume];
}

- (void)listSharedByServer:(NSString *)serverPath
 onCommunication:(OCCommunication *)sharedOCCommunication
         success:(void(^)(NSHTTPURLResponse *, id))success
         failure:(void(^)(NSHTTPURLResponse *, id  _Nullable responseObject, NSError *))failure {

    NSParameterAssert(success);

    _requestMethod = @"GET";

    NSMutableURLRequest *request = [self sharedRequestWithMethod:_requestMethod path:serverPath parameters:nil];

    NSURLSessionDataTask *sessionDataTask = [self mr_operationWithRequest:request retryingNumberOfTimes:k_retry_ntimes onCommunication:sharedOCCommunication success:success failure:failure];
    [self setRedirectionBlockOnDatataskWithOCCommunication:sharedOCCommunication andSessionManager:sharedOCCommunication.networkSessionManager];
    [sessionDataTask resume];
}

- (void)listSharedByServer:(NSString *)serverPath andPath:(NSString *) path andSubfiles:(BOOL) isSubFiles
           onCommunication:(OCCommunication *)sharedOCCommunication
                   success:(void(^)(NSHTTPURLResponse *, id))success
                   failure:(void(^)(NSHTTPURLResponse *, id  _Nullable responseObject, NSError *))failure {

    NSParameterAssert(success);

	NSString *urlSufix;

	if (isSubFiles) {
		urlSufix = [NSString stringWithFormat: @"?path=%@&subfiles=true",path];
	} else {
		urlSufix = [NSString stringWithFormat: @"?path=%@&reshares=true&subfiles=false",path];
	}

	serverPath = [serverPath stringByAppendingString:urlSufix];

    _requestMethod = @"GET";

    NSMutableURLRequest *request = [self sharedRequestWithMethod:_requestMethod path:serverPath parameters:nil];

    NSURLSessionDataTask *sessionDataTask = [self mr_operationWithRequest:request retryingNumberOfTimes:k_retry_ntimes onCommunication:sharedOCCommunication success:success failure:failure];
    [self setRedirectionBlockOnDatataskWithOCCommunication:sharedOCCommunication andSessionManager:sharedOCCommunication.networkSessionManager];
    [sessionDataTask resume];
}

- (void)shareByLinkFileOrFolderByServer:(NSString * _Nonnull)serverPath
                                andPath:(NSString * _Nonnull)filePath
                               password:(NSString * _Nullable)password
                         expirationTime:(NSString * _Nullable)expirationTime
                            publicUpload:(NSString * _Nullable)publicUpload
                               linkName:(NSString * _Nullable)linkName
                            permissions:(NSInteger)permissions
                        onCommunication:(OCCommunication * _Nonnull)sharedOCCommunication
                                success:(void(^ _Nonnull)(NSHTTPURLResponse * _Nonnull, id _Nonnull))success
                                failure:(void(^ _Nonnull)(NSHTTPURLResponse * _Nonnull, id  _Nullable responseObject, NSError * _Nonnull))failure {

    NSParameterAssert(success);

    self.requestMethod = @"POST";

    NSMutableURLRequest *request = [self sharedRequestWithMethod:self.requestMethod path:serverPath parameters:nil];
    self.postStringForShare = [NSString stringWithFormat: @"path=%@&shareType=3",filePath];

    if (password) {
        self.postStringForShare = [NSString stringWithFormat:@"%@&password=%@",self.postStringForShare,password];
    }
    if (expirationTime) {
        self.postStringForShare = [NSString stringWithFormat:@"%@&expireDate=%@",self.postStringForShare,expirationTime];
    }
    if (linkName) {
        self.postStringForShare = [NSString stringWithFormat:@"%@&name=%@",self.postStringForShare,linkName];
    }

    if (permissions != 0) {
        self.postStringForShare = [NSString stringWithFormat:@"%@&permissions=%d",self.postStringForShare,(int)permissions];
    } else if ([publicUpload isEqualToString:@"true"]) {
        self.postStringForShare = [NSString stringWithFormat:@"%@&publicUpload=%@",self.postStringForShare,@"true"];
    } else if ([publicUpload isEqualToString:@"false"]) {
        self.postStringForShare = [NSString stringWithFormat:@"%@&publicUpload=%@",self.postStringForShare,@"false"];
    }

    [request setHTTPBody:[self.postStringForShare dataUsingEncoding:NSUTF8StringEncoding]];

    NSURLSessionDataTask *sessionDataTask = [self mr_operationWithRequest:request retryingNumberOfTimes:k_retry_ntimes onCommunication:sharedOCCommunication success:success failure:failure];
    [self setRedirectionBlockOnDatataskWithOCCommunication:sharedOCCommunication andSessionManager:sharedOCCommunication.networkSessionManager];
    [sessionDataTask resume];
}

- (void)shareByLinkFileOrFolderByServer:(NSString *)serverPath andPath:(NSString *) filePath andPassword:(NSString *)password
                        onCommunication:(OCCommunication *)sharedOCCommunication
                                success:(void(^)(NSHTTPURLResponse *, id))success
                                failure:(void(^)(NSHTTPURLResponse *, id  _Nullable responseObject, NSError *))failure {
    NSParameterAssert(success);

    _requestMethod = @"POST";

    NSMutableURLRequest *request = [self sharedRequestWithMethod:_requestMethod path:serverPath parameters:nil];
    _postStringForShare = [NSString stringWithFormat: @"path=%@&shareType=3&password=%@",filePath,password];
    [request setHTTPBody:[_postStringForShare dataUsingEncoding:NSUTF8StringEncoding]];

    NSURLSessionDataTask *sessionDataTask = [self mr_operationWithRequest:request retryingNumberOfTimes:k_retry_ntimes onCommunication:sharedOCCommunication success:success failure:failure];
    [self setRedirectionBlockOnDatataskWithOCCommunication:sharedOCCommunication andSessionManager:sharedOCCommunication.networkSessionManager];
    [sessionDataTask resume];
}

- (void)shareByLinkFileOrFolderByServer:(NSString *)serverPath andPath:(NSString *) filePath
                  onCommunication:(OCCommunication *)sharedOCCommunication
                          success:(void(^)(NSHTTPURLResponse *, id))success
                          failure:(void(^)(NSHTTPURLResponse *, id  _Nullable responseObject, NSError *))failure {
    NSParameterAssert(success);

    _requestMethod = @"POST";

    NSMutableURLRequest *request = [self sharedRequestWithMethod:_requestMethod path:serverPath parameters:nil];
    _postStringForShare = [NSString stringWithFormat: @"path=%@&shareType=3",filePath];
    [request setHTTPBody:[_postStringForShare dataUsingEncoding:NSUTF8StringEncoding]];

    NSURLSessionDataTask *sessionDataTask = [self mr_operationWithRequest:request retryingNumberOfTimes:k_retry_ntimes onCommunication:sharedOCCommunication success:success failure:failure];
    [self setRedirectionBlockOnDatataskWithOCCommunication:sharedOCCommunication andSessionManager:sharedOCCommunication.networkSessionManager];
    [sessionDataTask resume];
}

- (void)shareWith:(NSString *)userOrGroup shareeType:(NSInteger)shareeType inServer:(NSString *) serverPath andPath:(NSString *) filePath andPermissions:(NSInteger) permissions onCommunication:(OCCommunication *)sharedOCCommunication
                                success:(void(^)(NSHTTPURLResponse *, id))success
                                failure:(void(^)(NSHTTPURLResponse *, id  _Nullable responseObject, NSError *))failure {
    NSParameterAssert(success);

    _requestMethod = @"POST";

    NSMutableURLRequest *request = [self sharedRequestWithMethod:_requestMethod path:serverPath parameters:nil];

    self.postStringForShare = [NSString stringWithFormat: @"path=%@&shareType=%ld&shareWith=%@&permissions=%ld",filePath, (long)shareeType, userOrGroup, (long)permissions];
    [request setHTTPBody:[_postStringForShare dataUsingEncoding:NSUTF8StringEncoding]];

    NSURLSessionDataTask *sessionDataTask = [self mr_operationWithRequest:request retryingNumberOfTimes:k_retry_ntimes onCommunication:sharedOCCommunication success:success failure:failure];
    [self setRedirectionBlockOnDatataskWithOCCommunication:sharedOCCommunication andSessionManager:sharedOCCommunication.networkSessionManager];
    [sessionDataTask resume];
}

- (void)unShareFileOrFolderByServer:(NSString *)serverPath
                        onCommunication:(OCCommunication *)sharedOCCommunication
                                success:(void(^)(NSHTTPURLResponse *, id))success
                                failure:(void(^)(NSHTTPURLResponse *, id  _Nullable responseObject, NSError *))failure {
    NSParameterAssert(success);

    _requestMethod = @"DELETE";

    NSMutableURLRequest *request = [self sharedRequestWithMethod:_requestMethod path:serverPath parameters:nil];

    NSURLSessionDataTask *sessionDataTask = [self mr_operationWithRequest:request retryingNumberOfTimes:k_retry_ntimes onCommunication:sharedOCCommunication success:success failure:failure];
    [self setRedirectionBlockOnDatataskWithOCCommunication:sharedOCCommunication andSessionManager:sharedOCCommunication.networkSessionManager];
    [sessionDataTask resume];
}

- (void)isShareFileOrFolderByServer:(NSString *)serverPath
                    onCommunication:(OCCommunication *)sharedOCCommunication
                            success:(void(^)(NSHTTPURLResponse *, id))success
                            failure:(void(^)(NSHTTPURLResponse *, id  _Nullable responseObject, NSError *))failure {
    NSParameterAssert(success);

    _requestMethod = @"GET";

    NSMutableURLRequest *request = [self sharedRequestWithMethod:_requestMethod path:serverPath parameters:nil];

    NSURLSessionDataTask *sessionDataTask = [self mr_operationWithRequest:request retryingNumberOfTimes:k_retry_ntimes onCommunication:sharedOCCommunication success:success failure:failure];
    [self setRedirectionBlockOnDatataskWithOCCommunication:sharedOCCommunication andSessionManager:sharedOCCommunication.networkSessionManager];
    [sessionDataTask resume];
}

- (void) updateShareItem:(NSInteger)shareId
            ofServerPath:(NSString * _Nonnull)serverPath
     withPasswordProtect:(NSString * _Nullable)password
       andExpirationTime:(NSString * _Nullable)expirationTime
         andPublicUpload:(NSString * _Nullable)publicUpload
             andLinkName:(NSString * _Nullable)linkName
          andPermissions:(NSInteger)permissions
         onCommunication:(OCCommunication * _Nonnull)sharedOCCommunication
                 success:(void(^ _Nonnull)(NSHTTPURLResponse * _Nonnull operation, id _Nonnull response))success
                 failure:(void(^ _Nonnull)(NSHTTPURLResponse * _Nonnull operation, id  _Nullable responseObject, NSError * _Nonnull error))failure {

    NSParameterAssert(success);

    _requestMethod = @"PUT";

    NSMutableURLRequest *request = [self sharedRequestWithMethod:_requestMethod path:serverPath parameters:nil];

    self.postStringForShare = @"";

    if (password) {
        self.postStringForShare = [NSString stringWithFormat:@"password=%@",password];
    } else if (expirationTime) {
        self.postStringForShare = [NSString stringWithFormat:@"expireDate=%@",expirationTime];
    } else if (linkName) {
        self.postStringForShare = [NSString stringWithFormat:@"name=%@",linkName];
    } else if (permissions != 0) {
        self.postStringForShare = [NSString stringWithFormat:@"permissions=%d",(int)permissions];
    } else if ([publicUpload isEqualToString:@"true"]) {
        self.postStringForShare = [NSString stringWithFormat:@"publicUpload=%@",@"true"];
    } else if ([publicUpload isEqualToString:@"false"]) {
        self.postStringForShare = [NSString stringWithFormat:@"publicUpload=%@",@"false"];
    }

    [request setHTTPBody:[_postStringForShare dataUsingEncoding:NSUTF8StringEncoding]];

    NSURLSessionDataTask *sessionDataTask = [self mr_operationWithRequest:request retryingNumberOfTimes:k_retry_ntimes onCommunication:sharedOCCommunication success:success failure:failure];
    [self setRedirectionBlockOnDatataskWithOCCommunication:sharedOCCommunication andSessionManager:sharedOCCommunication.networkSessionManager];
    [sessionDataTask resume];
}

- (void) updateShareItem:(NSInteger)shareId
            ofServerPath:(NSString*)serverPath
     withPasswordProtect:(NSString*)password
       andExpirationTime:(NSString*)expirationTime
          andPermissions:(NSInteger)permissions
         onCommunication:(OCCommunication *)sharedOCCommunication
                 success:(void(^)(NSHTTPURLResponse *, id response))success
                 failure:(void(^)(NSHTTPURLResponse *, id  _Nullable responseObject, NSError *error))failure{

    NSParameterAssert(success);

    _requestMethod = @"PUT";

    NSMutableURLRequest *request = [self sharedRequestWithMethod:_requestMethod path:serverPath parameters:nil];

    if (password) {
        self.postStringForShare = [NSString stringWithFormat:@"password=%@",password];
    } else if (expirationTime) {
        self.postStringForShare = [NSString stringWithFormat:@"expireDate=%@",expirationTime];
    }else if (permissions > 0) {
        self.postStringForShare = [NSString stringWithFormat:@"permissions=%d",(int)permissions];
    }

    [request setHTTPBody:[_postStringForShare dataUsingEncoding:NSUTF8StringEncoding]];

    NSURLSessionDataTask *sessionDataTask = [self mr_operationWithRequest:request retryingNumberOfTimes:k_retry_ntimes onCommunication:sharedOCCommunication success:success failure:failure];
    [self setRedirectionBlockOnDatataskWithOCCommunication:sharedOCCommunication andSessionManager:sharedOCCommunication.networkSessionManager];
    [sessionDataTask resume];
}

- (void) searchUsersAndGroupsWith:(NSString *)searchString forPage:(NSInteger)page with:(NSInteger)resultsPerPage ofServer:(NSString*)serverPath onCommunication:(OCCommunication *)sharedOCCommunication success:(void(^)(NSHTTPURLResponse *operation, id response))success
    failure:(void(^)(NSHTTPURLResponse *operation, id  _Nullable responseObject, NSError *error))failure {

    NSParameterAssert(success);

    _requestMethod = @"GET";

    NSString *searchQuery = [NSString stringWithFormat: @"&search=%@",searchString];
    NSString *jsonQuery = [NSString stringWithFormat:@"?format=json"];
    NSString *queryType = [NSString stringWithFormat:@"&itemType=file"];
    NSString *pagination = [NSString stringWithFormat:@"&page=%ld&perPage=%ld", (long)page, (long)resultsPerPage];
    serverPath = [serverPath stringByAppendingString:jsonQuery];
    serverPath = [serverPath stringByAppendingString:queryType];
    serverPath = [serverPath stringByAppendingString:searchQuery];
    serverPath = [serverPath stringByAppendingString:pagination];

    NSMutableURLRequest *request = [self sharedRequestWithMethod:_requestMethod path:serverPath parameters:nil];

    NSURLSessionDataTask *sessionDataTask = [self mr_operationWithRequest:request retryingNumberOfTimes:k_retry_ntimes onCommunication:sharedOCCommunication success:success failure:failure];
    [self setRedirectionBlockOnDatataskWithOCCommunication:sharedOCCommunication andSessionManager:sharedOCCommunication.networkSessionManager];
    [sessionDataTask resume];
}

- (void) getCapabilitiesOfServer:(NSString*)serverPath onCommunication:(OCCommunication *)sharedOCCommunication success:(void(^)(NSHTTPURLResponse *operation, id response))success
                         failure:(void(^)(NSHTTPURLResponse *operation, id  _Nullable responseObject, NSError *error))failure{
    _requestMethod = @"GET";

    NSString *jsonQuery = [NSString stringWithFormat:@"?format=json"];
    serverPath = [serverPath stringByAppendingString:jsonQuery];

    NSMutableURLRequest *request = [self sharedRequestWithMethod:_requestMethod path:serverPath parameters:nil];

    NSURLSessionDataTask *sessionDataTask = [self mr_operationWithRequest:request retryingNumberOfTimes:k_retry_ntimes onCommunication:sharedOCCommunication success:success failure:failure];
    [self setRedirectionBlockOnDatataskWithOCCommunication:sharedOCCommunication andSessionManager:sharedOCCommunication.networkSessionManager];
    [sessionDataTask resume];

}

#pragma mark - Remote thumbnails

- (NSURLSessionDataTask *) getRemoteThumbnailByServer:(NSString*)serverPath ofFilePath:(NSString*)filePath  withWidth:(NSInteger)fileWidth andHeight:(NSInteger)fileHeight onCommunication:(OCCommunication *)sharedOCCommunication
                            success:(void(^)(NSHTTPURLResponse *operation, id response))success
                            failure:(void(^)(NSHTTPURLResponse *operation, id  _Nullable responseObject, NSError *error))failure{
    _requestMethod = @"GET";

    NSString *query = [NSString stringWithFormat:@"/%i/%i/%@", (int)fileWidth, (int)fileHeight, filePath];
    serverPath = [serverPath stringByAppendingString:query];

    NSMutableURLRequest *request = [self sharedRequestWithMethod:_requestMethod path:serverPath parameters:nil];

    NSURLSessionDataTask *sessionDataTask = [self mr_operationWithRequest:request retryingNumberOfTimes:k_retry_ntimes onCommunication:sharedOCCommunication success:success failure:failure];
    [self setRedirectionBlockOnDatataskWithOCCommunication:sharedOCCommunication andSessionManager:sharedOCCommunication.networkSessionManager];

    return sessionDataTask;
}

#pragma mark - Manage Redirections

- (void) setRedirectionBlockOnDatataskWithOCCommunication: (OCCommunication *) sharedOCCommunication andSessionManager:(AFURLSessionManager *) sessionManager{

    [sessionManager setTaskWillPerformHTTPRedirectionBlock:^NSURLRequest * _Nonnull(NSURLSession * _Nonnull session, NSURLSessionTask * _Nonnull task, NSURLResponse * _Nonnull response, NSURLRequest * _Nonnull request) {

        if ([task.taskDescription isEqualToString:@"universalLinks"]) {
            return nil;
        }

        if (response == nil) {
            // needed to handle fake redirects to canonical addresses, as explained in https://developer.apple.com/library/content/documentation/Cocoa/Conceptual/URLLoadingSystem/Articles/RequestChanges.html
            return request;
        }

        NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
        NSDictionary *dict = [httpResponse allHeaderFields];
        //Server path of redirected server
        NSString *responseURLString = [dict objectForKey:@"Location"];

        if (responseURLString) {

            if ([UtilsFramework isURLWithSamlFragment:responseURLString] || httpResponse.statusCode == k_redirected_code_1) {
                //We set the redirectedServer in case SAML or is a permanent redirection
                self.redirectedServer = responseURLString;

                if ([UtilsFramework isURLWithSamlFragment:responseURLString]) {
                    // if SAML request, we don't want to follow it; WebView takes care, not here -> nil to NO FOLLOW
                    return nil;
                }
            }

            NSMutableURLRequest *requestRedirect = [request mutableCopy];
            [requestRedirect setURL: [NSURL URLWithString:responseURLString]];

            requestRedirect = [sharedOCCommunication getRequestWithCredentials:requestRedirect];
            requestRedirect.HTTPMethod = _requestMethod;

            if (_postStringForShare) {
                //It is a request to share a file by link
                requestRedirect = [self sharedRequestWithMethod:_requestMethod path:responseURLString parameters:nil];
                [requestRedirect setHTTPBody:[_postStringForShare dataUsingEncoding:NSUTF8StringEncoding]];
            }

            return requestRedirect;

        } else {
            // no location to redirect -> nil to NO FOLLOW
            return nil;
        }

    }];
}

@end


ALLOYS, HEATED SEATS, POWER GROUP!!
SUNROOF, HEATED SEATS, POWERGRPOUP, GREAT BUY!!
A/C, POWER LOCKS, POWER WINDOWS, POWER MIRRORS, KEYLESS ENTRY!!! NO FEES(plus applicable taxes)LOWEST PRICE GUARANTEED! 3 LOCATIONS TO SERVE YOU! OTTAWA 1-888-416-2199! KINGSTON 1-888-508-3494! NORTH BAY 1-888-282-3560! WWW.MYCAR.CA!
SUNROOF, HEATED SEATS, ALLOYS, POWERGROUP!!


What is this Aries trying to do?
Does anyone have this placement or know someone who does, what's your thoughts?
Aries burn bridges after breakup?
How's this retrograde treating you guys?
Happy Birthday to us! This retrograde is in Aries. So how has it been going for you guys?
What could you tell me about this Ram ?
aries sun scorpio moon virgo rising any thoughts?


Things look great at the top of District 8-3A Division I.
Mineola, last year's Class 3A Division I state-runner up, inhabits the league and looks poised to make another run at glory. But White Oak is right there as well with excellent players returning on both sides of the ball.
It's the wild west after that.
Harmony, Sabine and Jefferson all show flashes of promise. We didn't pick them in that order.
Quitman went 0-10 last season but things are looking up.
Here's a surveyor course on a league that could forge some special teams come November.
Offense: Mineola drove to the Class 3A Division I state championship team almost solely on its running game ability with running back Chantz Perkins and quarterback Jeremiah Crawford getting near at least 200 yards each in the latter playoff rounds. They were sophomores. Now they're juniors. The outstanding offensive line from last season is almost fully intact and highlighted by twin offensive tackles and Texas A&M commitments Austin Anderson and Riley Anderson. The Yellowjackets averaged a winnable 32 points per game last season, and the unit was not all that great until late September and arguably later. The only knock on head coach Joe Drennon's offense entering 2015, although it was very effective last season, it was one-dimensional. Crawford's arm appears to be better this season, so if a defensive standout such as Noah Sneed or Aaron Stanford can step in at the receiver position the offense will be absolutely complete.
Defense: The big questions sit within Mineola's front seven. The group has to replace three players that took the team to the next level late in the playoffs -- tackle Trevor Keener, end Casey Gilbreath and middle linebacker Juan Vargas. Granted they had 16 game opportunities, Keener and Vargas ranked first and second in total tackles last season among all East Texas players. Sophomore Michael Drennon will step in at the Mike spot, former safety Kourtland Sinches will take Michael Drennon's outside linebacker spot and the Anderson twins will help give the line some teeth as the tackles to replace Keener. That only leaves a question about who will be the edge-rushing end. Some of those problems can be circumvented with timely blitzes from Sinches at the get-go of the season. The secondary should be fine despite Sinches' departure. Cornerback Noah Sneed and safety Aaron Stanford combined for 11 interceptions last year.
2015 outlook: The Yellowjackets' run to the state championship game was shocking, especially considering an 0-3 start to the year. But that opened a window which probably won't close until after the 2016 season. Most of Mineola's key skill players are juniors. However, this season is the big year. The offensive line will need overhauling at the year's end and the team just won't run into two bona fide SEC-caliber linemen again. There are big challenges in reaching the title game for a second consecutive year. Mineola squeaked by District 5-3A Division I opponents Pilot Points and Pottsboro in consecutive weeks last year with late breaks. Both of those regional opponents return more than half their teams as well. Slipping up within the league is not out the question either. There's another contender within District 8-3A Division I being overshadowed by the Yellowjackets and an additional team out to prove last year's breakthrough was not a fluke.
Offense: Senior quarterback Cade Palmer inherits the starting job full-time this season after throwing for 359 yards and six touchdowns last season. Most of his production came in one start. His supporting receivers are expected to perform very well, particularly Dax Davis and varsity newcomer Heath Hood. Anotonio Castiglione is another player to watch but is expected to make even more of an impact at linebacker. When you've got eight starters returning, you know you can expect consistent offensive line play. White Oak's trench players are experienced and have good size for the Class 3A Division I level. This is a unit that can pile onto opponents quickly, and the Roughnecks are likely to run away with a handful of games.
Defense: The unit will enjoy seven key contributors from last season and should be especially strong at the linebacker spots. Swade Smith accounted for 25 tackles for loss and two sacks as part of 117 total tackles as a junior. He also made two interceptions. Antonio Castiglione is another bright spot. The defensive line has a playmaker as well. Senior Chris Bloyd had nine tackles for loss and five sacks as part of 58 total tackles in the Roughnecks' 11-game campaign. All of that bodes well for 2015. The remainder of the district is predominantly run-oriented.
2015 outlook: White Oak sits right behind Mineola in the sense returning experience meets proven results. And when you've got that situation, it's likely the teams will be playing for the district championship in both side's first league game on Oct. 9. Not only are the Roughnecks talented offensively, they completely contrast Mineola. Kris Iske's crew should have opportunities to either boat race its way to the district title or mount a moderate comeback. Other than that game, White Oak will be a favorite in district games. A tough non-district slate isn't going to hurt anything either.
Offense: Senior running back Dain Duncan has something to prove after suffering an injury in the third game of 2014, and it started at the ETSN.fm + APEC Football Recruiting Combine in which he took home the overall Offensive Most Valuable Player Award. He rushed for 300 yards before being shut down. But Sabine's offensive backfield as a whole has this team thinking playoffs once again. The offensive line will have to power the thing and, fortunately, has known commodities in McKenzie Pyle and Grant Stansberry.
Defense: Retaining four defensive starters isn't a great spot to be in with Mineola and White Oak running around, but the returning group was part of a unit that only allowed 25 points per game last season. Sabine will have to rely on some two-way starters with just 11 total returning lettermen. The athleticism is much better than what is has been in recent seasons to help in the reconstruction project.
2015 outlook: Mark Comfort has the ball rolling. The Cardinals reached the postseason for the first time since 1985 last year while the junior varsity team posted a 9-1 record. The varsity team was 1-9 in 2013. It's going to be tough sledding against Mineola and White Oak, but it's not unfathomable this team steals at least one game from the two. Furthermore, the team is well ahead of the bottom half of the district in either returning starters, proven success or both. The major goal this year will leaving a strong legacy at a program that struggled to get any traction for almost 30 years. Sabine is in great position to do that. Then who knows what happens in the postseason.
Offense: Depth is obviously a concern with only three starters back from a group that averaged 24.7 points per game. The good thing is head coach Antwain Jimmerson likes what he sees for the "I" part Bulldgos' I-formation. The known commodities will play quarterback, fullback and running back.
Defense: Bird Irving, all 6-foot-5 and 230 pounds of him, won't be turned away as an edge-rushing defensive end. Speed isn't an issue for him. He doubles as a receiver. Other than that, however, the Bulldogs' success on this side of the ball just depends on how the group meshes. Fortunately, Jefferson is never short on athletes.
2015 outlook: First-year coach Antwain Jimmerson steps into a really good spot, at least as far as installing what he wants. Jefferson is very short on overall experience and varsity players set in their way. Tough non-district games against New Diana, Elysian Fields, Paul Pewitt, Hughes Springs and Pleasant Grove will force the newcomers to sink or swim from the season's outset. Jimmerson does know how to win. He was a part of the Bulldogs' 1986 state championship team.
Offense: Harmony really struggled within District 8-3A Division I last season. Each opponent held the Eagles to 10 or less points except for Sabine and winless Quitman. Sabine won its game against Harmony, 65-20. The good news is experience should help. Tim Russell will enjoy eight returning starters from the 2014 team, including a solid offensive line to build around and a handful of two-way skill players in Hunter Anderson and Andy Lloyd. Zac Thompson and Michael Edmonson also are expected to make a big impact.
Defense: The Eagles' strength last season was, far and away, its defense. The unit will have seven key contributors back for this campaign. Harmony's defense spent far too long on the field last year, but played tough in every district ball game other than Sabine at the end of the season. Hunter Anderson, a senior, should play an even bigger role than he did last season as a celebrated linebacker. Zac Thompson will give teams issues upfield in the passing game. The rest of the returners proved to be scrappy and have spent another offseason in the weight room. An 8-2 junior varsity team coming up to the varsity level probably holds more answers.
2015 outlook: It's going to be a fight, but there is some room to run in the district. Other than Mineola and White Oak, no team appears to be absolutely complete. Harmony has its share of returning athletes from last season and its lower-level teams were much more successful in 2014. In a perfect world, wins against Jefferson and Quitman ought to be enough to crack the postseason.
Offense: Quitman's offense has to get better if the Bulldogs want to dance in November. The team scored 91 points all season and that caused every loss to be non-competitive. Chase Tennyson is regarded as an outstanding athlete at the quarterback spot and linemen Jacob Davis and Francisco Ramirez had good years in the trenches last season. Other players will need to step up, particularly alongside Tennyson in the backfield. You build a competitive offense directly behind a good line and then out toward the receiver spots.
Defense: The Bulldogs got put in rough spots last season in every game, but they'll also need to improve after averaging nearly 45 points given up per game. Yet this unit is the strength of the team and will benefit from eight starters back. Rowdy Teaff is an imposing defensive lineman. Joining him will be Jacob Davis who is a 5-foot-9, 225-pound overachiever.
2015 outlook: There are a lot of questions to answer this season. The offense and defense did not perform well last year. Don't expect Quitman to roll over though as 16 starters come back in total. The initial sign is there the Bulldogs will be more competitive.


We invite you to come to Nevsail Watersports this year for an amazing School Tour Outing in Limerick or Clare.
Nevsail Watersports is operating School Tours for over 15 years, in Kilkee, Co.Clare and in Limerick City with our Limerick City Watersports (based from the Hunt Museum, offering Kayaking, Stand up Paddle Boarding and Boat/Sail tours & sessions, Raft Building, Archery, Archery Tag, Team Challenges and much more) as well as our Limerick City Indoor Rock Climbing Wall, (on Sexton Street, Limerick) and our Thomond Park Adventures.
We have designed a healthy and fun school tour outing which is age-appropriate, imaginative, and suitable for all levels of fitness and supervised by fully qualified and experienced staff.
We work with teachers and schools to provide the very best educational experience for kids and teens. We run half day and full day programmes for both primary and secondary school groups. We pride ourselves on our care and attention to teachers and their classes and provide all necessary insurance.
All of our school tour activities are designed to improve personal self confidence, develop team building skills and allow children to test and taste Watersports and Adventure Sports in a very safe and fun way.
FOR EVERY 10 PARTICIPANTS 1 GETS FREE ADMISSION And BOOK BEFORE THE END OF FEBRUARY AND AVAIL OF AN EXTRA 5% DISCOUNT OR IF YOU HAVE BOOKED WITH US BEFORE.
PLUS, RECEIVE A FREE WATER SAFETY TALK AT YOUR SCHOOL OR ON THE DAY OF YOU OUTING WHEN YOU BOOK WITH US THIS YEAR.(Please inform us if you wish to avail of this Offer).
FREE NEVSAIL GIFT VOUCHERS ON THE DAY- GET 1 FREE NEVSAIL GIFT VOUCHER PER EVERY 10 STUDENTS IN THE GROUP WHICH YOU CAN RAFFLE OF TO THE KIDS/TEENS.
AND WE CANT FORGET THE TEACHERS, SO EACH TEACHER WHO COMES TO US WITH THEIR CLASS WILL RECEIVE A FREE NEVSAIL GIFT VOUCHER SO THAT YOU CAN ENJOY AN ADVENTURE WITH US ANOTHER TIME.
SO BOOK NOW AND AVAIL OF ALL THESE AMAZING SCHOOL TOUR OFFERS.
We under stand that some teachers love to join in on the fun which they can do so- and some don't. And that is fine with us - there are plenty of beautiful restaurants and cliff walks that the teacher can avail of and enjoy.
10:00 am Arrive at Nevsail Watersports Centre. 10:00 a.m Arrive at Nevsail Watersports Centre.
Gear up into wetsuits and buoyancy aids (Introductions to staff, gear up and short ice breaker).
followed by short Ice Breakers.
12:30 p.m Lunch 12:45 p.m Finish up Activities and get changed.
1:30 p.m Start Third Activity 1:00 p.m Say our goodbyes.
2:45 p.m Finish up activities and get changed.
FULL DAY: Cost from €30 - €35 pp, 10 am - 3 p.m (times are changeable) 5 Hours in total & up to 3 activities.
HALF DAY: Cost from €20 - €25 pp for 3 Hours in total, normally 10 am - 1 pm with 2 Activities.
Each participant is to please bring on your School Tour: Spare clothes, Old Runners, Towel and togs/swim wear. Please also bring a packed lunch if needed or we can recommend/organize somewhere for ye to eat very near to us.
At Nevsail, we understand the importance of respecting the sea. We research the weather and sea conditions and only start activities when conditions are suitable. Kilkee beach is regarded as one of the safest beaches in Ireland but while working on the beach each summer, we see countless acts which could lead to unfavourable situations. In order to increase awareness of safety on the water, we are now providing FREE Water Safety Talks to kids & teens either at their School or on the day of outing.
We will also do our best to pass on many interesting facts about the wildlife, history and formations that we come across on the day outing giving the kids/teens an education experience as well as just having a great fun adventure school tour outing with us.
We are privileged to have the exclusive use of what is said to be one of the first beach wheelchairs in Ireland. We featured in the Irish Times, Clare Champion and Limerick Leader with this chair as it gives those who are wheelchair bound, the rare opportunity to be pushed effortlessly along the sandy beach. If any of your students have special needs, please discuss this with us and we will be happy to discuss the suitability of the various activities for a particular student.
We are an approved provider for Gaisce Awards. We offer 2 day, 1 night residential packages for those completing their Bronze award. Learn skills such as survival, navigation, basic first aid, team building and communication while hiking the beautiful Loophead Peninsula. Visit the Loophead lighthouse, see the stunning Bridges of Ross with contrasting views of the Shannon estuary on one side and the wild Atlantic on the other. Overnight accommodation is provided at Pure Camping, Querrin.
Accommodation in Pure camping, is an new eco campsite on the banks of the Shannon. Students have the opportunity to experience Wild camp in the woods or comfort camping in pre-erected bell tents. Explore the native woodland and ancient ring fort or try a night bat walk! The geodesic dome is a great area for night time entertainment. Yoga session can be arranged. Cooking on the range, harvested rain water showers and composting toilet facilities are all available on site.


people love personalized, interactive and shareable content – and as a business owner, you should too.
According to Kapost, interactive content converts twice as much as passive or static content.
information and insights on their audience when used properly.
2. Ensure the type of quiz you create aligns with your goals.
their proficiency in the topic.
3. Keep your target audience in mind to make it fun and engaging.
quizzes because they are fun, so making it too sales-y or robotic will just make them want to pass.
4. Keep the questions short and simple.
5. Leverage the power of visuals.
avoid boring, muted or generic stock images at all costs.
6. Create a killer headline.
useful tactics to consider when creating an eye-catching headline.
7. Include social sharing buttons.
result have a voracious desire to feel included, heard and recognized among their peers.
8. Use results as opportunity to build your email list.
to circumvent the dreaded 'hard ask'.
consultations and $18,000 in revenue in just a little over a month and a half.
10. Don't forget to include information about your business.
website, products or services at the end on their test results page.
included a link that led back to their Kickstarter campaign on the results page.
were able to bring in over $8,500 in order to successfully launch their startup.
win-win scenario. So, what are you waiting for?


(Bloomberg) -- AT&T Inc. is making good on its promise to tackle its $171 billion debt load.
The telecom carrier is refinancing outstanding debt by selling senior unsecured bonds in as many as two parts, according to a person with knowledge of the matter. The longest portion of the offering, a 20-year security, may yield around 2.375 percentage points above Treasuries, said the person, who asked not to be identified as the details are private.
The largest non-financial issuer of corporate debt, AT&T has made debt reduction its "top priority" for this year. The proceeds of Wednesday's sale, along with cash on hand, will go toward repaying some bonds issued by AT&T as well as subsidiaries of DirecTV, which AT&T bought in 2015 for $49 billion. Since then, AT&T's pay-TV division, led by DirecTV, has continued to lose customers to online streaming services like Netflix Inc.
BNP Paribas SA, Goldman Sachs Group Inc., Morgan Stanley and Wells Fargo & Co. are managing the bond sale, the person said.
--With assistance from Allan Lopez.


text:
Adventures With Words
Exploring storytelling in all its forms.
Podcasts and Reviews
Young Adult Podcast
Literally Unplanned Podcast
Posted on May 30, 2013 October 22, 2016 by Adventures With Words
Review: Perfect by Rachel Joyce
In 1972, in order to balance clock time with the movement of the earth, two seconds were added. Byron Hemmings knew this because James Lowe had told him and James was the cleverest boy at school. But how could time change? The steady movement of hands around a clock was as certain as their golden futures.
Then Byron's mother, late for the school run, makes a devastating mistake. Byron's perfect world is shattered. Were those two extra seconds to blame? Can what follows ever be set right? Infused with the profound insights into what makes us human, lightened with acute observations about the frailties of us all, Perfect is Rachel Joyce at her finest. A novel about misunderstandings, the small acts of kindness that make the difference and the redemptive nature of time.
When I received my lovely signed copy of Perfect by Rachel Joyce, I was excited but also nervous – I read and loved The Unlikely Pilgrimage of Harold Fry last year with very little prior knowledge and was drawn into it by the delicacy of the prose combined with the raw brutality of the emotions and impulses contained within the strained, very British, attitudes of the characters. After reading Perfect, it's confirmed my opinion that Joyce has an incredible insight into this part of our cultural headspace; few people still consider the repercussions of our rigid class system and 'stiff upper lip' which continue to reverberate through our way of life.
Perfect is a split-narrative novel, taking place in 1972, following the adventures of Byron Hemmings and his friend James over the course of a summer, and also in the present day, where we follow the life of Jim, paralysed by anxiety and his compulsive routines to the point where any previous 'normal' life has been erased. As the book progresses, we start to glimpse the links between the two strands, thematically as well as in terms of character and setting. It's clear immediately that the place is the same – Cranham, with its stark moorland – but everything else drifts into place delicately and subtly, like the seeds from a dandelion clock.
From the outset, I loved Byron's innocent, naive view of the world, and the simple, clear voice Joyce creates for him. He is very observant but doesn't always understand the implications of which he sees taking place around him, although as an adult reading his point of view, the tensions simmering just below the surface are clearly visible. There are unspoken problems between his parents – his beautiful mother has few friends, his father returns home only at weekends – and his friend James is no longer allowed to visit after 'the incident with the bridge'… Despite this and the huge weight of expectation for his future at such a young age, Byron does his best, takes care of his family and attempts to retain his hopeful outlook in the face of increasingly worrying developments.
Jim, in the present day, is at the opposite end of his journey; he has been in and out of an institution for many years, he has only his obsessive compulsive routines to console him in his solitude and he's terrified of people and the harm he could cause them. Yet, there is still hope. In spite of himself and his fears, he begins to make connections with the unlikeliest of people, in the unlikeliest of places. Some of his experiences I found incredibly moving and very tough of read about, all the more so because of the subtlety and understated manner of Joyce's writing style. The conclusion of the novel moved me to tears. Nothing about this book is saccharine or sentimental, and I think it's all the better for that.
"There's not a thing I'd change about it"
There are many young adult books which deal with themes of identity, self-discovery, breaking out of the the boundaries of class and expectation and also mental health, but new, literary, emotionally engaging books for adults about these themes, and of this quality and truthfulness, are few and far between. Rachel Joyce should be praised from the rooftops for Perfect; there's not a thing I'd change about it.
Perfect is published by Doubleday
@magic_kitten
CategoriesBooks, Reviews TagsDoubleday, Perfect, rachel joyce, review
2 Replies to "Review: Perfect by Rachel Joyce"
Pingback: Perfect by Rachel Joyce – review | MagicKitten* blogs
Pingback: Review: The Love Song of Queenie Hennessy by Rachel Joyce | Adventures With Words
Previous PostPrevious Review: Gone Girl by Gillian Flynn
Next PostNext Weekend Reads: A Deceased Authors Special
Otherworld by Jason Segel and Kirsten Miller
Quick podcast update!
Review: Frogkisser! by Garth Nix
Review: Spellslinger by Sebastien de Castell
Podcast: Sorting the Bookshelves and the British Book Awards
Podcast: Ayisha Malik talks about Sofia Khan and The Other Half of Happiness
Review: The Hate U Give by Angie Thomas
Review: Uglies by Scott Westerfeld

redpajama_set_name: RedPajamaCommonCrawl


text:
Why UGP
Business Gas and Electricity News
Here is the latest news and helpful tips on reducing your businesses gas and electricity costs from United Gas & Power.
Brexit could lead to oil worker exodus, Oil and Gas UK warns
OGUK skills and employment issues manager Alix Thom responded to questions about the impact of leaving the EU on the industry's workforce at Westminster's Scottish Affairs Committee.
Ms Thom said visas had caused problems in the past and she believed they would do so again, particularly as there is still a science and engineering skills shortage in the UK, meaning companies will continue to need to import workers.
"We're clearly concerned for the future," she said. "We regard the Tier Two visa process as pretty cumbersome and our members have real concerns if that is to be trialled in future.
"Previously, we were actually losing candidates because of the time it took to process a visa – people were getting definite offers elsewhere where they didn't have to wait on the uncertainty of a visa.
"When business begins to ramp up again we really will need access to labour outside the UK as there is no short term fix [to the UK skills shortage].
"We're in the doldrums a bit at the moment but we continue to compete globally for investment and anything that makes it more difficult to do business here will have an impact on that."
The committee also took evidence from academics on the impact Brexit was having on research and university teaching.
Aberdeen South MP Ross Thomson has called on immigration minister Caroline Nokes to include Aberdeen universities in visa trials being conducted elsewhere in the UK.
Robert Gordon University Principal Ferdinand von Prondzynski told the Press and Journal his university is already suffering the effects of Brexit.
"We have had to work twice as hard to get the numbers of international students and staff as before," he said.
"Brexit is not just damaging EU migration but also international migration – for example, people from China are saying Britain is turning away from the global community and becoming unwelcoming.
"The message going out needs to be balanced and corrected because Scotland needs to be emphatic in saying people from other countries are welcome here."
Originally published at energyvoice.com
Let us help your business save money
Just fill in the form below and we'll be in touch about how we can help.
Why choose UGP
Personalised Account Management
Your own dedicated account manager based in the UK, offering quick and easy access to all aspects of business energy account management.
Industry Leading Customer Care
With a 5* Trust Pilot Rating, we value every customer, no matter how large or small, so that you can be sure you're in safe hands.
The Entire Process Made Simple
From easy-to-read gas and electricity bills, to fully flexible solutions, you'll find switching to UGP gives you a lower cost, hassle free solution.
Disabled Access Statement
United Gas & Power Limited Company Number: 08358816 VAT Number: 158 9310 85


text:
Hill and Simmonds will be missing for Exeter Chiefs against Bath Rugby
The West Country derby will take place at the Rec on Friday night
Daniel EvansHead of digital sport
Jonny Hill in action for Exeter Chiefs (Image: David Rogers/Getty Images)
Exeter Chiefs will be without England forwards Sam Simmonds and Jonny Hill when they take on Bath Rugby at the Rec on Friday night.
Director of rugby Rob Baxter confirmed the news about the number eight and lock at his weekly media briefing at Sandy Park.
Simmonds was forced off during the first half of Saturday's win against Worcester Warriors with a knee injury, while Hill played the whole game but was later diagnosed with a hand ligament injury.
The in-form players - who toured with England in South Africa this summer - are still being assessed by the club's medical team but have been ruled out of the West Country derby and the Chiefs' Champions Cup games against Munster and Castres later this month.
Bath Rugby injury news for the Premiership clash with Exeter Chiefs at the Rec
"It's a little bit early to say how bad they are at the moment," said Baxter. "Hopefully, they will be back before the end of the season, but I can't really say at this stage.
"You've just got to deal with these things, they happen, and use it to get the guys fit in every other areas.
Sam Simmonds receives the Land Rover Discovery of the Season award (Image: Dan Mullan/Getty Images for Premiership Rugby)
The 41 players Bath Rugby have registered for the Heineken Champions Cup
"Both Sam and Jonny can develop other areas of their physique and elements they want to keep working on in their programmes anyway, so we've just got to get them back fit as soon as we can and move on.
"They're both good players and both have a significant part to play in the rest of the season. It's a long old season and it'll be amazing how quick they'll be back in the Exeter shirt."
Simmonds, who succeeded Thomas Waldrom as Chiefs' predator at the back of scrum and won the Premiership Discovery of the Season award for 2017/18, has scored 20 tries in 27 Premiership appearances since breaking into the first team.
Premiership Rugby
Bath RugbyAnthony Watson set to make U-turn on Bath Rugby exit - reportsHard work is going on behind the scenes at Farleigh House to keep England internationals Watson and Jonathan Joseph at the club
Bath RugbyCam Redpath makes immediate return to Scotland squad ahead of 2022 Guinness Six NationsCentre Redpath is joined in the initial Scotland squad by Bath backrower Josh Bayliss
Anthony Watson set to make U-turn on Bath Rugby exit - reports
Bath RugbyHard work is going on behind the scenes at Farleigh House to keep England internationals Watson and Jonathan Joseph at the club
England boss Eddie Jones keen to tinker with Bath Rugby star Orlando Bailey's long term position
Bath Rugby20-year-old fly-half Bailey has been named in the 36-man squad to prepare for the 2022 Guinness Six Nations
Bath Rugby confirm coaching exits and additions ahead of 2022/23 season
Bath RugbyNeal Hatley to remain at the club but David Williams to depart after joining the Blue, Black and White in the summer
Thanks for the memories Skivo, Yeovil Town now need to get working on that statue
Yeovil Town FCBBC Radio Somerset commentator Sheridan Robins pays tribute to Terry Skiverton with the former defender, manager, coach and club legend departing for a role at Charlton Athletic