MCPcopy Create free account
hub / github.com/BombusMod/BombusMod / accept

Method accept

src/main/java/io/file/transfer/TransferTask.java:192–219  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

190 }
191
192 void accept() {
193 String[] methodNames = new String[2];
194 /* methodNames[0] = TransferDispatcher.NS_BYTESTREAMS;
195 methodNames[1] = TransferDispatcher.NS_IBB;*/
196 methodNames[0] = TransferDispatcher.NS_IBB;
197 for (int i = 0; i < methodNames.length; i++) {
198 String nextMethod = methodNames[i];
199 if (methods.indexOf(nextMethod) >= 0) {
200 method = nextMethod;
201 break;
202 }
203 }
204 if (method.length() != 0) {
205 started = System.currentTimeMillis();
206 new Thread(this).start();
207 } else {
208 JabberDataBlock badreq = new Iq(jid.toString(), Iq.TYPE_ERROR, id);
209 JabberDataBlock err = new XmppError(XmppError.BAD_REQUEST, "no known methods").construct();
210 JabberDataBlock novalid = new JabberDataBlock("no-valid-streams");
211 novalid.setNameSpace(TransferDispatcher.NS_SI);
212 err.addChild(novalid);
213 badreq.addChild(err);
214 TransferDispatcher.getInstance().send(badreq, false);
215 state = ERROR;
216 errMsg = SR.MS_REJECTED;
217 showEvent = true;
218 }
219 }
220
221 void writeFile(byte b[]) {
222 try {

Callers 2

TransferAcceptFileMethod · 0.45
cmdOkMethod · 0.45

Calls 7

setNameSpaceMethod · 0.95
addChildMethod · 0.95
getInstanceMethod · 0.95
constructMethod · 0.80
startMethod · 0.45
toStringMethod · 0.45
sendMethod · 0.45

Tested by

no test coverage detected