public static class BoxRequestsSearch.Search extends BoxRequestItem<BoxIteratorItems,BoxRequestsSearch.Search> implements BoxCacheableRequest<BoxIteratorItems>
| Modifier and Type | Class and Description |
|---|---|
static class |
BoxRequestsSearch.Search.Scope |
BoxRequest.BoxRequestHandler<R extends BoxRequest>, BoxRequest.ContentTypes, BoxRequest.Methods, BoxRequest.TLSSSLSocketFactory| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
CONTENT_TYPE_COMMENTS
Only search in comments.
|
static java.lang.String |
CONTENT_TYPE_DESCRIPTION
Only search in descriptions.
|
static java.lang.String |
CONTENT_TYPE_FILE_CONTENTS
Only search in file contents.
|
static java.lang.String |
CONTENT_TYPE_NAME
Only search in names.
|
static java.lang.String |
CONTENT_TYPE_TAGS
Only search in tags.
|
protected static java.lang.String |
FIELD_ANCESTOR_FOLDER_IDS
Field for setting the ancestor folder ids.
|
protected static java.lang.String |
FIELD_CONTENT_TYPES
Field for setting the content types: name, description, file_content, comments, or tags.
|
protected static java.lang.String |
FIELD_CREATED_AT_RANGE
Field for setting the created at range.
|
protected static java.lang.String |
FIELD_FILE_EXTENSIONS
Field for setting the file extensions.
|
protected static java.lang.String |
FIELD_LIMIT
Field for setting number of search results to return (default=30, max =200)
|
protected static java.lang.String |
FIELD_OFFSET
The search result at which to start the response.
|
protected static java.lang.String |
FIELD_OWNER_USER_IDS
Field for setting the owner user ids.
|
protected static java.lang.String |
FIELD_QUERY
Field for setting the search query.
|
protected static java.lang.String |
FIELD_SCOPE
Field for setting the scope for admins only.
|
protected static java.lang.String |
FIELD_SIZE_RANGE
Field for setting the size range.
|
protected static java.lang.String |
FIELD_TYPE
Field for setting return type: file, folder, or web_link.
|
protected static java.lang.String |
FIELD_UPDATED_AT_RANGE
Field for setting the updated at range.
|
mHintHeader, mId, QUERY_FIELDSJSON_OBJECT, mBodyMap, mContentType, mHeaderMap, mListener, mQueryMap, mRequestMethod, mRequestUrlString, mRequiresSocket, mSession, mTimeout| Constructor and Description |
|---|
Search(java.lang.String query,
java.lang.String requestUrl,
BoxSession session)
Creates a search request with the default parameters.
|
| Modifier and Type | Method and Description |
|---|---|
java.lang.String[] |
getAncestorFolderIds() |
java.lang.String[] |
getContentTypes() |
java.util.Date |
getCreatedAtDateRangeFrom() |
java.util.Date |
getCreatedAtDateRangeTo() |
java.lang.String[] |
getFileExtensions() |
java.util.Date |
getLastUpdatedAtDateRangeFrom() |
java.util.Date |
getLastUpdatedAtDateRangeTo() |
java.lang.Integer |
getLimit() |
java.lang.Integer |
getOffset() |
java.lang.String[] |
getOwnerUserIds() |
java.lang.String |
getQuery() |
java.lang.String |
getScope() |
java.lang.Long |
getSizeRangeFrom() |
java.lang.Long |
getSizeRangeTo() |
java.lang.String |
getType() |
BoxRequestsSearch.Search |
limitAncestorFolderIds(java.lang.String[] folderIds)
Limit searches to specific ancestor folders.
|
BoxRequestsSearch.Search |
limitContentTypes(java.lang.String[] contentTypes)
Limit search to certain content types.
|
BoxRequestsSearch.Search |
limitCreationTime(java.util.Date fromDate,
java.util.Date toDate)
Limit the search to creation time between fromDate to toDate.
|
BoxRequestsSearch.Search |
limitFileExtensions(java.lang.String[] extensions)
limit file search to given file extensions.
|
BoxRequestsSearch.Search |
limitLastUpdateTime(java.util.Date fromDate,
java.util.Date toDate)
Limit the search to last update time between fromDate to toDate.
|
BoxRequestsSearch.Search |
limitOwnerUserIds(java.lang.String[] userIds)
limit the search to items owned by given users.
|
BoxRequestsSearch.Search |
limitSearchScope(BoxRequestsSearch.Search.Scope scope)
limit search scope.
|
BoxRequestsSearch.Search |
limitSizeRange(long minSize,
long maxSize)
Limit the search to file size greater than minSize in bytes and less than maxSize in bytes.
|
BoxRequestsSearch.Search |
limitType(java.lang.String type)
The type you want to return in your search.
|
BoxRequestsSearch.Search |
limitValueForKey(java.lang.String key,
java.lang.String value)
Generic key and values used to limit search for
|
BoxIteratorItems |
sendForCachedResult()
Sends the request to fetch results from cache synchronously.
|
BoxRequestsSearch.Search |
setLimit(int limit)
Sets the limit of items that should be returned
|
BoxRequestsSearch.Search |
setOffset(int offset)
Sets the offset of the items that should be returned
|
BoxFutureTask<BoxIteratorItems> |
toTaskForCachedResult()
Converts the request to a BoxCacheFutureTask that can be used to execute the request
asynchronously.
|
addRepresentationHintGroup, createHeaderMap, getId, onSendCompleted, setFieldsbuildUrl, createHttpRequest, createQuery, equals, getIfMatchEtag, getIfNoneMatchEtag, getRequestHandler, getSession, getSocket, getStringBody, handleSendForCachedResult, handleToTaskForCachedResult, handleUpdateCache, hashCode, importRequestContentMapsFrom, logDebug, logRequest, onSend, parseHashMapEntry, parseJsonObject, send, sendRequest, setBody, setContentType, setHeaders, setIfMatchEtag, setIfNoneMatchEtag, setRequestHandler, setTimeOut, toTaskpublic static java.lang.String CONTENT_TYPE_NAME
public static java.lang.String CONTENT_TYPE_DESCRIPTION
public static java.lang.String CONTENT_TYPE_COMMENTS
public static java.lang.String CONTENT_TYPE_FILE_CONTENTS
public static java.lang.String CONTENT_TYPE_TAGS
protected static final java.lang.String FIELD_QUERY
protected static final java.lang.String FIELD_SCOPE
protected static final java.lang.String FIELD_FILE_EXTENSIONS
protected static final java.lang.String FIELD_CREATED_AT_RANGE
protected static final java.lang.String FIELD_UPDATED_AT_RANGE
protected static final java.lang.String FIELD_SIZE_RANGE
protected static final java.lang.String FIELD_OWNER_USER_IDS
protected static final java.lang.String FIELD_ANCESTOR_FOLDER_IDS
protected static final java.lang.String FIELD_CONTENT_TYPES
protected static final java.lang.String FIELD_TYPE
protected static final java.lang.String FIELD_LIMIT
protected static final java.lang.String FIELD_OFFSET
public Search(java.lang.String query,
java.lang.String requestUrl,
BoxSession session)
query - query to search for.requestUrl - URL of the search endpoint.session - the authenticated session that will be used to make the request withpublic BoxIteratorItems sendForCachedResult() throws BoxException
BoxCacheableRequestsendForCachedResult in interface BoxCacheableRequest<BoxIteratorItems>BoxException - thrown if there is no implementation of BoxCache set in BoxConfig, or if
there was another issue getting cached results.public BoxFutureTask<BoxIteratorItems> toTaskForCachedResult() throws BoxException
BoxCacheableRequesttoTaskForCachedResult in interface BoxCacheableRequest<BoxIteratorItems>BoxException - thrown if there is no implementation of BoxCache set in BoxConfig.public BoxRequestsSearch.Search limitValueForKey(java.lang.String key, java.lang.String value)
key - key to limit search to.value - value for key to limit search to.public BoxRequestsSearch.Search limitSearchScope(BoxRequestsSearch.Search.Scope scope)
scope - scope to limit search to.public BoxRequestsSearch.Search limitFileExtensions(java.lang.String[] extensions)
extensions - file extensions to limit search to.public BoxRequestsSearch.Search limitCreationTime(java.util.Date fromDate, java.util.Date toDate)
fromDate - can use null if you don't want to restrict this.toDate - can use null if you don't want to restrict this.public BoxRequestsSearch.Search limitLastUpdateTime(java.util.Date fromDate, java.util.Date toDate)
fromDate - can use null if you don't want to restrict this.toDate - can use null if you don't want to restrict this.public BoxRequestsSearch.Search limitSizeRange(long minSize, long maxSize)
minSize - the minimum size in bytes to limit search to.maxSize - the maximum size in bytes to limit search to.public BoxRequestsSearch.Search limitOwnerUserIds(java.lang.String[] userIds)
userIds - user ids to limit search to.public BoxRequestsSearch.Search limitAncestorFolderIds(java.lang.String[] folderIds)
folderIds - folder ids to limit search to.public BoxRequestsSearch.Search limitContentTypes(java.lang.String[] contentTypes)
contentTypes - content types to limit search to.public BoxRequestsSearch.Search limitType(java.lang.String type)
type - the box content type to limit search to.public BoxRequestsSearch.Search setLimit(int limit)
limit - limit of items to returnpublic BoxRequestsSearch.Search setOffset(int offset)
offset - offset of items to returnpublic java.util.Date getLastUpdatedAtDateRangeFrom()
public java.util.Date getLastUpdatedAtDateRangeTo()
public java.util.Date getCreatedAtDateRangeFrom()
public java.util.Date getCreatedAtDateRangeTo()
public java.lang.Long getSizeRangeFrom()
public java.lang.Long getSizeRangeTo()
public java.lang.String[] getOwnerUserIds()
public java.lang.String[] getAncestorFolderIds()
public java.lang.String[] getContentTypes()
public java.lang.String getType()
public java.lang.Integer getLimit()
public java.lang.Integer getOffset()
public java.lang.String getQuery()
public java.lang.String getScope()
public java.lang.String[] getFileExtensions()