Lines Matching refs:code

9  * - Redistributions of source code must retain the above copyright notice,
153 * create a <code>HeaderSet</code> object to pass to the
154 * <code>ServerRequestHandler</code> object. After the handler processes the
160 int code = ResponseCodes.OBEX_HTTP_OK;
167 code = ResponseCodes.OBEX_HTTP_REQ_TOO_LARGE;
172 code = mListener.onAbort(request, reply);
173 Log.v(TAG, "onAbort request handler return value- " + code);
174 code = validateResponseCode(code);
176 sendResponse(code, null);
181 * <code>ServerOperation</code> object to the request handler. The
182 * <code>ServerOperation</code> object will handle the rest of the request.
185 * the response code to use and send the reply. The
186 * <code>ServerOperation</code> object will always reply with a
226 * <code>ServerOperation</code> object to the request handler. The
227 * <code>ServerOperation</code> object will handle the rest of the request.
230 * the response code to use and send the reply. The
231 * <code>ServerOperation</code> object will always reply with a
252 * @param code the response code to send
256 public void sendResponse(int code, byte[] header) throws IOException {
263 data[0] = (byte)code;
269 data[0] = (byte)code;
280 * create a <code>HeaderSet</code> object to pass to the
281 * <code>ServerRequestHandler</code> object. After the handler processes the
283 * with the response code provided.
293 int code = -1;
304 code = ResponseCodes.OBEX_HTTP_REQ_TOO_LARGE;
326 code = ResponseCodes.OBEX_HTTP_UNAUTHORIZED;
334 if (code != ResponseCodes.OBEX_HTTP_UNAUTHORIZED) {
355 code = mListener.onSetPath(request, reply, backup, create);
361 code = validateResponseCode(code);
383 code = ResponseCodes.OBEX_HTTP_INTERNAL_ERROR;
390 replyData[0] = (byte)code;
397 * Write the OBEX SETPATH packet to the server. Byte 0: response code
407 * will create a <code>HeaderSet</code> object to pass to the
408 * <code>ServerRequestHandler</code> object. After the handler processes the
414 int code = ResponseCodes.OBEX_HTTP_OK;
425 code = ResponseCodes.OBEX_HTTP_REQ_TOO_LARGE;
448 code = ResponseCodes.OBEX_HTTP_UNAUTHORIZED;
455 if (code != ResponseCodes.OBEX_HTTP_UNAUTHORIZED) {
482 code = ResponseCodes.OBEX_HTTP_INTERNAL_ERROR;
494 replyData[0] = (byte)code;
501 * Write the OBEX DISCONNECT packet to the server. Byte 0: response code
511 * create a <code>HeaderSet</code> object to pass to the
512 * <code>ServerRequestHandler</code> object. After the handler processes the
514 * with the response code provided.
525 int code = -1;
547 code = ResponseCodes.OBEX_HTTP_REQ_TOO_LARGE;
570 code = ResponseCodes.OBEX_HTTP_UNAUTHORIZED;
577 if (code != ResponseCodes.OBEX_HTTP_UNAUTHORIZED) {
588 code = mListener.onConnect(request, reply);
589 code = validateResponseCode(code);
610 code = ResponseCodes.OBEX_HTTP_INTERNAL_ERROR;
616 code = ResponseCodes.OBEX_HTTP_INTERNAL_ERROR;
626 * Write the OBEX CONNECT packet to the server. Byte 0: response code
632 sendData[0] = (byte)code;
671 * Verifies that the response code is valid. If it is not valid, it will
672 * return the <code>OBEX_HTTP_INTERNAL_ERROR</code> response code.
673 * @param code the response code to check
674 * @return the valid response code or <code>OBEX_HTTP_INTERNAL_ERROR</code>
675 * if <code>code</code> is not valid
677 private int validateResponseCode(int code) {
679 if ((code >= ResponseCodes.OBEX_HTTP_OK) && (code <= ResponseCodes.OBEX_HTTP_PARTIAL)) {
680 return code;
682 if ((code >= ResponseCodes.OBEX_HTTP_MULT_CHOICE)
683 && (code <= ResponseCodes.OBEX_HTTP_USE_PROXY)) {
684 return code;
686 if ((code >= ResponseCodes.OBEX_HTTP_BAD_REQUEST)
687 && (code <= ResponseCodes.OBEX_HTTP_UNSUPPORTED_TYPE)) {
688 return code;
690 if ((code >= ResponseCodes.OBEX_HTTP_INTERNAL_ERROR)
691 && (code <= ResponseCodes.OBEX_HTTP_VERSION)) {
692 return code;
694 if ((code >= ResponseCodes.OBEX_DATABASE_FULL)
695 && (code <= ResponseCodes.OBEX_DATABASE_LOCKED)) {
696 return code;