progressBar.setMaximum((int)(file.length()/1024));
id = "file"+backend.getIdentifier();
XDataBuilder xdb = new XDataBuilder();
xdb.type ="form";
XDataFieldBuilder xdfb = new XDataFieldBuilder();
xdfb.var="stream-method";
xdfb.type="list-single";
if (Preferences.getBoolean("filetransfer","bytestreams.enable",true)) {
xdfb.addOption("http://jabber.org/protocol/bytestreams");
}
if (Preferences.getBoolean("filetransfer", "ibb.enable", true)) {
xdfb.addOption("http://jabber.org/protocol/ibb");
}
xdb.addField(xdfb.build());
XData xdata=null;
try {
xdata = xdb.build();
} catch (InstantiationException e1) {
e1.printStackTrace();