()
| 187 | } |
| 188 | |
| 189 | public final void exportData() { |
| 190 | StringBuffer body = new StringBuffer(); |
| 191 | |
| 192 | getAccounts(); |
| 193 | |
| 194 | for (int i = 0; i < getItemCount(); i++) { |
| 195 | Account a = getAccount(i); |
| 196 | StringBuffer account = new StringBuffer("<a>"); |
| 197 | account.append(createBlock(userName, a.JID.getNode())) |
| 198 | .append(createBlock(server, a.JID.getServer())) |
| 199 | .append(createBlock(hostAddr, a.hostAddr)) |
| 200 | .append(createBlock(port, Integer.toString(a.port))) |
| 201 | .append(createBlock(nick, a.nick)) |
| 202 | .append(createBlock(resource, a.JID.resource)) |
| 203 | .append(createBlock(useSSL, "0")) |
| 204 | .append(createBlock(plainAuth, (a.plainAuth ? "1" : "0"))) |
| 205 | .append(createBlock(mucOnly, (a.mucOnly ? "1" : "0"))) |
| 206 | //#if HTTPPOLL || HTTPCONNECT || HTTPBIND |
| 207 | //# .append(createBlock(enableProxy, a.isEnableProxy() ? "1" : "0")).append(createBlock(proxyHostAddr, a.proxyHostAddr)).append(createBlock(proxyPort, Integer.toString(a.getProxyPort()))) |
| 208 | //#endif |
| 209 | .append(createBlock(compression, (a.useCompression() ? "1" : "0"))).append(createBlock(keepAliveType, "")).append(createBlock(keepAlivePeriod, Integer.toString(a.keepAlivePeriod))) |
| 210 | //#ifdef HTTPCONNECT |
| 211 | //# .append(createBlock(proxyUser, a.getProxyUser())).append(createBlock(proxyPass, a.getProxyPass())) |
| 212 | //#endif |
| 213 | .append("</a>\r\n"); |
| 214 | body.append(account); |
| 215 | } |
| 216 | |
| 217 | FileIO fileIO = FileIO.createConnection(file + "accounts_" + Time.localDate() + ".txt"); |
| 218 | fileIO.fileWriteUtf(body.toString()); |
| 219 | } |
| 220 | |
| 221 | private void getAccounts() { |
| 222 | Account a; |
no test coverage detected