mirror of
https://github.com/owncloud/android-library.git
synced 2026-08-16 19:03:00 +00:00
Merge pull request #37 from owncloud/better_loggin_system
Specific OC logging integrated in android-library
This commit is contained in:
@@ -37,9 +37,7 @@ import com.owncloud.android.lib.common.OwnCloudClient;
|
||||
import com.owncloud.android.lib.common.network.ChunkFromFileChannelRequestEntity;
|
||||
import com.owncloud.android.lib.common.network.ProgressiveDataTransferer;
|
||||
import com.owncloud.android.lib.common.network.WebdavUtils;
|
||||
|
||||
|
||||
import android.util.Log;
|
||||
import com.owncloud.android.lib.common.utils.Log_OC;
|
||||
|
||||
|
||||
public class ChunkedUploadRemoteFileOperation extends UploadRemoteFileOperation {
|
||||
@@ -81,7 +79,7 @@ public class ChunkedUploadRemoteFileOperation extends UploadRemoteFileOperation
|
||||
mPutMethod.setRequestEntity(mEntity);
|
||||
status = client.executeMethod(mPutMethod);
|
||||
client.exhaustResponse(mPutMethod.getResponseBodyAsStream());
|
||||
Log.d(TAG, "Upload of " + mLocalPath + " to " + mRemotePath + ", chunk index " + chunkIndex + ", count " + chunkCount + ", HTTP result status " + status);
|
||||
Log_OC.d(TAG, "Upload of " + mLocalPath + " to " + mRemotePath + ", chunk index " + chunkIndex + ", count " + chunkCount + ", HTTP result status " + status);
|
||||
if (!isSuccess(status))
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -27,13 +27,12 @@ package com.owncloud.android.lib.resources.files;
|
||||
import org.apache.commons.httpclient.HttpStatus;
|
||||
import org.apache.jackrabbit.webdav.client.methods.MkColMethod;
|
||||
|
||||
import android.util.Log;
|
||||
|
||||
import com.owncloud.android.lib.common.OwnCloudClient;
|
||||
import com.owncloud.android.lib.common.network.WebdavUtils;
|
||||
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;
|
||||
|
||||
|
||||
|
||||
@@ -87,12 +86,12 @@ public class CreateRemoteFolderOperation extends RemoteOperation {
|
||||
}
|
||||
|
||||
result = new RemoteOperationResult(mkcol.succeeded(), status, mkcol.getResponseHeaders());
|
||||
Log.d(TAG, "Create directory " + mRemotePath + ": " + result.getLogMessage());
|
||||
Log_OC.d(TAG, "Create directory " + mRemotePath + ": " + result.getLogMessage());
|
||||
client.exhaustResponse(mkcol.getResponseBodyAsStream());
|
||||
|
||||
} catch (Exception e) {
|
||||
result = new RemoteOperationResult(e);
|
||||
Log.e(TAG, "Create directory " + mRemotePath + ": " + result.getLogMessage(), e);
|
||||
Log_OC.e(TAG, "Create directory " + mRemotePath + ": " + result.getLogMessage(), e);
|
||||
|
||||
} finally {
|
||||
if (mkcol != null)
|
||||
|
||||
@@ -39,14 +39,13 @@ import org.apache.commons.httpclient.HttpException;
|
||||
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.network.OnDatatransferProgressListener;
|
||||
import com.owncloud.android.lib.common.network.WebdavUtils;
|
||||
import com.owncloud.android.lib.common.operations.OperationCancelledException;
|
||||
import com.owncloud.android.lib.common.operations.RemoteOperation;
|
||||
import com.owncloud.android.lib.common.operations.RemoteOperationResult;
|
||||
import com.owncloud.android.lib.common.utils.Log_OC;
|
||||
|
||||
/**
|
||||
* Remote operation performing the download of a remote file in the ownCloud server.
|
||||
@@ -84,11 +83,11 @@ public class DownloadRemoteFileOperation extends RemoteOperation {
|
||||
tmpFile.getParentFile().mkdirs();
|
||||
int status = downloadFile(client, tmpFile);
|
||||
result = new RemoteOperationResult(isSuccess(status), status, (mGet != null ? mGet.getResponseHeaders() : null));
|
||||
Log.i(TAG, "Download of " + mRemotePath + " to " + getTmpPath() + ": " + result.getLogMessage());
|
||||
Log_OC.i(TAG, "Download of " + mRemotePath + " to " + getTmpPath() + ": " + result.getLogMessage());
|
||||
|
||||
} catch (Exception e) {
|
||||
result = new RemoteOperationResult(e);
|
||||
Log.e(TAG, "Download of " + mRemotePath + " to " + getTmpPath() + ": " + result.getLogMessage(), e);
|
||||
Log_OC.e(TAG, "Download of " + mRemotePath + " to " + getTmpPath() + ": " + result.getLogMessage(), e);
|
||||
}
|
||||
|
||||
return result;
|
||||
|
||||
@@ -27,14 +27,14 @@ package com.owncloud.android.lib.resources.files;
|
||||
import org.apache.commons.httpclient.HttpStatus;
|
||||
import org.apache.commons.httpclient.methods.HeadMethod;
|
||||
|
||||
import android.content.Context;
|
||||
import android.net.ConnectivityManager;
|
||||
|
||||
import com.owncloud.android.lib.common.OwnCloudClient;
|
||||
import com.owncloud.android.lib.common.network.WebdavUtils;
|
||||
import com.owncloud.android.lib.common.operations.RemoteOperation;
|
||||
import com.owncloud.android.lib.common.operations.RemoteOperationResult;
|
||||
|
||||
import android.content.Context;
|
||||
import android.net.ConnectivityManager;
|
||||
import android.util.Log;
|
||||
import com.owncloud.android.lib.common.utils.Log_OC;
|
||||
|
||||
/**
|
||||
* Operation to check the existence or absence of a path in a remote server.
|
||||
@@ -80,11 +80,11 @@ public class ExistenceCheckRemoteOperation extends RemoteOperation {
|
||||
client.exhaustResponse(head.getResponseBodyAsStream());
|
||||
boolean success = (status == HttpStatus.SC_OK && !mSuccessIfAbsent) || (status == HttpStatus.SC_NOT_FOUND && mSuccessIfAbsent);
|
||||
result = new RemoteOperationResult(success, status, head.getResponseHeaders());
|
||||
Log.d(TAG, "Existence check for " + client.getWebdavUri() + WebdavUtils.encodePath(mPath) + " targeting for " + (mSuccessIfAbsent ? " absence " : " existence ") + "finished with HTTP status " + status + (!success?"(FAIL)":""));
|
||||
Log_OC.d(TAG, "Existence check for " + client.getWebdavUri() + WebdavUtils.encodePath(mPath) + " targeting for " + (mSuccessIfAbsent ? " absence " : " existence ") + "finished with HTTP status " + status + (!success?"(FAIL)":""));
|
||||
|
||||
} catch (Exception e) {
|
||||
result = new RemoteOperationResult(e);
|
||||
Log.e(TAG, "Existence check for " + client.getWebdavUri() + WebdavUtils.encodePath(mPath) + " targeting for " + (mSuccessIfAbsent ? " absence " : " existence ") + ": " + result.getLogMessage(), result.getException());
|
||||
Log_OC.e(TAG, "Existence check for " + client.getWebdavUri() + WebdavUtils.encodePath(mPath) + " targeting for " + (mSuccessIfAbsent ? " absence " : " existence ") + ": " + result.getLogMessage(), result.getException());
|
||||
|
||||
} finally {
|
||||
if (head != null)
|
||||
|
||||
@@ -26,7 +26,7 @@ package com.owncloud.android.lib.resources.files;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
import android.util.Log;
|
||||
import com.owncloud.android.lib.common.utils.Log_OC;
|
||||
|
||||
public class FileUtils {
|
||||
|
||||
@@ -47,7 +47,7 @@ public class FileUtils {
|
||||
public static boolean isValidName(String fileName) {
|
||||
boolean result = true;
|
||||
|
||||
Log.d("FileUtils", "fileName =======" + fileName);
|
||||
Log_OC.d("FileUtils", "fileName =======" + fileName);
|
||||
if (fileName.contains(PATH_SEPARATOR) ||
|
||||
fileName.contains("\\") || fileName.contains("<") || fileName.contains(">") ||
|
||||
fileName.contains(":") || fileName.contains("\"") || fileName.contains("|") ||
|
||||
@@ -65,7 +65,7 @@ public class FileUtils {
|
||||
public static boolean isValidPath(String path) {
|
||||
boolean result = true;
|
||||
|
||||
Log.d("FileUtils", "path ....... " + path);
|
||||
Log_OC.d("FileUtils", "path ....... " + path);
|
||||
if (path.contains("\\") || path.contains("<") || path.contains(">") ||
|
||||
path.contains(":") || path.contains("\"") || path.contains("|") ||
|
||||
path.contains("?") || path.contains("*")) {
|
||||
|
||||
@@ -30,13 +30,12 @@ import org.apache.jackrabbit.webdav.DavConstants;
|
||||
import org.apache.jackrabbit.webdav.MultiStatus;
|
||||
import org.apache.jackrabbit.webdav.client.methods.PropFindMethod;
|
||||
|
||||
import android.util.Log;
|
||||
|
||||
import com.owncloud.android.lib.common.OwnCloudClient;
|
||||
import com.owncloud.android.lib.common.network.WebdavEntry;
|
||||
import com.owncloud.android.lib.common.network.WebdavUtils;
|
||||
import com.owncloud.android.lib.common.operations.RemoteOperation;
|
||||
import com.owncloud.android.lib.common.operations.RemoteOperationResult;
|
||||
import com.owncloud.android.lib.common.utils.Log_OC;
|
||||
|
||||
|
||||
/**
|
||||
@@ -106,7 +105,7 @@ public class ReadRemoteFileOperation extends RemoteOperation {
|
||||
} catch (Exception e) {
|
||||
result = new RemoteOperationResult(e);
|
||||
e.printStackTrace();
|
||||
Log.e(TAG, "Synchronizing file " + mRemotePath + ": " + result.getLogMessage(), result.getException());
|
||||
Log_OC.e(TAG, "Synchronizing file " + mRemotePath + ": " + result.getLogMessage(), result.getException());
|
||||
} finally {
|
||||
if (propfind != null)
|
||||
propfind.releaseConnection();
|
||||
|
||||
@@ -31,13 +31,12 @@ import org.apache.jackrabbit.webdav.DavConstants;
|
||||
import org.apache.jackrabbit.webdav.MultiStatus;
|
||||
import org.apache.jackrabbit.webdav.client.methods.PropFindMethod;
|
||||
|
||||
import android.util.Log;
|
||||
|
||||
import com.owncloud.android.lib.common.OwnCloudClient;
|
||||
import com.owncloud.android.lib.common.network.WebdavEntry;
|
||||
import com.owncloud.android.lib.common.network.WebdavUtils;
|
||||
import com.owncloud.android.lib.common.operations.RemoteOperation;
|
||||
import com.owncloud.android.lib.common.operations.RemoteOperationResult;
|
||||
import com.owncloud.android.lib.common.utils.Log_OC;
|
||||
|
||||
/**
|
||||
* Remote operation performing the read of remote file or folder in the ownCloud server.
|
||||
@@ -109,12 +108,12 @@ public class ReadRemoteFolderOperation extends RemoteOperation {
|
||||
if (query != null)
|
||||
query.releaseConnection(); // let the connection available for other methods
|
||||
if (result.isSuccess()) {
|
||||
Log.i(TAG, "Synchronized " + mRemotePath + ": " + result.getLogMessage());
|
||||
Log_OC.i(TAG, "Synchronized " + mRemotePath + ": " + result.getLogMessage());
|
||||
} else {
|
||||
if (result.isException()) {
|
||||
Log.e(TAG, "Synchronized " + mRemotePath + ": " + result.getLogMessage(), result.getException());
|
||||
Log_OC.e(TAG, "Synchronized " + mRemotePath + ": " + result.getLogMessage(), result.getException());
|
||||
} else {
|
||||
Log.e(TAG, "Synchronized " + mRemotePath + ": " + result.getLogMessage());
|
||||
Log_OC.e(TAG, "Synchronized " + mRemotePath + ": " + result.getLogMessage());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -27,12 +27,11 @@ package com.owncloud.android.lib.resources.files;
|
||||
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.network.WebdavUtils;
|
||||
import com.owncloud.android.lib.common.operations.RemoteOperation;
|
||||
import com.owncloud.android.lib.common.operations.RemoteOperationResult;
|
||||
import com.owncloud.android.lib.common.utils.Log_OC;
|
||||
|
||||
/**
|
||||
* Remote operation performing the removal of a remote file or folder in the ownCloud server.
|
||||
@@ -73,11 +72,11 @@ public class RemoveRemoteFileOperation extends RemoteOperation {
|
||||
|
||||
delete.getResponseBodyAsString(); // exhaust the response, although not interesting
|
||||
result = new RemoteOperationResult((delete.succeeded() || status == HttpStatus.SC_NOT_FOUND), status, delete.getResponseHeaders());
|
||||
Log.i(TAG, "Remove " + mRemotePath + ": " + result.getLogMessage());
|
||||
Log_OC.i(TAG, "Remove " + mRemotePath + ": " + result.getLogMessage());
|
||||
|
||||
} catch (Exception e) {
|
||||
result = new RemoteOperationResult(e);
|
||||
Log.e(TAG, "Remove " + mRemotePath + ": " + result.getLogMessage(), e);
|
||||
Log_OC.e(TAG, "Remove " + mRemotePath + ": " + result.getLogMessage(), e);
|
||||
|
||||
} finally {
|
||||
if (delete != null)
|
||||
|
||||
@@ -28,13 +28,12 @@ import java.io.File;
|
||||
|
||||
import org.apache.jackrabbit.webdav.client.methods.DavMethodBase;
|
||||
|
||||
import android.util.Log;
|
||||
|
||||
import com.owncloud.android.lib.common.OwnCloudClient;
|
||||
import com.owncloud.android.lib.common.network.WebdavUtils;
|
||||
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;
|
||||
|
||||
|
||||
/**
|
||||
@@ -109,11 +108,11 @@ public class RenameRemoteFileOperation extends RemoteOperation {
|
||||
|
||||
move.getResponseBodyAsString(); // exhaust response, although not interesting
|
||||
result = new RemoteOperationResult(move.succeeded(), status, move.getResponseHeaders());
|
||||
Log.i(TAG, "Rename " + mOldRemotePath + " to " + mNewRemotePath + ": " + result.getLogMessage());
|
||||
Log_OC.i(TAG, "Rename " + mOldRemotePath + " to " + mNewRemotePath + ": " + result.getLogMessage());
|
||||
|
||||
} catch (Exception e) {
|
||||
result = new RemoteOperationResult(e);
|
||||
Log.e(TAG, "Rename " + mOldRemotePath + " to " + ((mNewRemotePath==null) ? mNewName : mNewRemotePath) + ": " + result.getLogMessage(), e);
|
||||
Log_OC.e(TAG, "Rename " + mOldRemotePath + " to " + ((mNewRemotePath==null) ? mNewName : mNewRemotePath) + ": " + result.getLogMessage(), e);
|
||||
|
||||
} finally {
|
||||
if (move != null)
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -34,12 +34,12 @@ import org.json.JSONObject;
|
||||
import android.content.Context;
|
||||
import android.net.ConnectivityManager;
|
||||
import android.net.Uri;
|
||||
import android.util.Log;
|
||||
|
||||
import com.owncloud.android.lib.common.OwnCloudClient;
|
||||
import com.owncloud.android.lib.common.accounts.AccountUtils;
|
||||
import com.owncloud.android.lib.common.operations.RemoteOperation;
|
||||
import com.owncloud.android.lib.common.operations.RemoteOperationResult;
|
||||
import com.owncloud.android.lib.common.utils.Log_OC;
|
||||
|
||||
/**
|
||||
* Checks if the server is valid and if the server supports the Share API
|
||||
@@ -158,14 +158,14 @@ public class GetRemoteStatusOperation extends RemoteOperation {
|
||||
}
|
||||
|
||||
if (mLatestResult.isSuccess()) {
|
||||
Log.i(TAG, "Connection check at " + baseUrlSt + ": " + mLatestResult.getLogMessage());
|
||||
Log_OC.i(TAG, "Connection check at " + baseUrlSt + ": " + mLatestResult.getLogMessage());
|
||||
|
||||
} else if (mLatestResult.getException() != null) {
|
||||
Log.e(TAG, "Connection check at " + baseUrlSt + ": " + mLatestResult.getLogMessage(),
|
||||
Log_OC.e(TAG, "Connection check at " + baseUrlSt + ": " + mLatestResult.getLogMessage(),
|
||||
mLatestResult.getException());
|
||||
|
||||
} else {
|
||||
Log.e(TAG, "Connection check at " + baseUrlSt + ": " + mLatestResult.getLogMessage());
|
||||
Log_OC.e(TAG, "Connection check at " + baseUrlSt + ": " + mLatestResult.getLogMessage());
|
||||
}
|
||||
|
||||
return retval;
|
||||
@@ -191,7 +191,7 @@ public class GetRemoteStatusOperation extends RemoteOperation {
|
||||
client.setBaseUri(Uri.parse("https://" + baseUriStr));
|
||||
boolean httpsSuccess = tryConnection(client);
|
||||
if (!httpsSuccess && !mLatestResult.isSslRecoverableException()) {
|
||||
Log.d(TAG, "establishing secure connection failed, trying non secure connection");
|
||||
Log_OC.d(TAG, "establishing secure connection failed, trying non secure connection");
|
||||
client.setBaseUri(Uri.parse("http://" + baseUriStr));
|
||||
tryConnection(client);
|
||||
}
|
||||
|
||||
@@ -30,11 +30,10 @@ import org.apache.commons.httpclient.methods.GetMethod;
|
||||
import org.apache.http.HttpStatus;
|
||||
import org.json.JSONObject;
|
||||
|
||||
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.utils.Log_OC;
|
||||
|
||||
|
||||
/**
|
||||
@@ -83,7 +82,7 @@ public class GetRemoteUserNameOperation extends RemoteOperation {
|
||||
status = client.executeMethod(get);
|
||||
if(isSuccess(status)) {
|
||||
String response = get.getResponseBodyAsString();
|
||||
Log.d(TAG, "Successful response: " + response);
|
||||
Log_OC.d(TAG, "Successful response: " + response);
|
||||
|
||||
// Parse the response
|
||||
JSONObject respJSON = new JSONObject(response);
|
||||
@@ -101,21 +100,21 @@ public class GetRemoteUserNameOperation extends RemoteOperation {
|
||||
result.setData(data);
|
||||
mUserName = displayName;
|
||||
|
||||
Log.d(TAG, "*** Parsed user information: " + id + " - " + displayName + " - " + email);
|
||||
Log_OC.d(TAG, "*** Parsed user information: " + id + " - " + displayName + " - " + email);
|
||||
|
||||
} else {
|
||||
result = new RemoteOperationResult(false, status, get.getResponseHeaders());
|
||||
String response = get.getResponseBodyAsString();
|
||||
Log.e(TAG, "Failed response while getting user information ");
|
||||
Log_OC.e(TAG, "Failed response while getting user information ");
|
||||
if (response != null) {
|
||||
Log.e(TAG, "*** status code: " + status + " ; response message: " + response);
|
||||
Log_OC.e(TAG, "*** status code: " + status + " ; response message: " + response);
|
||||
} else {
|
||||
Log.e(TAG, "*** status code: " + status);
|
||||
Log_OC.e(TAG, "*** status code: " + status);
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
result = new RemoteOperationResult(e);
|
||||
Log.e(TAG, "Exception while getting OC user information", e);
|
||||
Log_OC.e(TAG, "Exception while getting OC user information", e);
|
||||
|
||||
} finally {
|
||||
get.releaseConnection();
|
||||
|
||||
Reference in New Issue
Block a user