private static class Target {
public Uri mServerUrl = null;
public Account mAccount = null;
private static class Target {
public Uri mServerUrl = null;
public Account mAccount = null;
- public String mWebDavUrl = "";
- public String mUsername = "";
- public String mPassword = "";
- public String mAuthToken = "";
+ public String mWebDavUrl = null;
+ public String mUsername = null;
+ public String mPassword = null;
+ public String mAuthToken = null;
public Target(Account account, Uri serverUrl, String webdavUrl, String username, String password, String authToken,
boolean followRedirects, String cookie) {
public Target(Account account, Uri serverUrl, String webdavUrl, String username, String password, String authToken,
boolean followRedirects, String cookie) {
* Creates and adds to the queue a new operation, as described by operationIntent
*
* @param operationIntent Intent describing a new operation to queue and execute.
* Creates and adds to the queue a new operation, as described by operationIntent
*
* @param operationIntent Intent describing a new operation to queue and execute.
- ((webDavPath == null) || (serverUrl == null)) ? "" : webDavUrl,
- (username == null) ? "" : username,
- (password == null) ? "" : password,
- (authToken == null) ? "" : authToken,
+ ((webDavPath == null) || (serverUrl == null)) ? null : webDavUrl,
+ username,
+ password,
+ authToken,
if (operation != null) {
mPendingOperations.add(new Pair<Target , RemoteOperation>(target, operation));
startService(new Intent(OperationsService.this, OperationsService.class));
if (operation != null) {
mPendingOperations.add(new Pair<Target , RemoteOperation>(target, operation));
startService(new Intent(OperationsService.this, OperationsService.class));
- Log_OC.wtf(TAG, "New operation added, opId: " + operation.hashCode());
+ //Log_OC.wtf(TAG, "New operation added, opId: " + operation.hashCode());
+ // better id than hash? ; should be good enough by the time being
- public RemoteOperationResult getOperationResultIfFinished(int operationId) {
- Pair<RemoteOperation, RemoteOperationResult> undispatched =
- mUndispatchedFinishedOperations.remove(operationId);
- if (undispatched != null) {
- return undispatched.second;
- }
- return null;
- }
-
-
public void dispatchResultIfFinished(int operationId, OnRemoteOperationListener listener) {
Pair<RemoteOperation, RemoteOperationResult> undispatched =
mUndispatchedFinishedOperations.remove(operationId);
if (undispatched != null) {
listener.onRemoteOperationFinish(undispatched.first, undispatched.second);
public void dispatchResultIfFinished(int operationId, OnRemoteOperationListener listener) {
Pair<RemoteOperation, RemoteOperationResult> undispatched =
mUndispatchedFinishedOperations.remove(operationId);
if (undispatched != null) {
listener.onRemoteOperationFinish(undispatched.first, undispatched.second);
Pair<Target, RemoteOperation> next = null;
synchronized(mPendingOperations) {
Pair<Target, RemoteOperation> next = null;
synchronized(mPendingOperations) {
} else {
mOwnCloudClient = OwnCloudClientFactory.createOwnCloudClient(mLastTarget.mServerUrl, getApplicationContext(),
mLastTarget.mFollowRedirects); // this is not good enough
} else {
mOwnCloudClient = OwnCloudClientFactory.createOwnCloudClient(mLastTarget.mServerUrl, getApplicationContext(),
mLastTarget.mFollowRedirects); // this is not good enough