Class HTTPUtility
java.lang.Object
org.gcube.informationsystem.resourceregistry.api.rest.httputils.HTTPUtility
The Class HTTPUtility.
- Author:
- Luca Frosini (ISTI - CNR)
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected static <C> AvailableInAnotherContextExceptionGets the element available in another context exception.protected static <C> NotFoundExceptiongetElementNotFoundException(Class<C> clz) Gets the element not found exception.static <C> CgetResponse(Class<C> clz, HttpURLConnection connection) Gets the response.protected static StringBuildergetStringBuilder(InputStream inputStream) Gets the string builder.
-
Constructor Details
-
HTTPUtility
public HTTPUtility()
-
-
Method Details
-
getElementNotFoundException
protected static <C> NotFoundException getElementNotFoundException(Class<C> clz) throws NotFoundException, ResourceRegistryException Gets the element not found exception.- Type Parameters:
C- the generic type- Parameters:
clz- the clz- Returns:
- the element not found exception
- Throws:
NotFoundException- the not found exceptionResourceRegistryException- the resource registry exception
-
getElementAvailableInAnotherContextException
protected static <C> AvailableInAnotherContextException getElementAvailableInAnotherContextException(Class<C> clz) Gets the element available in another context exception.- Type Parameters:
C- the generic type- Parameters:
clz- the clz- Returns:
- the element available in another context exception
-
getStringBuilder
Gets the string builder.- Parameters:
inputStream- the input stream- Returns:
- the string builder
- Throws:
IOException- Signals that an I/O exception has occurred.
-
getResponse
Gets the response.- Type Parameters:
C- the generic type- Parameters:
clz- the clzconnection- the connection- Returns:
- the response
- Throws:
Exception- the exception
-