1
0
Fork 0
mirror of https://github.com/geometer/FBReaderJ.git synced 2025-10-04 18:29:23 +02:00

more refactoring: String -> ZLNetworkException (code is still not compilable)

This commit is contained in:
Nikolay Pultsin 2010-10-09 06:38:36 +01:00
parent b2f140c612
commit b5aea623a2
12 changed files with 120 additions and 101 deletions

View file

@ -26,10 +26,10 @@ import android.widget.TextView;
import android.content.DialogInterface; import android.content.DialogInterface;
import org.geometerplus.zlibrary.ui.android.R; import org.geometerplus.zlibrary.ui.android.R;
import org.geometerplus.zlibrary.ui.android.dialogs.ZLAndroidDialogManager; import org.geometerplus.zlibrary.ui.android.dialogs.ZLAndroidDialogManager;
import org.geometerplus.zlibrary.core.util.ZLBoolean3; import org.geometerplus.zlibrary.core.util.ZLBoolean3;
import org.geometerplus.zlibrary.core.network.ZLNetworkException;
import org.geometerplus.fbreader.network.authentication.NetworkAuthenticationManager; import org.geometerplus.fbreader.network.authentication.NetworkAuthenticationManager;
@ -91,17 +91,19 @@ class AuthenticationDialog extends NetworkDialog {
mgr.UserNameOption.setValue(login); mgr.UserNameOption.setValue(login);
final Runnable runnable = new Runnable() { final Runnable runnable = new Runnable() {
public void run() { public void run() {
String err = mgr.authorise(password); try {
if (err != null) { mgr.authorise(password);
} catch (ZLNetworkException e) {
mgr.logOut(); mgr.logOut();
sendError(true, false, err); sendError(true, false, e.getMessage());
return; return;
} }
if (mgr.needsInitialization()) { if (mgr.needsInitialization()) {
err = mgr.initialize(); try {
if (err != null) { mgr.initialize();
} catch (ZLNetworkException e) {
mgr.logOut(); mgr.logOut();
sendError(true, false, err); sendError(true, false, e.getMessage());
return; return;
} }
} }

View file

@ -29,9 +29,10 @@ import android.widget.TextView;
import android.content.DialogInterface; import android.content.DialogInterface;
import org.geometerplus.zlibrary.core.resources.ZLResource; import org.geometerplus.zlibrary.core.resources.ZLResource;
import org.geometerplus.zlibrary.ui.android.dialogs.ZLAndroidDialogManager; import org.geometerplus.zlibrary.core.network.ZLNetworkException;
import org.geometerplus.zlibrary.ui.android.R; import org.geometerplus.zlibrary.ui.android.R;
import org.geometerplus.zlibrary.ui.android.dialogs.ZLAndroidDialogManager;
import org.geometerplus.fbreader.network.*; import org.geometerplus.fbreader.network.*;
import org.geometerplus.fbreader.network.opds.OPDSLinkReader; import org.geometerplus.fbreader.network.opds.OPDSLinkReader;
@ -183,9 +184,13 @@ class CustomCatalogDialog extends NetworkDialog {
final Runnable loadInfoRunnable = new Runnable() { final Runnable loadInfoRunnable = new Runnable() {
public void run() { public void run() {
final ICustomNetworkLink link = (ICustomNetworkLink) myLink; String error = null;
final String err = link.reloadInfo(); try {
handler.sendMessage(handler.obtainMessage(0, err)); ((ICustomNetworkLink)myLink).reloadInfo();
} catch (ZLNetworkException e) {
error = e.getMessage();
}
handler.sendMessage(handler.obtainMessage(0, error));
} }
}; };
((ZLAndroidDialogManager)ZLAndroidDialogManager.Instance()).wait("loadingCatalogInfo", loadInfoRunnable, myActivity); ((ZLAndroidDialogManager)ZLAndroidDialogManager.Instance()).wait("loadingCatalogInfo", loadInfoRunnable, myActivity);

View file

@ -82,40 +82,46 @@ abstract class ItemsLoadingRunnable implements Runnable {
myUpdateInterval = updateIntervalMillis; myUpdateInterval = updateIntervalMillis;
} }
public abstract String doBefore(); public abstract void doBefore() throws ZLNetworkException;
public abstract void doLoading(NetworkOperationData.OnNewItemListener doWithListener) throws ZLNetworkException; public abstract void doLoading(NetworkOperationData.OnNewItemListener doWithListener) throws ZLNetworkException;
public abstract String getResourceKey(); public abstract String getResourceKey();
public final void run() { public final void run() {
String err = doBefore(); try {
if (err != null) { doBefore();
myHandler.sendFinish(err, false); } catch (ZLNetworkException e) {
myHandler.sendFinish(e.getMessage(), false);
return; return;
} }
err = doLoading(new NetworkOperationData.OnNewItemListener() { String error = null;
private long myUpdateTime; try {
private int myItemsNumber; doLoading(new NetworkOperationData.OnNewItemListener() {
public void onNewItem(INetworkLink link, NetworkLibraryItem item) { private long myUpdateTime;
myHandler.addItem(link, item); private int myItemsNumber;
++myItemsNumber; public void onNewItem(INetworkLink link, NetworkLibraryItem item) {
final long now = System.currentTimeMillis(); myHandler.addItem(link, item);
if (now > myUpdateTime) { ++myItemsNumber;
myHandler.sendUpdateItems(); final long now = System.currentTimeMillis();
myUpdateTime = now + myUpdateInterval; if (now > myUpdateTime) {
myHandler.sendUpdateItems();
myUpdateTime = now + myUpdateInterval;
}
} }
} public boolean confirmInterrupt() {
public boolean confirmInterrupt() { return confirmInterruptLoading();
return confirmInterruptLoading(); }
} public void commitItems(INetworkLink link) {
public void commitItems(INetworkLink link) { myHandler.commitItems(link);
myHandler.commitItems(link); }
} });
}); } catch (ZLNetworkException e) {
error = e.getMessage();
}
myHandler.sendUpdateItems(); myHandler.sendUpdateItems();
myHandler.ensureItemsProcessed(); myHandler.ensureItemsProcessed();
myHandler.sendFinish(err, isLoadingInterrupted()); myHandler.sendFinish(error, isLoadingInterrupted());
myHandler.ensureFinishProcessed(); myHandler.ensureFinishProcessed();
} }

View file

@ -35,6 +35,7 @@ import android.view.ContextMenu;
import org.geometerplus.zlibrary.core.resources.ZLResource; import org.geometerplus.zlibrary.core.resources.ZLResource;
import org.geometerplus.zlibrary.core.util.ZLBoolean3; import org.geometerplus.zlibrary.core.util.ZLBoolean3;
import org.geometerplus.zlibrary.core.network.ZLNetworkException;
import org.geometerplus.zlibrary.ui.android.R; import org.geometerplus.zlibrary.ui.android.R;
import org.geometerplus.zlibrary.ui.android.dialogs.ZLAndroidDialogManager; import org.geometerplus.zlibrary.ui.android.dialogs.ZLAndroidDialogManager;
@ -391,8 +392,13 @@ class NetworkBookActions extends NetworkTreeActions {
}; // end Handler }; // end Handler
final Runnable runnable = new Runnable() { final Runnable runnable = new Runnable() {
public void run() { public void run() {
String err = mgr.purchaseBook(book); String error = null;
handler.sendMessage(handler.obtainMessage(0, err)); try {
mgr.purchaseBook(book);
} catch (ZLNetworkException e) {
error = e.getMessage();
}
handler.sendMessage(handler.obtainMessage(0, error));
} }
}; // end Runnable }; // end Runnable
((ZLAndroidDialogManager)ZLAndroidDialogManager.Instance()).wait("purchaseBook", runnable, activity); ((ZLAndroidDialogManager)ZLAndroidDialogManager.Instance()).wait("purchaseBook", runnable, activity);

View file

@ -359,25 +359,26 @@ class NetworkCatalogActions extends NetworkTreeActions {
return "downloadingCatalogs"; return "downloadingCatalogs";
} }
public String doBefore() { @Override
public void doBefore() throws ZLNetworkException {
/*if (!NetworkOperationRunnable::tryConnect()) { /*if (!NetworkOperationRunnable::tryConnect()) {
return; return;
}*/ }*/
final INetworkLink link = myTree.Item.Link; final INetworkLink link = myTree.Item.Link;
if (myCheckAuthentication && link.authenticationManager() != null) { if (myCheckAuthentication && link.authenticationManager() != null) {
NetworkAuthenticationManager mgr = link.authenticationManager(); final NetworkAuthenticationManager mgr = link.authenticationManager();
AuthenticationStatus auth = mgr.isAuthorised(true); final AuthenticationStatus auth = mgr.isAuthorised(true);
if (auth.Message != null) { if (auth.Message != null) {
return auth.Message; throw new ZLNetworkException(true, auth.Message);
} }
if (auth.Status == ZLBoolean3.B3_TRUE && mgr.needsInitialization()) { if (auth.Status == ZLBoolean3.B3_TRUE && mgr.needsInitialization()) {
final String err = mgr.initialize(); try {
if (err != null) { mgr.initialize();
} catch (ZLNetworkException e) {
mgr.logOut(); mgr.logOut();
} }
} }
} }
return null;
} }
@Override @Override

View file

@ -29,8 +29,9 @@ import android.view.*;
import android.widget.BaseAdapter; import android.widget.BaseAdapter;
import org.geometerplus.zlibrary.core.resources.ZLResource; import org.geometerplus.zlibrary.core.resources.ZLResource;
import org.geometerplus.zlibrary.ui.android.R; import org.geometerplus.zlibrary.core.network.ZLNetworkException;
import org.geometerplus.zlibrary.ui.android.R;
import org.geometerplus.zlibrary.ui.android.dialogs.ZLAndroidDialogManager; import org.geometerplus.zlibrary.ui.android.dialogs.ZLAndroidDialogManager;
import org.geometerplus.fbreader.network.NetworkTree; import org.geometerplus.fbreader.network.NetworkTree;
@ -109,7 +110,12 @@ public class NetworkLibraryActivity extends NetworkBaseActivity {
private void runInitialization() { private void runInitialization() {
((ZLAndroidDialogManager)ZLAndroidDialogManager.Instance()).wait("loadingNetworkLibrary", new Runnable() { ((ZLAndroidDialogManager)ZLAndroidDialogManager.Instance()).wait("loadingNetworkLibrary", new Runnable() {
public void run() { public void run() {
final String error = NetworkView.Instance().initialize(); String error = null;
try {
NetworkView.Instance().initialize();
} catch (ZLNetworkException e) {
error = e.getMessage();
}
Initializator.this.end(error); Initializator.this.end(error);
} }
}, myActivity); }, myActivity);
@ -272,8 +278,13 @@ public class NetworkLibraryActivity extends NetworkBaseActivity {
((ZLAndroidDialogManager)ZLAndroidDialogManager.Instance()).wait("updatingCatalogsList", new Runnable() { ((ZLAndroidDialogManager)ZLAndroidDialogManager.Instance()).wait("updatingCatalogsList", new Runnable() {
public void run() { public void run() {
final String result = view.runBackgroundUpdate(true); String error = null;
handler.sendMessage(handler.obtainMessage(0, result)); try {
view.runBackgroundUpdate(true);
} catch (ZLNetworkException e) {
error = e.getMessage();
}
handler.sendMessage(handler.obtainMessage(0, error));
} }
}, this); }, this);
} }

View file

@ -125,7 +125,6 @@ public class NetworkSearchActivity extends Activity {
} }
private static class SearchRunnable extends ItemsLoadingRunnable { private static class SearchRunnable extends ItemsLoadingRunnable {
private final String myPattern; private final String myPattern;
public SearchRunnable(ItemsLoadingHandler handler, String pattern) { public SearchRunnable(ItemsLoadingHandler handler, String pattern) {
@ -137,8 +136,7 @@ public class NetworkSearchActivity extends Activity {
return "searchingNetwork"; return "searchingNetwork";
} }
public String doBefore() { public void doBefore() {
return null;
} }
public void doLoading(NetworkOperationData.OnNewItemListener doWithListener) throws ZLNetworkException { public void doLoading(NetworkOperationData.OnNewItemListener doWithListener) throws ZLNetworkException {

View file

@ -34,8 +34,9 @@ import android.os.Message;
import android.view.MenuItem; import android.view.MenuItem;
import android.view.Menu; import android.view.Menu;
import org.geometerplus.fbreader.network.*; import org.geometerplus.zlibrary.core.network.ZLNetworkException;
import org.geometerplus.fbreader.network.*;
class NetworkView { class NetworkView {
private static NetworkView ourInstance; private static NetworkView ourInstance;
@ -57,15 +58,11 @@ class NetworkView {
return myInitialized; return myInitialized;
} }
public String initialize() { public void initialize() throws ZLNetworkException {
new SQLiteNetworkDatabase(); new SQLiteNetworkDatabase();
final NetworkLibrary library = NetworkLibrary.Instance(); final NetworkLibrary library = NetworkLibrary.Instance();
final String error = library.initialize(); library.initialize();
if (error != null) {
return error;
}
library.synchronize(); library.synchronize();
myActions.add(new NetworkBookActions()); myActions.add(new NetworkBookActions());
@ -76,12 +73,10 @@ class NetworkView {
myActions.trimToSize(); myActions.trimToSize();
myInitialized = true; myInitialized = true;
return null;
} }
// This method must be called from background thread public void runBackgroundUpdate(boolean clearCache) throws ZLNetworkException {
public String runBackgroundUpdate(boolean clearCache) { NetworkLibrary.Instance().runBackgroundUpdate(clearCache);
return NetworkLibrary.Instance().runBackgroundUpdate(clearCache);
} }
// This method MUST be called from main thread // This method MUST be called from main thread

View file

@ -37,6 +37,7 @@ import org.geometerplus.zlibrary.ui.android.dialogs.ZLAndroidDialogManager;
import org.geometerplus.zlibrary.core.resources.ZLResource; import org.geometerplus.zlibrary.core.resources.ZLResource;
import org.geometerplus.zlibrary.core.util.ZLBoolean3; import org.geometerplus.zlibrary.core.util.ZLBoolean3;
import org.geometerplus.zlibrary.core.network.ZLNetworkException;
import org.geometerplus.fbreader.network.NetworkErrors; import org.geometerplus.fbreader.network.NetworkErrors;
import org.geometerplus.fbreader.network.authentication.NetworkAuthenticationManager; import org.geometerplus.fbreader.network.authentication.NetworkAuthenticationManager;
@ -148,17 +149,19 @@ class RegisterUserDialog extends NetworkDialog {
final NetworkAuthenticationManager mgr = myLink.authenticationManager(); final NetworkAuthenticationManager mgr = myLink.authenticationManager();
final Runnable runnable = new Runnable() { final Runnable runnable = new Runnable() {
public void run() { public void run() {
String err = mgr.registerUser(myLogin, myPassword, myEmail); try {
if (err != null) { mgr.registerUser(myLogin, myPassword, myEmail);
} catch (ZLNetworkException e) {
mgr.logOut(); mgr.logOut();
sendError(true, false, err); sendError(true, false, e.getMessage());
return; return;
} }
if (mgr.isAuthorised(true).Status != ZLBoolean3.B3_FALSE && mgr.needsInitialization()) { if (mgr.isAuthorised(true).Status != ZLBoolean3.B3_FALSE && mgr.needsInitialization()) {
err = mgr.initialize(); try {
if (err != null) { mgr.initialize();
} catch (ZLNetworkException e) {
mgr.logOut(); mgr.logOut();
sendError(false, false, err); sendError(false, false, e.getMessage());
return; return;
} }
} }

View file

@ -488,8 +488,7 @@ public class NetworkLibrary {
} }
// returns Error Message public void simpleSearch(String pattern, final NetworkOperationData.OnNewItemListener listener) throws ZLNetworkException {
public String simpleSearch(String pattern, final NetworkOperationData.OnNewItemListener listener) {
LinkedList<ZLNetworkRequest> requestList = new LinkedList<ZLNetworkRequest>(); LinkedList<ZLNetworkRequest> requestList = new LinkedList<ZLNetworkRequest>();
LinkedList<NetworkOperationData> dataList = new LinkedList<NetworkOperationData>(); LinkedList<NetworkOperationData> dataList = new LinkedList<NetworkOperationData>();
@ -520,15 +519,12 @@ public class NetworkLibrary {
} }
while (requestList.size() != 0) { while (requestList.size() != 0) {
final String errorMessage = ZLNetworkManager.Instance().perform(requestList); ZLNetworkManager.Instance().perform(requestList);
if (errorMessage != null) {
return errorMessage;
}
requestList.clear(); requestList.clear();
if (listener.confirmInterrupt()) { if (listener.confirmInterrupt()) {
return null; return;
} }
for (NetworkOperationData data: dataList) { for (NetworkOperationData data: dataList) {
ZLNetworkRequest request = data.resume(); ZLNetworkRequest request = data.resume();
@ -537,8 +533,6 @@ public class NetworkLibrary {
} }
} }
} }
return null;
} }
private ICustomNetworkLink.SaveLinkListener myChangesListener = new ICustomNetworkLink.SaveLinkListener() { private ICustomNetworkLink.SaveLinkListener myChangesListener = new ICustomNetworkLink.SaveLinkListener() {

View file

@ -22,6 +22,7 @@ package org.geometerplus.fbreader.network.authentication;
import java.util.HashMap; import java.util.HashMap;
import org.geometerplus.zlibrary.core.options.ZLStringOption; import org.geometerplus.zlibrary.core.options.ZLStringOption;
import org.geometerplus.zlibrary.core.network.ZLNetworkException;
import org.geometerplus.fbreader.network.*; import org.geometerplus.fbreader.network.*;
@ -60,7 +61,7 @@ public abstract class NetworkAuthenticationManager {
* Common manager methods * Common manager methods
*/ */
public abstract AuthenticationStatus isAuthorised(boolean useNetwork /* = true */); public abstract AuthenticationStatus isAuthorised(boolean useNetwork /* = true */);
public abstract String authorise(String password); // returns error message public abstract void authorise(String password) throws ZLNetworkException;
public abstract void logOut(); public abstract void logOut();
public abstract BookReference downloadReference(NetworkBookItem book); public abstract BookReference downloadReference(NetworkBookItem book);
@ -73,9 +74,8 @@ public abstract class NetworkAuthenticationManager {
return false; return false;
} }
// returns error message public void initialize() throws ZLNetworkException {
public String initialize() { throw new ZLNetworkException(NetworkErrors.ERROR_UNSUPPORTED_OPERATION);
return NetworkErrors.errorMessage(NetworkErrors.ERROR_UNSUPPORTED_OPERATION);
} }
// returns true if link must be purchased before downloading // returns true if link must be purchased before downloading
@ -83,9 +83,8 @@ public abstract class NetworkAuthenticationManager {
return true; return true;
} }
// returns error message public void purchaseBook(NetworkBookItem book) throws ZLNetworkException {
public String purchaseBook(NetworkBookItem book) { throw new ZLNetworkException(NetworkErrors.ERROR_UNSUPPORTED_OPERATION);
return NetworkErrors.errorMessage(NetworkErrors.ERROR_UNSUPPORTED_OPERATION);
} }
public String currentAccount() { public String currentAccount() {
@ -113,8 +112,8 @@ public abstract class NetworkAuthenticationManager {
return false; return false;
} }
public String registerUser(String login, String password, String email) { public void registerUser(String login, String password, String email) throws ZLNetworkException {
return NetworkErrors.errorMessage(NetworkErrors.ERROR_UNSUPPORTED_OPERATION); throw new ZLNetworkException(NetworkErrors.ERROR_UNSUPPORTED_OPERATION);
} }
/* /*
@ -124,7 +123,7 @@ public abstract class NetworkAuthenticationManager {
return false; return false;
} }
public String recoverPassword(String email) { public void recoverPassword(String email) throws ZLNetworkException {
return NetworkErrors.errorMessage(NetworkErrors.ERROR_UNSUPPORTED_OPERATION); throw new ZLNetworkException(NetworkErrors.ERROR_UNSUPPORTED_OPERATION);
} }
} }

View file

@ -24,6 +24,7 @@ import java.util.*;
import org.geometerplus.zlibrary.core.options.ZLStringOption; import org.geometerplus.zlibrary.core.options.ZLStringOption;
import org.geometerplus.zlibrary.core.util.ZLNetworkUtil; import org.geometerplus.zlibrary.core.util.ZLNetworkUtil;
import org.geometerplus.zlibrary.core.network.ZLNetworkManager; import org.geometerplus.zlibrary.core.network.ZLNetworkManager;
import org.geometerplus.zlibrary.core.network.ZLNetworkException;
import org.geometerplus.zlibrary.core.network.ZLNetworkRequest; import org.geometerplus.zlibrary.core.network.ZLNetworkRequest;
import org.geometerplus.fbreader.network.*; import org.geometerplus.fbreader.network.*;
@ -95,10 +96,10 @@ public class LitResAuthenticationManager extends NetworkAuthenticationManager {
} }
@Override @Override
public String authorise(String password) { public void authorise(String password) throws ZLNetworkException {
String url = Link.getLink(INetworkLink.URL_SIGN_IN); String url = Link.getLink(INetworkLink.URL_SIGN_IN);
if (url == null) { if (url == null) {
return NetworkErrors.errorMessage(NetworkErrors.ERROR_UNSUPPORTED_OPERATION); throw new ZLNetworkException(NetworkErrors.ERROR_UNSUPPORTED_OPERATION);
} }
final String login; final String login;
synchronized (this) { synchronized (this) {
@ -168,7 +169,7 @@ public class LitResAuthenticationManager extends NetworkAuthenticationManager {
} }
@Override @Override
public String purchaseBook(NetworkBookItem book) { public void purchaseBook(NetworkBookItem book) throws ZLNetworkException {
final String sid; final String sid;
synchronized (this) { synchronized (this) {
sid = mySidOption.getValue(); sid = mySidOption.getValue();
@ -285,17 +286,17 @@ public class LitResAuthenticationManager extends NetworkAuthenticationManager {
} }
@Override @Override
public String initialize() { public void initialize() throws ZLNetworkException {
final String sid; final String sid;
final LitResNetworkRequest purchasedBooksRequest; final LitResNetworkRequest purchasedBooksRequest;
final LitResNetworkRequest accountRequest; final LitResNetworkRequest accountRequest;
synchronized (this) { synchronized (this) {
sid = mySidOption.getValue(); sid = mySidOption.getValue();
if (sid.length() == 0) { if (sid.length() == 0) {
return NetworkErrors.errorMessage(NetworkErrors.ERROR_AUTHENTICATION_FAILED); throw new ZLNetworkException(NetworkErrors.ERROR_AUTHENTICATION_FAILED);
} }
if (sid.equals(myInitializedDataSid)) { if (sid.equals(myInitializedDataSid)) {
return null; return;
} }
purchasedBooksRequest = loadPurchasedBooks(); purchasedBooksRequest = loadPurchasedBooks();
@ -317,7 +318,6 @@ public class LitResAuthenticationManager extends NetworkAuthenticationManager {
myInitializedDataSid = sid; myInitializedDataSid = sid;
loadPurchasedBooksOnSuccess(purchasedBooksRequest); loadPurchasedBooksOnSuccess(purchasedBooksRequest);
loadAccountOnSuccess(accountRequest); loadAccountOnSuccess(accountRequest);
return null;
} }
} }
@ -380,10 +380,10 @@ public class LitResAuthenticationManager extends NetworkAuthenticationManager {
} }
@Override @Override
public String registerUser(String login, String password, String email) { public void registerUser(String login, String password, String email) throws ZLNetworkException {
String url = Link.getLink(INetworkLink.URL_SIGN_UP); String url = Link.getLink(INetworkLink.URL_SIGN_UP);
if (url == null) { if (url == null) {
return NetworkErrors.errorMessage(NetworkErrors.ERROR_UNSUPPORTED_OPERATION); throw new ZLNetworkException(NetworkErrors.ERROR_UNSUPPORTED_OPERATION);
} }
url = ZLNetworkUtil.appendParameter(url, "new_login", login); url = ZLNetworkUtil.appendParameter(url, "new_login", login);
url = ZLNetworkUtil.appendParameter(url, "new_pwd1", password); url = ZLNetworkUtil.appendParameter(url, "new_pwd1", password);
@ -401,7 +401,6 @@ public class LitResAuthenticationManager extends NetworkAuthenticationManager {
} }
mySidOption.setValue(xmlReader.Sid); mySidOption.setValue(xmlReader.Sid);
mySidUserNameOption.setValue(login); mySidUserNameOption.setValue(login);
return null;
} }
} }
@ -412,13 +411,13 @@ public class LitResAuthenticationManager extends NetworkAuthenticationManager {
} }
@Override @Override
public String recoverPassword(String email) { public void recoverPassword(String email) throws ZLNetworkException {
String url = Link.getLink(INetworkLink.URL_RECOVER_PASSWORD); String url = Link.getLink(INetworkLink.URL_RECOVER_PASSWORD);
if (url == null) { if (url == null) {
return NetworkErrors.errorMessage(NetworkErrors.ERROR_UNSUPPORTED_OPERATION); throw new ZLNetworkException(NetworkErrors.ERROR_UNSUPPORTED_OPERATION);
} }
url = ZLNetworkUtil.appendParameter(url, "mail", email); url = ZLNetworkUtil.appendParameter(url, "mail", email);
final LitResPasswordRecoveryXMLReader xmlReader = new LitResPasswordRecoveryXMLReader(Link.getSiteName()); final LitResPasswordRecoveryXMLReader xmlReader = new LitResPasswordRecoveryXMLReader(Link.getSiteName());
return ZLNetworkManager.Instance().perform(new LitResNetworkRequest(url, SSLCertificate, xmlReader)); ZLNetworkManager.Instance().perform(new LitResNetworkRequest(url, SSLCertificate, xmlReader));
} }
} }