diff --git a/src/com/owncloud/android/lib/resources/shares/GetRemoteSharesForFileOperation.java b/src/com/owncloud/android/lib/resources/shares/GetRemoteSharesForFileOperation.java index e5ae83f9..5e4eb7d5 100644 --- a/src/com/owncloud/android/lib/resources/shares/GetRemoteSharesForFileOperation.java +++ b/src/com/owncloud/android/lib/resources/shares/GetRemoteSharesForFileOperation.java @@ -74,8 +74,8 @@ public class GetRemoteSharesForFileOperation extends RemoteOperation { @Override protected RemoteOperationResult run(OwnCloudClient client) { - RemoteOperationResult result = null; - int status = -1; + RemoteOperationResult result; + int status; GetMethod get = null; @@ -132,5 +132,4 @@ public class GetRemoteSharesForFileOperation extends RemoteOperation { private boolean isSuccess(int status) { return (status == HttpStatus.SC_OK); } - -} +} \ No newline at end of file diff --git a/src/com/owncloud/android/lib/resources/shares/ShareToRemoteOperationResultParser.java b/src/com/owncloud/android/lib/resources/shares/ShareToRemoteOperationResultParser.java index 3b37c035..45fcb186 100644 --- a/src/com/owncloud/android/lib/resources/shares/ShareToRemoteOperationResultParser.java +++ b/src/com/owncloud/android/lib/resources/shares/ShareToRemoteOperationResultParser.java @@ -1,6 +1,7 @@ /* ownCloud Android Library is available under MIT license * @author David A. Velasco - * Copyright (C) 2016 ownCloud GmbH. + * @author David González Verdugo + * Copyright (C) 2018 ownCloud GmbH. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -70,7 +71,7 @@ public class ShareToRemoteOperationResultParser { return new RemoteOperationResult(RemoteOperationResult.ResultCode.WRONG_SERVER_RESPONSE); } - RemoteOperationResult result = null; + RemoteOperationResult result; ArrayList resultData = new ArrayList(); try { diff --git a/src/com/owncloud/android/lib/resources/shares/ShareUtils.java b/src/com/owncloud/android/lib/resources/shares/ShareUtils.java index 50c2be86..cb355855 100644 --- a/src/com/owncloud/android/lib/resources/shares/ShareUtils.java +++ b/src/com/owncloud/android/lib/resources/shares/ShareUtils.java @@ -1,5 +1,5 @@ /* ownCloud Android Library is available under MIT license - * Copyright (C) 2016 ownCloud GmbH. + * Copyright (C) 2018 ownCloud GmbH. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -30,13 +30,14 @@ import com.owncloud.android.lib.resources.status.OwnCloudVersion; * Contains Constants for Share Operation * * @author masensio + * @author David González Verdugo * */ public class ShareUtils { // OCS Route - public static final String SHARING_API_PATH ="ocs/v1.php/apps/files_sharing/api/v1/shares"; + public static final String SHARING_API_PATH ="ocs/v2.php/apps/files_sharing/api/v1/shares"; // String to build the link with the token of a share: public static final String SHARING_LINK_PATH_BEFORE_VERSION_8 = "/public.php?service=files&t="; @@ -49,5 +50,4 @@ public class ShareUtils { return SHARING_LINK_PATH_BEFORE_VERSION_8; } } - -} +} \ No newline at end of file diff --git a/src/com/owncloud/android/lib/resources/shares/ShareXMLParser.java b/src/com/owncloud/android/lib/resources/shares/ShareXMLParser.java index 70891a4f..ef2337eb 100644 --- a/src/com/owncloud/android/lib/resources/shares/ShareXMLParser.java +++ b/src/com/owncloud/android/lib/resources/shares/ShareXMLParser.java @@ -1,5 +1,5 @@ /* ownCloud Android Library is available under MIT license - * Copyright (C) 2016 ownCloud GmbH. + * Copyright (C) 2018 ownCloud GmbH. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -41,7 +41,7 @@ import com.owncloud.android.lib.resources.files.FileUtils; /** * Parser for Share API Response * @author masensio - * + * @author David González Verdugo */ public class ShareXMLParser { @@ -82,7 +82,7 @@ public class ShareXMLParser { private static final String TYPE_FOLDER = "folder"; - private static final int SUCCESS = 100; + private static final int SUCCESS = 200; private static final int ERROR_WRONG_PARAMETER = 400; private static final int ERROR_FORBIDDEN = 403; private static final int ERROR_NOT_FOUND = 404; @@ -172,7 +172,7 @@ public class ShareXMLParser { */ private ArrayList readOCS (XmlPullParser parser) throws XmlPullParserException, IOException { - ArrayList shares = new ArrayList(); + ArrayList shares = new ArrayList<>(); parser.require(XmlPullParser.START_TAG, ns , NODE_OCS); while (parser.next() != XmlPullParser.END_TAG) { if (parser.getEventType() != XmlPullParser.START_TAG) { @@ -190,8 +190,6 @@ public class ShareXMLParser { } return shares; - - } /** @@ -439,5 +437,4 @@ public class ShareXMLParser { } } } - -} +} \ No newline at end of file diff --git a/src/com/owncloud/android/lib/resources/status/GetRemoteCapabilitiesOperation.java b/src/com/owncloud/android/lib/resources/status/GetRemoteCapabilitiesOperation.java index a3c77e26..d59a32de 100644 --- a/src/com/owncloud/android/lib/resources/status/GetRemoteCapabilitiesOperation.java +++ b/src/com/owncloud/android/lib/resources/status/GetRemoteCapabilitiesOperation.java @@ -50,7 +50,7 @@ public class GetRemoteCapabilitiesOperation extends RemoteOperation { // OCS Routes - private static final String OCS_ROUTE = "ocs/v1.php/cloud/capabilities"; + private static final String OCS_ROUTE = "ocs/v2.php/cloud/capabilities"; // Arguments - names private static final String PARAM_FORMAT = "format"; diff --git a/src/com/owncloud/android/lib/resources/users/GetRemoteUserInfoOperation.java b/src/com/owncloud/android/lib/resources/users/GetRemoteUserInfoOperation.java index ef0f4c04..12e0486b 100644 --- a/src/com/owncloud/android/lib/resources/users/GetRemoteUserInfoOperation.java +++ b/src/com/owncloud/android/lib/resources/users/GetRemoteUserInfoOperation.java @@ -48,7 +48,7 @@ public class GetRemoteUserInfoOperation extends RemoteOperation { private static final String TAG = GetRemoteUserInfoOperation.class.getSimpleName(); // OCS Route - private static final String OCS_ROUTE = "/ocs/v1.php/cloud/user?format=json"; + private static final String OCS_ROUTE = "/ocs/v2.php/cloud/user?format=json"; // JSON Node names private static final String NODE_OCS = "ocs"; @@ -125,5 +125,4 @@ public class GetRemoteUserInfoOperation extends RemoteOperation { public String mDisplayName = ""; public String mEmail = ""; } - -} +} \ No newline at end of file