1
/******************************************************************************
2
* OpenLP - Open Source Lyrics Projection *
3
* --------------------------------------------------------------------------- *
4
* Copyright (c) 2011-2013 Raoul Snyman *
5
* Portions copyright (c) 2011-2013 Tim Bentley, Johan Mynhardt, Samuel *
7
* --------------------------------------------------------------------------- *
8
* This program is free software; you can redistribute it and/or modify it *
9
* under the terms of the GNU General Public License as published by the Free *
10
* Software Foundation; version 2 of the License. *
12
* This program is distributed in the hope that it will be useful, but WITHOUT *
13
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or *
14
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for *
17
* You should have received a copy of the GNU General Public License along *
18
* with this program; if not, write to the Free Software Foundation, Inc., 59 *
19
* Temple Place, Suite 330, Boston, MA 02111-1307 USA *
20
*******************************************************************************/
21
package org.openlp.android2.common;
23
import android.content.Context;
24
import org.openlp.android2.R;
26
public class OpenLPHttpReturn {
27
private int return_code = 0;
28
private String data = null;
29
private Context context;
31
public OpenLPHttpReturn() {
32
this.return_code = 401;
37
public OpenLPHttpReturn(int return_code, String data, Context context) {
38
this.return_code = return_code;
40
this.context = context;
43
public String getData() {
47
public boolean isError() {
48
return return_code != 0;
51
public String getErrorMessage(String message) {
52
return return_code == 401 ? this.context.getString(R.string.httpreturn_unauthorised) : message;
56
public String toString() {
57
return "HttpReturn{" + "data='" + data + '\'' + ", return code=" + return_code + '}';