public ServiceCall < TokenDictStatusResponse > createStopwordList ( CreateStopwordListOptions createStopwordListOptions ) { Validator . notNull ( createStopwordListOptions , "createStopwordListOptions cannot be null" ) ; String [ ] pathSegments = { "v1/environments" , "collections" , "word_lists/stopwords" } ; String [ ] pathParameters = { createStopwordListOptions . environmentId ( ) , createStopwordListOptions . collectionId ( ) } ; RequestBuilder builder = RequestBuilder . post ( RequestBuilder . constructHttpUrl ( getEndPoint ( ) , pathSegments , pathParameters ) ) ; builder . query ( "version" , versionDate ) ; Map < String , String > sdkHeaders = SdkCommon . getSdkHeaders ( "discovery" , "v1" , "createStopwordList" ) ; for ( Entry < String , String > header : sdkHeaders . entrySet ( ) ) { builder . header ( header . getKey ( ) , header . getValue ( ) ) ; } builder . header ( "Accept" , "application/json" ) ; MultipartBody . Builder multipartBuilder = new MultipartBody . Builder ( ) ; multipartBuilder . setType ( MultipartBody . FORM ) ; RequestBody stopwordFileBody = RequestUtils . inputStreamBody ( createStopwordListOptions . stopwordFile ( ) , "application/octet-stream" ) ; multipartBuilder . addFormDataPart ( "stopword_file" , createStopwordListOptions . stopwordFilename ( ) , stopwordFileBody ) ; builder . body ( multipartBuilder . build ( ) ) ; return createServiceCall ( builder . build ( ) , ResponseConverterUtils . getObject ( TokenDictStatusResponse . class ) ) ; }
Create stopword list .