Class StorageHelper
Static Helper for the Storage API.
Inherited Members
Namespace: VDS.RDF.Storage
Assembly: dotNetRdf.dll
Syntax
public static class StorageHelper
Fields
| Edit this page View SourceHttpMultipartContentTemplate
Template for posting form data as part of a HTTP multipart request.
Declaration
public const string HttpMultipartContentTemplate = "Content-Disposition: form-data; name=\"{0}\"\r\n\r\n{1}"
Field Value
| Type | Description |
|---|---|
| string |
Properties
| Edit this page View SourceHttpMultipartBoundary
Gets a new unique boundary for HTTP mutlipart requests.
Declaration
public static string HttpMultipartBoundary { get; }
Property Value
| Type | Description |
|---|---|
| string |
Methods
| Edit this page View SourceHandleError(Exception, string)
Handles Errors.
Declaration
public static RdfStorageException HandleError(Exception ex, string action)
Parameters
| Type | Name | Description |
|---|---|---|
| Exception | ex | Error. |
| string | action | Action being performed. |
Returns
| Type | Description |
|---|---|
| RdfStorageException |
HandleError<T>(Exception, string, Func<string, Exception, T>)
Handles Errors.
Declaration
public static T HandleError<T>(Exception ex, string action, Func<string, Exception, T> errorProvider) where T : Exception
Parameters
| Type | Name | Description |
|---|---|---|
| Exception | ex | Error. |
| string | action | Action being performed. |
| Func<string, Exception, T> | errorProvider | Function that generates the actual errors. |
Returns
| Type | Description |
|---|---|
| T |
Type Parameters
| Name | Description |
|---|---|
| T | Error Type. |
HandleHttpError(HttpResponseMessage, string)
Handles HTTP errors, obtaining additional information from the HTTP response if possible.
Declaration
public static RdfStorageException HandleHttpError(HttpResponseMessage response, string action)
Parameters
| Type | Name | Description |
|---|---|---|
| HttpResponseMessage | response | HTTP response. |
| string | action | Action being performed. |
Returns
| Type | Description |
|---|---|
| RdfStorageException | Exception that can be raised to notify this error. |
HandleHttpError(WebException, string)
Handles HTTP Errors obtaining additional information from the HTTP response if possible.
Declaration
public static RdfStorageException HandleHttpError(WebException webEx, string action)
Parameters
| Type | Name | Description |
|---|---|---|
| WebException | webEx | HTTP Error. |
| string | action | Action being performed. |
Returns
| Type | Description |
|---|---|
| RdfStorageException |
HandleHttpError<T>(HttpResponseMessage, string, Func<string, T>)
Handles HTTP errors obtaining additional information from the HTTP response if possible.
Declaration
public static T HandleHttpError<T>(HttpResponseMessage responseMessage, string action, Func<string, T> errorProvider) where T : Exception
Parameters
| Type | Name | Description |
|---|---|---|
| HttpResponseMessage | responseMessage | HTTP response message to process. |
| string | action | Action being performed when the response message was received. |
| Func<string, T> | errorProvider | Function that generates the exception to be raised. |
Returns
| Type | Description |
|---|---|
| T |
Type Parameters
| Name | Description |
|---|---|
| T | Type of exception to raise. |
HandleHttpError<T>(WebException, string, Func<string, Exception, T>)
Handles HTTP Errors obtaining additional information from the HTTP response if possible.
Declaration
public static T HandleHttpError<T>(WebException webEx, string action, Func<string, Exception, T> errorProvider) where T : Exception
Parameters
| Type | Name | Description |
|---|---|---|
| WebException | webEx | HTTP Error. |
| string | action | Action being performed. |
| Func<string, Exception, T> | errorProvider | Function that generates the actual errors. |
Returns
| Type | Description |
|---|---|
| T |
Type Parameters
| Name | Description |
|---|---|
| T |
Remarks
Adapted from Ron Michael's Zettlemoyer's original patch for this in Stardog to use it across all operations as far as possible.
HandleHttpQueryError(HttpResponseMessage)
Handles HTTP Query Errors obtaining additional information from the HTTP response if possible.
Declaration
public static RdfQueryException HandleHttpQueryError(HttpResponseMessage responseMessage)
Parameters
| Type | Name | Description |
|---|---|---|
| HttpResponseMessage | responseMessage | HTTP response. |
Returns
| Type | Description |
|---|---|
| RdfQueryException |
HandleHttpQueryError(WebException)
Handles HTTP Query Errors obtaining additional information from the HTTP response if possible.
Declaration
public static RdfQueryException HandleHttpQueryError(WebException webEx)
Parameters
| Type | Name | Description |
|---|---|---|
| WebException | webEx | HTTP Error. |
Returns
| Type | Description |
|---|---|
| RdfQueryException |
HandleQueryError(Exception)
Handles Query Errors.
Declaration
public static RdfQueryException HandleQueryError(Exception ex)
Parameters
| Type | Name | Description |
|---|---|---|
| Exception | ex | Error. |
Returns
| Type | Description |
|---|---|
| RdfQueryException |