private void handleXMPPException(XMPPErrorException e) { StanzaError error = e.getStanzaError(); if (error != null) { switch (error.getCondition()) { case forbidden: setStatus(Status.refused); return; case bad_request: setStatus(Status.error); setError(Error.not_acceptable); break; default: setStatus(FileTransfer.Status.error); } } setException(e); }
} catch (FileNotFoundException e) { setStatus(FileTransfer.Status.error); setError(Error.bad_file); setException(e); } catch (IOException e) {
} catch (FileNotFoundException e) { setStatus(FileTransfer.Status.error); setError(Error.bad_file); setException(e); } catch (XMPPException e) {
} catch (FileNotFoundException e) { setStatus(FileTransfer.Status.error); setError(Error.bad_file); setException(e); } catch (XMPPException e) {
} catch (FileNotFoundException e) { setStatus(Status.error); setError(Error.bad_file); setException(e); } catch (XMPPException e) {
} catch (FileNotFoundException e) { setStatus(FileTransfer.Status.ERROR); setError(Error.BAD_FILE); setException(e); } catch (XMPPException e) {
private void handleXMPPException(XMPPException e) { setStatus(FileTransfer.Status.ERROR); XMPPError error = e.getXMPPError(); if (error != null) { int code = error.getCode(); if (code == 403) { setStatus(Status.REFUSED); return; } else if (code == 400) { setStatus(Status.ERROR); setError(Error.NOT_ACCEPTABLE); } } setException(e); return; }
private void handleXMPPException(XMPPException e) { XMPPError error = e.getXMPPError(); if (error != null) { int code = error.getCode(); if (code == 403) { setStatus(Status.refused); return; } else if (code == 400) { setStatus(Status.error); setError(Error.not_acceptable); } else { setStatus(FileTransfer.Status.error); } } setException(e); }
private void handleXMPPException(XMPPException e) { XMPPError error = e.getXMPPError(); if (error != null) { int code = error.getCode(); if (code == 403) { setStatus(Status.refused); return; } else if (code == 400) { setStatus(Status.error); setError(Error.not_acceptable); } else { setStatus(FileTransfer.Status.error); } } setException(e); }
private void handleXMPPException(XMPPException e) { XMPPError error = e.getXMPPError(); if (error != null) { int code = error.getCode(); if (code == 403) { setStatus(Status.refused); return; } else if (code == 400) { setStatus(Status.error); setError(Error.not_acceptable); } else { setStatus(Status.error); } } setException(e); }
private OutputStream negotiateStream(String fileName, long fileSize, String description) throws XMPPException { // Negotiate the file transfer profile setStatus(Status.NEGOTIATING_TRANSFER); StreamNegotiator streamNegotiator = negotiator.negotiateOutgoingTransfer( getPeer(), streamID, fileName, fileSize, description, RESPONSE_TIMEOUT); if (streamNegotiator == null) { setStatus(Status.ERROR); setError(Error.NO_RESPONSE); return null; } if (!getStatus().equals(Status.NEGOTIATING_TRANSFER)) { return null; } // Negotiate the stream setStatus(Status.NEGOTIATING_STREAM); outputStream = streamNegotiator.createOutgoingStream(streamID, initiator, getPeer()); if (!getStatus().equals(Status.NEGOTIATING_STREAM)) { return null; } setStatus(Status.NEGOTIATED); return outputStream; }
private OutputStream negotiateStream(String fileName, long fileSize, String description) throws XMPPException { // Negotiate the file transfer profile if (!updateStatus(Status.initial, Status.negotiating_transfer)) { throw new XMPPException("Illegal state change"); } StreamNegotiator streamNegotiator = negotiator.negotiateOutgoingTransfer( getPeer(), streamID, fileName, fileSize, description, RESPONSE_TIMEOUT); if (streamNegotiator == null) { setStatus(Status.error); setError(Error.no_response); return null; } // Negotiate the stream if (!updateStatus(Status.negotiating_transfer, Status.negotiating_stream)) { throw new XMPPException("Illegal state change"); } outputStream = streamNegotiator.createOutgoingStream(streamID, initiator, getPeer()); if (!updateStatus(Status.negotiating_stream, Status.negotiated)) { throw new XMPPException("Illegal state change"); } return outputStream; }
private OutputStream negotiateStream(String fileName, long fileSize, String description) throws XMPPException { // Negotiate the file transfer profile if (!updateStatus(Status.initial, Status.negotiating_transfer)) { throw new XMPPException("Illegal state change"); } StreamNegotiator streamNegotiator = negotiator.negotiateOutgoingTransfer( getPeer(), streamID, fileName, fileSize, description, RESPONSE_TIMEOUT); if (streamNegotiator == null) { setStatus(Status.error); setError(Error.no_response); return null; } // Negotiate the stream if (!updateStatus(Status.negotiating_transfer, Status.negotiating_stream)) { throw new XMPPException("Illegal state change"); } outputStream = streamNegotiator.createOutgoingStream(streamID, initiator, getPeer()); if (!updateStatus(Status.negotiating_stream, Status.negotiated)) { throw new XMPPException("Illegal state change"); } return outputStream; }
private OutputStream negotiateStream(String fileName, long fileSize, String description) throws XMPPException { // Negotiate the file transfer profile if (!updateStatus(Status.initial, Status.negotiating_transfer)) { throw new XMPPException("Illegal state change"); } StreamNegotiator streamNegotiator = negotiator.negotiateOutgoingTransfer( getPeer(), streamID, fileName, fileSize, description, RESPONSE_TIMEOUT); if (streamNegotiator == null) { setStatus(Status.error); setError(Error.no_response); return null; } // Negotiate the stream if (!updateStatus(Status.negotiating_transfer, Status.negotiating_stream)) { throw new XMPPException("Illegal state change"); } outputStream = streamNegotiator.createOutgoingStream(streamID, initiator, getPeer()); if (!updateStatus(Status.negotiating_stream, Status.negotiated)) { throw new XMPPException("Illegal state change"); } return outputStream; }