mirror of
https://github.com/owncloud/android-library.git
synced 2026-08-21 05:13:05 +00:00
Add Log_OC class and update the log references
This commit is contained in:
@@ -31,12 +31,11 @@ import java.util.ArrayList;
|
||||
import org.apache.commons.httpclient.methods.PostMethod;
|
||||
import org.apache.http.HttpStatus;
|
||||
|
||||
import android.util.Log;
|
||||
|
||||
import com.owncloud.android.lib.common.OwnCloudClient;
|
||||
import com.owncloud.android.lib.common.operations.RemoteOperation;
|
||||
import com.owncloud.android.lib.common.operations.RemoteOperationResult;
|
||||
import com.owncloud.android.lib.common.operations.RemoteOperationResult.ResultCode;
|
||||
import com.owncloud.android.lib.common.utils.Log_OC;
|
||||
|
||||
/**
|
||||
* Creates a new share. This allows sharing with a user or group or as a link.
|
||||
@@ -103,7 +102,7 @@ public class CreateRemoteShareOperation extends RemoteOperation {
|
||||
try {
|
||||
// Post Method
|
||||
post = new PostMethod(client.getBaseUri() + ShareUtils.SHARING_API_PATH);
|
||||
//Log.d(TAG, "URL ------> " + client.getBaseUri() + ShareUtils.SHARING_API_PATH);
|
||||
//Log_OC.d(TAG, "URL ------> " + client.getBaseUri() + ShareUtils.SHARING_API_PATH);
|
||||
|
||||
post.setRequestHeader( "Content-Type", "application/x-www-form-urlencoded; charset=utf-8"); // necessary for special characters
|
||||
post.addParameter(PARAM_PATH, mRemoteFilePath);
|
||||
@@ -131,7 +130,7 @@ public class CreateRemoteShareOperation extends RemoteOperation {
|
||||
mShares = xmlParser.parseXMLResponse(is);
|
||||
if (xmlParser.isSuccess()) {
|
||||
if (mShares != null) {
|
||||
Log.d(TAG, "Created " + mShares.size() + " share(s)");
|
||||
Log_OC.d(TAG, "Created " + mShares.size() + " share(s)");
|
||||
result = new RemoteOperationResult(ResultCode.OK);
|
||||
ArrayList<Object> sharesObjects = new ArrayList<Object>();
|
||||
for (OCShare share: mShares) {
|
||||
@@ -155,7 +154,7 @@ public class CreateRemoteShareOperation extends RemoteOperation {
|
||||
|
||||
} catch (Exception e) {
|
||||
result = new RemoteOperationResult(e);
|
||||
Log.e(TAG, "Exception while Creating New Share", e);
|
||||
Log_OC.e(TAG, "Exception while Creating New Share", e);
|
||||
|
||||
} finally {
|
||||
if (post != null) {
|
||||
|
||||
@@ -32,12 +32,11 @@ import org.apache.commons.httpclient.NameValuePair;
|
||||
import org.apache.commons.httpclient.methods.GetMethod;
|
||||
import org.apache.http.HttpStatus;
|
||||
|
||||
import android.util.Log;
|
||||
|
||||
import com.owncloud.android.lib.common.OwnCloudClient;
|
||||
import com.owncloud.android.lib.common.operations.RemoteOperation;
|
||||
import com.owncloud.android.lib.common.operations.RemoteOperationResult;
|
||||
import com.owncloud.android.lib.common.operations.RemoteOperationResult.ResultCode;
|
||||
import com.owncloud.android.lib.common.utils.Log_OC;
|
||||
|
||||
/**
|
||||
* Provide a list shares for a specific file.
|
||||
@@ -110,7 +109,7 @@ public class GetRemoteSharesForFileOperation extends RemoteOperation {
|
||||
ShareXMLParser xmlParser = new ShareXMLParser();
|
||||
mShares = xmlParser.parseXMLResponse(is);
|
||||
if (mShares != null) {
|
||||
Log.d(TAG, "Got " + mShares.size() + " shares");
|
||||
Log_OC.d(TAG, "Got " + mShares.size() + " shares");
|
||||
result = new RemoteOperationResult(ResultCode.OK);
|
||||
ArrayList<Object> sharesObjects = new ArrayList<Object>();
|
||||
for (OCShare share: mShares) {
|
||||
@@ -129,7 +128,7 @@ public class GetRemoteSharesForFileOperation extends RemoteOperation {
|
||||
|
||||
} catch (Exception e) {
|
||||
result = new RemoteOperationResult(e);
|
||||
Log.e(TAG, "Exception while getting shares", e);
|
||||
Log_OC.e(TAG, "Exception while getting shares", e);
|
||||
|
||||
} finally {
|
||||
if (get != null) {
|
||||
|
||||
@@ -35,8 +35,7 @@ import com.owncloud.android.lib.common.OwnCloudClient;
|
||||
import com.owncloud.android.lib.common.operations.RemoteOperation;
|
||||
import com.owncloud.android.lib.common.operations.RemoteOperationResult;
|
||||
import com.owncloud.android.lib.common.operations.RemoteOperationResult.ResultCode;
|
||||
|
||||
import android.util.Log;
|
||||
import com.owncloud.android.lib.common.utils.Log_OC;
|
||||
|
||||
|
||||
/**
|
||||
@@ -78,7 +77,7 @@ public class GetRemoteSharesOperation extends RemoteOperation {
|
||||
ShareXMLParser xmlParser = new ShareXMLParser();
|
||||
mShares = xmlParser.parseXMLResponse(is);
|
||||
if (mShares != null) {
|
||||
Log.d(TAG, "Got " + mShares.size() + " shares");
|
||||
Log_OC.d(TAG, "Got " + mShares.size() + " shares");
|
||||
result = new RemoteOperationResult(ResultCode.OK);
|
||||
ArrayList<Object> sharesObjects = new ArrayList<Object>();
|
||||
for (OCShare share: mShares) {
|
||||
@@ -92,7 +91,7 @@ public class GetRemoteSharesOperation extends RemoteOperation {
|
||||
|
||||
} catch (Exception e) {
|
||||
result = new RemoteOperationResult(e);
|
||||
Log.e(TAG, "Exception while getting remote shares ", e);
|
||||
Log_OC.e(TAG, "Exception while getting remote shares ", e);
|
||||
|
||||
} finally {
|
||||
if (get != null) {
|
||||
|
||||
@@ -26,11 +26,11 @@ package com.owncloud.android.lib.resources.shares;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
import com.owncloud.android.lib.resources.files.FileUtils;
|
||||
|
||||
import android.os.Parcel;
|
||||
import android.os.Parcelable;
|
||||
import android.util.Log;
|
||||
|
||||
import com.owncloud.android.lib.common.utils.Log_OC;
|
||||
import com.owncloud.android.lib.resources.files.FileUtils;
|
||||
|
||||
|
||||
/**
|
||||
@@ -70,7 +70,7 @@ public class OCShare implements Parcelable, Serializable {
|
||||
public OCShare(String path) {
|
||||
resetData();
|
||||
if (path == null || path.length() <= 0 || !path.startsWith(FileUtils.PATH_SEPARATOR)) {
|
||||
Log.e(TAG, "Trying to create a OCShare with a non valid path");
|
||||
Log_OC.e(TAG, "Trying to create a OCShare with a non valid path");
|
||||
throw new IllegalArgumentException("Trying to create a OCShare with a non valid path: " + path);
|
||||
}
|
||||
mPath = path;
|
||||
|
||||
@@ -30,12 +30,11 @@ import java.io.InputStream;
|
||||
import org.apache.commons.httpclient.HttpStatus;
|
||||
import org.apache.jackrabbit.webdav.client.methods.DeleteMethod;
|
||||
|
||||
import android.util.Log;
|
||||
|
||||
import com.owncloud.android.lib.common.OwnCloudClient;
|
||||
import com.owncloud.android.lib.common.operations.RemoteOperation;
|
||||
import com.owncloud.android.lib.common.operations.RemoteOperationResult;
|
||||
import com.owncloud.android.lib.common.operations.RemoteOperationResult.ResultCode;
|
||||
import com.owncloud.android.lib.common.utils.Log_OC;
|
||||
|
||||
/**
|
||||
* Remove a share
|
||||
@@ -94,13 +93,13 @@ public class RemoveRemoteShareOperation extends RemoteOperation {
|
||||
result = new RemoteOperationResult(false, status, delete.getResponseHeaders());
|
||||
}
|
||||
|
||||
Log.d(TAG, "Unshare " + id + ": " + result.getLogMessage());
|
||||
Log_OC.d(TAG, "Unshare " + id + ": " + result.getLogMessage());
|
||||
} else {
|
||||
result = new RemoteOperationResult(false, status, delete.getResponseHeaders());
|
||||
}
|
||||
} catch (Exception e) {
|
||||
result = new RemoteOperationResult(e);
|
||||
Log.e(TAG, "Unshare Link Exception " + result.getLogMessage(), e);
|
||||
Log_OC.e(TAG, "Unshare Link Exception " + result.getLogMessage(), e);
|
||||
|
||||
} finally {
|
||||
if (delete != null)
|
||||
|
||||
@@ -182,7 +182,7 @@ public class ShareXMLParser {
|
||||
*/
|
||||
private void readMeta(XmlPullParser parser) throws XmlPullParserException, IOException {
|
||||
parser.require(XmlPullParser.START_TAG, ns, NODE_META);
|
||||
//Log.d(TAG, "---- NODE META ---");
|
||||
//Log_OC.d(TAG, "---- NODE META ---");
|
||||
while (parser.next() != XmlPullParser.END_TAG) {
|
||||
if (parser.getEventType() != XmlPullParser.START_TAG) {
|
||||
continue;
|
||||
@@ -214,7 +214,7 @@ public class ShareXMLParser {
|
||||
OCShare share = null;
|
||||
|
||||
parser.require(XmlPullParser.START_TAG, ns, NODE_DATA);
|
||||
//Log.d(TAG, "---- NODE DATA ---");
|
||||
//Log_OC.d(TAG, "---- NODE DATA ---");
|
||||
while (parser.next() != XmlPullParser.END_TAG) {
|
||||
if (parser.getEventType() != XmlPullParser.START_TAG) {
|
||||
continue;
|
||||
@@ -264,7 +264,7 @@ public class ShareXMLParser {
|
||||
|
||||
OCShare share = new OCShare();
|
||||
|
||||
//Log.d(TAG, "---- NODE ELEMENT ---");
|
||||
//Log_OC.d(TAG, "---- NODE ELEMENT ---");
|
||||
while (parser.next() != XmlPullParser.END_TAG) {
|
||||
if (parser.getEventType() != XmlPullParser.START_TAG) {
|
||||
continue;
|
||||
@@ -360,7 +360,7 @@ public class ShareXMLParser {
|
||||
private String readNode (XmlPullParser parser, String node) throws XmlPullParserException, IOException{
|
||||
parser.require(XmlPullParser.START_TAG, ns, node);
|
||||
String value = readText(parser);
|
||||
//Log.d(TAG, "node= " + node + ", value= " + value);
|
||||
//Log_OC.d(TAG, "node= " + node + ", value= " + value);
|
||||
parser.require(XmlPullParser.END_TAG, ns, node);
|
||||
return value;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user