コード例 #1
0
        public static ConditionInformation GetConditionInfoFromRequest(NameValueCollection requestHeaders, OperationTypeForConditionParsing operationType, string requestVersion)
        {
            ConditionalHeaders conditionalHeadersFromRequest = ConditionExtractor.GetConditionalHeadersFromRequest(requestHeaders);

            if (conditionalHeadersFromRequest == null)
            {
                return(null);
            }
            if (operationType == OperationTypeForConditionParsing.ReadOperation || operationType == OperationTypeForConditionParsing.WriteOperation)
            {
                return(ConditionExtractor.ExecuteExtractors(conditionalHeadersFromRequest, requestHeaders, operationType, requestVersion, ConditionExtractor.extractors));
            }
            NephosAssertionException.Assert(operationType == OperationTypeForConditionParsing.CopyOperation);
            ConditionInformation copySourceIfModifiedSince = ConditionExtractor.ExecuteExtractors(conditionalHeadersFromRequest, requestHeaders, operationType, requestVersion, ConditionExtractor.extractors);
            ConditionInformation conditionInformation      = ConditionExtractor.ExecuteExtractors(conditionalHeadersFromRequest, requestHeaders, operationType, requestVersion, ConditionExtractor.copySourceExtractors);

            if (copySourceIfModifiedSince == null)
            {
                return(conditionInformation);
            }
            if (conditionInformation != null)
            {
                copySourceIfModifiedSince.CopySourceIfModifiedSince    = conditionInformation.CopySourceIfModifiedSince;
                copySourceIfModifiedSince.CopySourceIfNotModifiedSince = conditionInformation.CopySourceIfNotModifiedSince;
                copySourceIfModifiedSince.CopySourceIfMatch            = conditionInformation.CopySourceIfMatch;
                copySourceIfModifiedSince.CopySourceIfNoneMatch        = conditionInformation.CopySourceIfNoneMatch;
                NephosAssertionException.Assert(copySourceIfModifiedSince.ConditionFailStatusCode == conditionInformation.ConditionFailStatusCode);
            }
            return(copySourceIfModifiedSince);
        }
コード例 #2
0
        public static ConditionInformation GetConditionInfoFromIncrementalCopyRequest(NameValueCollection requestHeaders, OperationTypeForConditionParsing operationType, string requestVersion)
        {
            ConditionalHeaders conditionalHeadersFromRequest = ConditionExtractor.GetConditionalHeadersFromRequest(requestHeaders);

            if (conditionalHeadersFromRequest == null)
            {
                return(null);
            }
            return(ConditionExtractor.ExecuteExtractors(conditionalHeadersFromRequest, requestHeaders, operationType, requestVersion, ConditionExtractor.extractors));
        }