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

Method exportData

src/main/java/IE/Accounts.java:189–219  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

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;

Callers 1

AccountsMethod · 0.95

Calls 12

getAccountsMethod · 0.95
getItemCountMethod · 0.95
getAccountMethod · 0.95
createBlockMethod · 0.95
useCompressionMethod · 0.95
createConnectionMethod · 0.95
localDateMethod · 0.95
fileWriteUtfMethod · 0.95
appendMethod · 0.80
getServerMethod · 0.80
getNodeMethod · 0.45
toStringMethod · 0.45

Tested by

no test coverage detected