Package com.datasift.client.exceptions

Examples of com.datasift.client.exceptions.IllegalDataSiftPullFormat


        checkHeaders();
        if (backOff == 0 && //if we got a 503,500 or 204 back off will not be 0
                //if status isn't a 204 and we're not backing off then we're in an invalid state if the rest holds true
                status != 204 &&
                headersSet && (format == null || format.isEmpty())) {
            throw new IllegalDataSiftPullFormat("The DataSift API failed to provide the format of the data. " +
                    "Please raise the issue with support", response);
        }

        if (format != null) {
            switch (format) {
                case FORMAT_NEW_LINE:
                    if (done) {
                        //chunked responses will cause new line to break
                        // early so only do it when he entire response is received
                        readLineByLine();
                    }
                    break;
                case FORMAT_ARRAY:
                    readArray();
                    break;
                case FORMAT_META:
                    readObject();
                    break;
                default:
                    throw new IllegalDataSiftPullFormat("DataSift format '" + format + "' is not supported", response);
            }
        }
    }
View Full Code Here


        checkHeaders();
        if (backOff == 0 && //if we got a 503,500 or 204 back off will not be 0
                //if status isn't a 204 and we're not backing off then we're in an invalid state if the rest holds true
                status != 204 &&
                headersSet && (format == null || format.isEmpty())) {
            throw new IllegalDataSiftPullFormat("The DataSift API failed to provide the format of the data. " +
                    "Please raise the issue with support", response);
        }

        if (format != null) {
            switch (format) {
                case FORMAT_NEW_LINE:
                    if (done) {
                        //chunked responses will cause new line to break
                        // early so only do it when he entire response is received
                        readLineByLine();
                    }
                    break;
                case FORMAT_ARRAY:
                    readArray();
                    break;
                case FORMAT_META:
                    readObject();
                    break;
                default:
                    throw new IllegalDataSiftPullFormat("DataSift format '" + format + "' is not supported", response);
            }
        }
    }
View Full Code Here

TOP

Related Classes of com.datasift.client.exceptions.IllegalDataSiftPullFormat

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.