public final class Utils
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
static void |
consumeHttpEntity(org.apache.http.HttpEntity entity)
Ensures that the entity content is fully consumed and the content stream, if exists, is closed.
|
static void |
consumeHttpEntityQuietly(org.apache.http.HttpEntity entity)
Ensures that the entity content is fully consumed and the content stream, if exists, is closed.
|
static java.lang.String |
getContainerString(BoxResourceType type)
Given a resource type, get the string for it's REST API container.
|
static <T extends BoxTypedObject> |
getTypedObjects(BoxCollection collection,
java.lang.Class<T> cls)
Filter out a list of specified type BoxTypedObject's from a Collection
|
public static java.lang.String getContainerString(BoxResourceType type)
BoxResourceType.FILE
, it it's container would be "files".type
- typepublic static <T extends BoxTypedObject> java.util.List<T> getTypedObjects(BoxCollection collection, java.lang.Class<T> cls)
collection
- collection to be filtered.cls
- class of the type to be filtered. e.g. BoxFile.class.public static void consumeHttpEntityQuietly(org.apache.http.HttpEntity entity)
entity
- the entity to consume.
Copied from org.apache.http.util.EntityUtilspublic static void consumeHttpEntity(org.apache.http.HttpEntity entity) throws java.io.IOException
entity
- the entity to consume.java.io.IOException
- if an error occurs reading the input stream
Copied from org.apache.http.util.EntityUtils