1
0
mirror of https://github.com/owncloud/android-library.git synced 2025-06-07 16:06:08 +00:00

Fix some indentation issues

This commit is contained in:
davigonz 2019-02-21 10:41:56 +01:00 committed by David González Verdugo
parent 59ed7e42ec
commit 87a8b418de
2 changed files with 425 additions and 416 deletions

View File

@ -47,13 +47,13 @@ import static com.owncloud.android.lib.common.operations.RemoteOperationResult.R
/** /**
* Created by masensio on 08/10/2015. * Created by masensio on 08/10/2015.
* * <p>
* Retrieves a list of sharees (possible targets of a share) from the ownCloud server. * Retrieves a list of sharees (possible targets of a share) from the ownCloud server.
* * <p>
* Currently only handles users and groups. Users in other OC servers (federation) should be added later. * Currently only handles users and groups. Users in other OC servers (federation) should be added later.
* * <p>
* Depends on SHAREE API. {@See https://github.com/owncloud/documentation/issues/1626} * Depends on SHAREE API. {@See https://github.com/owncloud/documentation/issues/1626}
* * <p>
* Syntax: * Syntax:
* Entry point: ocs/v2.php/apps/files_sharing/api/v1/sharees * Entry point: ocs/v2.php/apps/files_sharing/api/v1/sharees
* HTTP method: GET * HTTP method: GET
@ -62,7 +62,7 @@ import static com.owncloud.android.lib.common.operations.RemoteOperationResult.R
* url argument: search - string, optional * url argument: search - string, optional
* url arguments: perPage - int, optional * url arguments: perPage - int, optional
* url arguments: page - int, optional * url arguments: page - int, optional
* * <p>
* Status codes: * Status codes:
* 100 - successful * 100 - successful
* *
@ -122,7 +122,7 @@ public class GetRemoteShareesOperation extends RemoteOperation<ArrayList<JSONObj
protected RemoteOperationResult<ArrayList<JSONObject>> run(OwnCloudClient client) { protected RemoteOperationResult<ArrayList<JSONObject>> run(OwnCloudClient client) {
RemoteOperationResult<ArrayList<JSONObject>> result; RemoteOperationResult<ArrayList<JSONObject>> result;
try{ try {
Uri requestUri = client.getBaseUri(); Uri requestUri = client.getBaseUri();
Uri.Builder uriBuilder = requestUri.buildUpon() Uri.Builder uriBuilder = requestUri.buildUpon()
.appendEncodedPath(OCS_ROUTE) .appendEncodedPath(OCS_ROUTE)
@ -139,7 +139,7 @@ public class GetRemoteShareesOperation extends RemoteOperation<ArrayList<JSONObj
int status = client.executeHttpMethod(getMethod); int status = client.executeHttpMethod(getMethod);
String response = getMethod.getResponseBodyAsString(); String response = getMethod.getResponseBodyAsString();
if(isSuccess(status)) { if (isSuccess(status)) {
Log_OC.d(TAG, "Successful response: " + response); Log_OC.d(TAG, "Successful response: " + response);
// Parse the response // Parse the response
@ -163,8 +163,8 @@ public class GetRemoteShareesOperation extends RemoteOperation<ArrayList<JSONObj
}; };
ArrayList<JSONObject> data = new ArrayList<>(); // For result data ArrayList<JSONObject> data = new ArrayList<>(); // For result data
for (int i=0; i<6; i++) { for (int i = 0; i < 6; i++) {
for(int j=0; j< jsonResults[i].length(); j++){ for (int j = 0; j < jsonResults[i].length(); j++) {
JSONObject jsonResult = jsonResults[i].getJSONObject(j); JSONObject jsonResult = jsonResults[i].getJSONObject(j);
data.add(jsonResult); data.add(jsonResult);
Log_OC.d(TAG, "*** Added item: " + jsonResult.getString(PROPERTY_LABEL)); Log_OC.d(TAG, "*** Added item: " + jsonResult.getString(PROPERTY_LABEL));
@ -174,7 +174,7 @@ public class GetRemoteShareesOperation extends RemoteOperation<ArrayList<JSONObj
result = new RemoteOperationResult<>(OK); result = new RemoteOperationResult<>(OK);
result.setData(data); result.setData(data);
Log_OC.d(TAG, "*** Get Users or groups completed " ); Log_OC.d(TAG, "*** Get Users or groups completed ");
} else { } else {
result = new RemoteOperationResult<>(getMethod); result = new RemoteOperationResult<>(getMethod);

View File

@ -39,6 +39,7 @@ import java.util.ArrayList;
/** /**
* Parser for Share API Response * Parser for Share API Response
*
* @author masensio * @author masensio
* @author David González Verdugo * @author David González Verdugo
*/ */
@ -139,6 +140,7 @@ public class ShareXMLParser {
/** /**
* Parse is as response of Share API * Parse is as response of Share API
*
* @param is * @param is
* @return List of ShareRemoteFiles * @return List of ShareRemoteFiles
* @throws XmlPullParserException * @throws XmlPullParserException
@ -165,15 +167,16 @@ public class ShareXMLParser {
/** /**
* Parse OCS node * Parse OCS node
*
* @param parser * @param parser
* @return List of ShareRemoteFiles * @return List of ShareRemoteFiles
* @throws XmlPullParserException * @throws XmlPullParserException
* @throws IOException * @throws IOException
*/ */
private ArrayList<OCShare> readOCS (XmlPullParser parser) throws XmlPullParserException, private ArrayList<OCShare> readOCS(XmlPullParser parser) throws XmlPullParserException,
IOException { IOException {
ArrayList<OCShare> shares = new ArrayList<>(); ArrayList<OCShare> shares = new ArrayList<>();
parser.require(XmlPullParser.START_TAG, ns , NODE_OCS); parser.require(XmlPullParser.START_TAG, ns, NODE_OCS);
while (parser.next() != XmlPullParser.END_TAG) { while (parser.next() != XmlPullParser.END_TAG) {
if (parser.getEventType() != XmlPullParser.START_TAG) { if (parser.getEventType() != XmlPullParser.START_TAG) {
continue; continue;
@ -194,6 +197,7 @@ public class ShareXMLParser {
/** /**
* Parse Meta node * Parse Meta node
*
* @param parser * @param parser
* @throws XmlPullParserException * @throws XmlPullParserException
* @throws IOException * @throws IOException
@ -225,6 +229,7 @@ public class ShareXMLParser {
/** /**
* Parse Data node * Parse Data node
*
* @param parser * @param parser
* @return * @return
* @throws XmlPullParserException * @throws XmlPullParserException
@ -279,6 +284,7 @@ public class ShareXMLParser {
/** /**
* Parse Element node * Parse Element node
*
* @param parser * @param parser
* @return * @return
* @throws XmlPullParserException * @throws XmlPullParserException
@ -387,14 +393,15 @@ public class ShareXMLParser {
/** /**
* Parse a node, to obtain its text. Needs readText method * Parse a node, to obtain its text. Needs readText method
*
* @param parser * @param parser
* @param node * @param node
* @return Text of the node * @return Text of the node
* @throws XmlPullParserException * @throws XmlPullParserException
* @throws IOException * @throws IOException
*/ */
private String readNode (XmlPullParser parser, String node) throws XmlPullParserException, private String readNode(XmlPullParser parser, String node) throws XmlPullParserException,
IOException{ IOException {
parser.require(XmlPullParser.START_TAG, ns, node); parser.require(XmlPullParser.START_TAG, ns, node);
String value = readText(parser); String value = readText(parser);
//Log_OC.d(TAG, "node= " + node + ", value= " + value); //Log_OC.d(TAG, "node= " + node + ", value= " + value);
@ -404,6 +411,7 @@ public class ShareXMLParser {
/** /**
* Read the text from a node * Read the text from a node
*
* @param parser * @param parser
* @return Text of the node * @return Text of the node
* @throws IOException * @throws IOException
@ -420,6 +428,7 @@ public class ShareXMLParser {
/** /**
* Skip tags in parser procedure * Skip tags in parser procedure
*
* @param parser * @param parser
* @throws XmlPullParserException * @throws XmlPullParserException
* @throws IOException * @throws IOException