mirror of
https://github.com/owncloud/android-library.git
synced 2025-06-07 07:56:19 +00:00
Merge pull request #13 from owncloud/wide_scope_clean_up
Wide scope clean up
This commit is contained in:
commit
aaa8dc018a
@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- ownCloud Android Library is available under MIT license
|
||||
Copyright (C) 2014 ownCloud (http://www.owncloud.org/)
|
||||
Copyright (C) 2014 ownCloud Inc.
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
|
24
LICENSE.md
Normal file
24
LICENSE.md
Normal file
@ -0,0 +1,24 @@
|
||||
### License
|
||||
|
||||
ownCloud Android Library is available under MIT license
|
||||
|
||||
Copyright (C) 2014 ownCloud Inc.
|
||||
Copyright (C) 2012 Bartek Przybylski
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERSBE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
56
README.md
56
README.md
@ -1,4 +1,4 @@
|
||||
# ownCloud Android Library v1.0
|
||||
# ownCloud Android Library
|
||||
|
||||
### Introduction
|
||||
Using ownCloud Android library it will be the easiest way to communicate with ownCloud servers.
|
||||
@ -12,45 +12,45 @@ Get this code and compile it. In the repository it is not only the library proje
|
||||
#### 2.2. Add library to your project
|
||||
There are different ways of adding this library to your code, then it is described one of them
|
||||
|
||||
__Step 1.__ Compile the ownCloud Android Library
|
||||
__Step 1.__ Compile the ownCloud Android Library
__Step 2.__ Define a dependency within your project. For that, access to Properties > Android > Library and click on add and select the ownCloud Android library
|
||||
|
||||
__Step 2.__ Define a dependency within your project. For that, access to Properties > Android > Library and click on add and select the ownCloud Android library
|
||||
### Branching strategy
|
||||
|
||||
The repository holds two main branches with an infinite lifetime:
|
||||
|
||||
- master
|
||||
- develop
|
||||
|
||||
Branch __origin/master__ is considered the main branch where the source code of HEAD always reflects a production-ready state.
|
||||
|
||||
Branch __origin/develop__ is considered the main branch where the source code of HEAD always reflects a state with the latest delivered development changes for the next release.
|
||||
|
||||
When the source code in the develop branch reaches a stable point and is ready to be released, all of the changes should be merged back into master somehow and then tagged with a release number.
|
||||
|
||||
Other branches, some supporting branches are used to aid parallel development between team members, ease tracking of features, prepare for production releases and to assist in quickly fixing live production problems. Unlike the main branches, these branches always have a limited life time, since they will be removed eventually.
|
||||
|
||||
The different types of branches we may use are:
|
||||
|
||||
- Branch __perNewFeature__
|
||||
- Branch __releaseBranches__
|
||||
|
||||
Both of them branch off from develop and must merge back into develop branch through a Pull Request in Github. Once the PR is approved and merged, the US branch may be deleted.
|
||||
|
||||
Source: http://nvie.com/posts/a-successful-git-branching-model
|
||||
|
||||
### License
|
||||
|
||||
ownCloud Android Library is available under MIT license
|
||||
|
||||
Copyright (C) 2014 ownCloud (http://www.owncloud.org/)
|
||||
|
||||
Copyright (C) 2012 Bartek Przybylski
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERSBE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
|
||||
|
||||
ownCloud Android Library is available under MIT license. See the file LICENSE.md with the full license text.
|
||||
|
||||
#### Third part libraries
|
||||
|
||||
ownCloud Android Library uses Apache JackRabbit, version 2.2.5. Copyright (C) 2004-2010 The Apache Software Foundation. Licensed under Apache License, Version 2.0.
|
||||
|
||||
Apache JackRabbit depends on Commons HTTPClient version 3.1 and SLF4j version 1.7.5; both included also. Copyright (C) 2004-2010 The Apache Software Foundation. Licensed under Apache License, Version 2.0.
|
||||
|
||||
|
||||
### Compatibility
|
||||
|
||||
ownCloud Android library from Android 2.2 (android:minSdkVersion="8" android:targetSdkVersion="19")
|
||||
ownCloud Android Library is valid for Android systems from version Android 2.2 (android:minSdkVersion="8" android:targetSdkVersion="19").
|
||||
|
||||
ownCloud Android library supports ownCloud server from version 4.5.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- ownCloud Android Library is available under MIT license
|
||||
Copyright (C) 2014 ownCloud (http://www.owncloud.org/)
|
||||
Copyright (C) 2014 ownCloud Inc.
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
|
@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- ownCloud Android Library is available under MIT license
|
||||
Copyright (C) 2014 ownCloud (http://www.owncloud.org/)
|
||||
Copyright (C) 2014 ownCloud Inc.
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
|
@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- ownCloud Android Library is available under MIT license
|
||||
Copyright (C) 2014 ownCloud (http://www.owncloud.org/)
|
||||
Copyright (C) 2014 ownCloud Inc.
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
|
@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- ownCloud Android Library is available under MIT license
|
||||
Copyright (C) 2014 ownCloud (http://www.owncloud.org/)
|
||||
Copyright (C) 2014 ownCloud Inc.
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
|
@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- ownCloud Android Library is available under MIT license
|
||||
Copyright (C) 2014 ownCloud (http://www.owncloud.org/)
|
||||
Copyright (C) 2014 ownCloud Inc.
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
|
@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- ownCloud Android Library is available under MIT license
|
||||
Copyright (C) 2014 ownCloud (http://www.owncloud.org/)
|
||||
Copyright (C) 2014 ownCloud Inc.
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
|
@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- ownCloud Android Library is available under MIT license
|
||||
Copyright (C) 2014 ownCloud (http://www.owncloud.org/)
|
||||
Copyright (C) 2014 ownCloud Inc.
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
|
@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- ownCloud Android Library is available under MIT license
|
||||
Copyright (C) 2014 ownCloud (http://www.owncloud.org/)
|
||||
Copyright (C) 2014 ownCloud Inc.
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
|
@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- ownCloud Android Library is available under MIT license
|
||||
Copyright (C) 2014 ownCloud (http://www.owncloud.org/)
|
||||
Copyright (C) 2014 ownCloud Inc.
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
|
@ -1,5 +1,5 @@
|
||||
/* ownCloud Android Library is available under MIT license
|
||||
* Copyright (C) 2014 ownCloud (http://www.owncloud.org/)
|
||||
* Copyright (C) 2014 ownCloud Inc.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
@ -29,7 +29,7 @@ import android.view.ViewGroup;
|
||||
import android.widget.ArrayAdapter;
|
||||
import android.widget.TextView;
|
||||
|
||||
import com.owncloud.android.lib.operations.common.RemoteFile;
|
||||
import com.owncloud.android.lib.resources.files.RemoteFile;
|
||||
|
||||
public class FilesArrayAdapter extends ArrayAdapter<RemoteFile> {
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
/* ownCloud Android Library is available under MIT license
|
||||
* Copyright (C) 2014 ownCloud (http://www.owncloud.org/)
|
||||
* Copyright (C) 2014 ownCloud Inc.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
@ -32,19 +32,19 @@ import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
|
||||
import com.owncloud.android.lib.accounts.AccountUtils;
|
||||
import com.owncloud.android.lib.network.OnDatatransferProgressListener;
|
||||
import com.owncloud.android.lib.network.OwnCloudClientFactory;
|
||||
import com.owncloud.android.lib.network.OwnCloudClient;
|
||||
import com.owncloud.android.lib.operations.common.OnRemoteOperationListener;
|
||||
import com.owncloud.android.lib.operations.common.RemoteFile;
|
||||
import com.owncloud.android.lib.operations.common.RemoteOperation;
|
||||
import com.owncloud.android.lib.operations.common.RemoteOperationResult;
|
||||
import com.owncloud.android.lib.operations.remote.DownloadRemoteFileOperation;
|
||||
import com.owncloud.android.lib.operations.remote.ReadRemoteFolderOperation;
|
||||
import com.owncloud.android.lib.operations.remote.RemoveRemoteFileOperation;
|
||||
import com.owncloud.android.lib.operations.remote.UploadRemoteFileOperation;
|
||||
import com.owncloud.android.lib.utils.FileUtils;
|
||||
import com.owncloud.android.lib.common.accounts.AccountUtils;
|
||||
import com.owncloud.android.lib.common.network.OnDatatransferProgressListener;
|
||||
import com.owncloud.android.lib.common.OwnCloudClientFactory;
|
||||
import com.owncloud.android.lib.common.OwnCloudClient;
|
||||
import com.owncloud.android.lib.common.operations.OnRemoteOperationListener;
|
||||
import com.owncloud.android.lib.resources.files.RemoteFile;
|
||||
import com.owncloud.android.lib.common.operations.RemoteOperation;
|
||||
import com.owncloud.android.lib.common.operations.RemoteOperationResult;
|
||||
import com.owncloud.android.lib.resources.files.DownloadRemoteFileOperation;
|
||||
import com.owncloud.android.lib.resources.files.ReadRemoteFolderOperation;
|
||||
import com.owncloud.android.lib.resources.files.RemoveRemoteFileOperation;
|
||||
import com.owncloud.android.lib.resources.files.UploadRemoteFileOperation;
|
||||
import com.owncloud.android.lib.resources.files.FileUtils;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.content.res.AssetManager;
|
||||
|
@ -1,116 +0,0 @@
|
||||
/* ownCloud Android Library is available under MIT license
|
||||
* Copyright (C) 2014 ownCloud (http://www.owncloud.org/)
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
|
||||
* BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
|
||||
* ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
* THE SOFTWARE.
|
||||
*
|
||||
*/
|
||||
|
||||
package com.owncloud.android.lib.accounts;
|
||||
|
||||
import android.accounts.Account;
|
||||
import android.os.Parcel;
|
||||
import android.os.Parcelable;
|
||||
|
||||
/**
|
||||
* Account with extra information specific for ownCloud accounts.
|
||||
*
|
||||
* TODO integrate in the main app
|
||||
*
|
||||
* @author David A. Velasco
|
||||
*/
|
||||
public class OwnCloudAccount extends Account {
|
||||
|
||||
public static class Constants {
|
||||
/**
|
||||
* Value under this key should handle path to webdav php script. Will be
|
||||
* removed and usage should be replaced by combining
|
||||
* {@link com.owncloud.android.authentication.AuthenticatorActivity.KEY_OC_BASE_URL} and
|
||||
* {@link com.owncloud.android.lib.utils.utils.OwnCloudVersion}
|
||||
*
|
||||
* @deprecated
|
||||
*/
|
||||
public static final String KEY_OC_URL = "oc_url";
|
||||
/**
|
||||
* Version should be 3 numbers separated by dot so it can be parsed by
|
||||
* {@link com.owncloud.android.lib.utils.utils.OwnCloudVersion}
|
||||
*/
|
||||
public static final String KEY_OC_VERSION = "oc_version";
|
||||
/**
|
||||
* Base url should point to owncloud installation without trailing / ie:
|
||||
* http://server/path or https://owncloud.server
|
||||
*/
|
||||
public static final String KEY_OC_BASE_URL = "oc_base_url";
|
||||
/**
|
||||
* Flag signaling if the ownCloud server can be accessed with OAuth2 access tokens.
|
||||
*/
|
||||
public static final String KEY_SUPPORTS_OAUTH2 = "oc_supports_oauth2";
|
||||
/**
|
||||
* Flag signaling if the ownCloud server can be accessed with session cookies from SAML-based web single-sign-on.
|
||||
*/
|
||||
public static final String KEY_SUPPORTS_SAML_WEB_SSO = "oc_supports_saml_web_sso";
|
||||
/**
|
||||
* Flag signaling if the ownCloud server supports Share API"
|
||||
*/
|
||||
public static final String KEY_SUPPORTS_SHARE_API = "oc_supports_share_api";
|
||||
}
|
||||
|
||||
private String mAuthTokenType;
|
||||
|
||||
public OwnCloudAccount(String name, String type, String authTokenType) {
|
||||
super(name, type);
|
||||
// TODO validate authTokentype as supported
|
||||
mAuthTokenType = authTokenType;
|
||||
}
|
||||
|
||||
/**
|
||||
* Reconstruct from parcel
|
||||
*
|
||||
* @param source The source parcel
|
||||
*/
|
||||
public OwnCloudAccount(Parcel source) {
|
||||
super(source);
|
||||
mAuthTokenType = source.readString();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeToParcel(Parcel dest, int flags) {
|
||||
super.writeToParcel(dest, flags);
|
||||
dest.writeString(mAuthTokenType);
|
||||
}
|
||||
|
||||
|
||||
public String getAuthTokenType() {
|
||||
return mAuthTokenType;
|
||||
}
|
||||
|
||||
|
||||
public static final Parcelable.Creator<OwnCloudAccount> CREATOR = new Parcelable.Creator<OwnCloudAccount>() {
|
||||
@Override
|
||||
public OwnCloudAccount createFromParcel(Parcel source) {
|
||||
return new OwnCloudAccount(source);
|
||||
}
|
||||
|
||||
@Override
|
||||
public OwnCloudAccount [] newArray(int size) {
|
||||
return new OwnCloudAccount[size];
|
||||
}
|
||||
};
|
||||
|
||||
}
|
@ -1,5 +1,5 @@
|
||||
/* ownCloud Android Library is available under MIT license
|
||||
* Copyright (C) 2014 ownCloud (http://www.owncloud.org/)
|
||||
* Copyright (C) 2014 ownCloud Inc.
|
||||
* Copyright (C) 2012 Bartek Przybylski
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
@ -23,7 +23,7 @@
|
||||
*
|
||||
*/
|
||||
|
||||
package com.owncloud.android.lib.network;
|
||||
package com.owncloud.android.lib.common;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
@ -48,7 +48,10 @@ import org.apache.commons.httpclient.params.HttpMethodParams;
|
||||
import org.apache.http.HttpStatus;
|
||||
import org.apache.http.params.CoreProtocolPNames;
|
||||
|
||||
import com.owncloud.android.lib.network.webdav.WebdavUtils;
|
||||
import com.owncloud.android.lib.common.network.BearerAuthScheme;
|
||||
import com.owncloud.android.lib.common.network.BearerCredentials;
|
||||
import com.owncloud.android.lib.common.network.WebdavUtils;
|
||||
|
||||
|
||||
import android.net.Uri;
|
||||
import android.util.Log;
|
@ -1,5 +1,5 @@
|
||||
/* ownCloud Android Library is available under MIT license
|
||||
* Copyright (C) 2014 ownCloud (http://www.owncloud.org/)
|
||||
* Copyright (C) 2014 ownCloud Inc.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
@ -22,15 +22,15 @@
|
||||
*
|
||||
*/
|
||||
|
||||
package com.owncloud.android.lib.network;
|
||||
package com.owncloud.android.lib.common;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.security.GeneralSecurityException;
|
||||
|
||||
import com.owncloud.android.lib.accounts.AccountTypeUtils;
|
||||
import com.owncloud.android.lib.accounts.AccountUtils;
|
||||
import com.owncloud.android.lib.accounts.OwnCloudAccount;
|
||||
import com.owncloud.android.lib.accounts.AccountUtils.AccountNotFoundException;
|
||||
import com.owncloud.android.lib.common.accounts.AccountTypeUtils;
|
||||
import com.owncloud.android.lib.common.accounts.AccountUtils;
|
||||
import com.owncloud.android.lib.common.accounts.AccountUtils.AccountNotFoundException;
|
||||
import com.owncloud.android.lib.common.network.NetworkUtils;
|
||||
|
||||
import android.accounts.Account;
|
||||
import android.accounts.AccountManager;
|
||||
@ -73,8 +73,8 @@ public class OwnCloudClientFactory {
|
||||
Uri webdavUri = Uri.parse(AccountUtils.constructFullURLForAccount(appContext, account));
|
||||
Uri uri = Uri.parse(AccountUtils.constructBasicURLForAccount(appContext, account));
|
||||
AccountManager am = AccountManager.get(appContext);
|
||||
boolean isOauth2 = am.getUserData(account, OwnCloudAccount.Constants.KEY_SUPPORTS_OAUTH2) != null; // TODO avoid calling to getUserData here
|
||||
boolean isSamlSso = am.getUserData(account, OwnCloudAccount.Constants.KEY_SUPPORTS_SAML_WEB_SSO) != null;
|
||||
boolean isOauth2 = am.getUserData(account, AccountUtils.Constants.KEY_SUPPORTS_OAUTH2) != null; // TODO avoid calling to getUserData here
|
||||
boolean isSamlSso = am.getUserData(account, AccountUtils.Constants.KEY_SUPPORTS_SAML_WEB_SSO) != null;
|
||||
OwnCloudClient client = createOwnCloudClient(webdavUri, appContext, !isSamlSso);
|
||||
client.setBaseUri(uri);
|
||||
|
||||
@ -101,8 +101,8 @@ public class OwnCloudClientFactory {
|
||||
Uri webdavUri = Uri.parse(AccountUtils.constructFullURLForAccount(appContext, account));
|
||||
Uri uri = Uri.parse(AccountUtils.constructBasicURLForAccount(appContext, account));
|
||||
AccountManager am = AccountManager.get(appContext);
|
||||
boolean isOauth2 = am.getUserData(account, OwnCloudAccount.Constants.KEY_SUPPORTS_OAUTH2) != null; // TODO avoid calling to getUserData here
|
||||
boolean isSamlSso = am.getUserData(account, OwnCloudAccount.Constants.KEY_SUPPORTS_SAML_WEB_SSO) != null;
|
||||
boolean isOauth2 = am.getUserData(account, AccountUtils.Constants.KEY_SUPPORTS_OAUTH2) != null; // TODO avoid calling to getUserData here
|
||||
boolean isSamlSso = am.getUserData(account, AccountUtils.Constants.KEY_SUPPORTS_SAML_WEB_SSO) != null;
|
||||
OwnCloudClient client = createOwnCloudClient(webdavUri, appContext, !isSamlSso);
|
||||
client.setBaseUri(uri);
|
||||
|
@ -1,6 +1,5 @@
|
||||
/* ownCloud Android Library is available under MIT license
|
||||
* Copyright (C) 2014 ownCloud (http://www.owncloud.org/)
|
||||
* Copyright (C) 2012 Bartek Przybylski
|
||||
* Copyright (C) 2014 ownCloud Inc.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
@ -23,7 +22,7 @@
|
||||
*
|
||||
*/
|
||||
|
||||
package com.owncloud.android.lib.accounts;
|
||||
package com.owncloud.android.lib.common.accounts;
|
||||
|
||||
/**
|
||||
* @author masensio
|
@ -1,5 +1,5 @@
|
||||
/* ownCloud Android Library is available under MIT license
|
||||
* Copyright (C) 2014 ownCloud (http://www.owncloud.org/)
|
||||
* Copyright (C) 2014 ownCloud Inc.
|
||||
* Copyright (C) 2012 Bartek Przybylski
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
@ -23,9 +23,9 @@
|
||||
*
|
||||
*/
|
||||
|
||||
package com.owncloud.android.lib.accounts;
|
||||
package com.owncloud.android.lib.common.accounts;
|
||||
|
||||
import com.owncloud.android.lib.utils.OwnCloudVersion;
|
||||
import com.owncloud.android.lib.resources.status.OwnCloudVersion;
|
||||
|
||||
import android.accounts.Account;
|
||||
import android.accounts.AccountManager;
|
||||
@ -79,10 +79,10 @@ public class AccountUtils {
|
||||
*/
|
||||
public static String constructFullURLForAccount(Context context, Account account) throws AccountNotFoundException {
|
||||
AccountManager ama = AccountManager.get(context);
|
||||
String baseurl = ama.getUserData(account, OwnCloudAccount.Constants.KEY_OC_BASE_URL);
|
||||
String strver = ama.getUserData(account, OwnCloudAccount.Constants.KEY_OC_VERSION);
|
||||
boolean supportsOAuth = (ama.getUserData(account, OwnCloudAccount.Constants.KEY_SUPPORTS_OAUTH2) != null);
|
||||
boolean supportsSamlSso = (ama.getUserData(account, OwnCloudAccount.Constants.KEY_SUPPORTS_SAML_WEB_SSO) != null);
|
||||
String baseurl = ama.getUserData(account, Constants.KEY_OC_BASE_URL);
|
||||
String strver = ama.getUserData(account, Constants.KEY_OC_VERSION);
|
||||
boolean supportsOAuth = (ama.getUserData(account, Constants.KEY_SUPPORTS_OAUTH2) != null);
|
||||
boolean supportsSamlSso = (ama.getUserData(account, Constants.KEY_SUPPORTS_SAML_WEB_SSO) != null);
|
||||
OwnCloudVersion ver = new OwnCloudVersion(strver);
|
||||
String webdavpath = getWebdavPath(ver, supportsOAuth, supportsSamlSso);
|
||||
|
||||
@ -101,7 +101,7 @@ public class AccountUtils {
|
||||
*/
|
||||
public static String constructBasicURLForAccount(Context context, Account account) throws AccountNotFoundException {
|
||||
AccountManager ama = AccountManager.get(context);
|
||||
String baseurl = ama.getUserData(account, OwnCloudAccount.Constants.KEY_OC_BASE_URL);
|
||||
String baseurl = ama.getUserData(account, Constants.KEY_OC_BASE_URL);
|
||||
|
||||
if (baseurl == null )
|
||||
throw new AccountNotFoundException(account, "Account not found", null);
|
||||
@ -126,4 +126,39 @@ public class AccountUtils {
|
||||
return mFailedAccount;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public static class Constants {
|
||||
/**
|
||||
* Value under this key should handle path to webdav php script. Will be
|
||||
* removed and usage should be replaced by combining
|
||||
* {@link com.owncloud.android.authentication.AuthenticatorActivity.KEY_OC_BASE_URL} and
|
||||
* {@link com.owncloud.android.lib.resources.status.utils.OwnCloudVersion}
|
||||
*
|
||||
* @deprecated
|
||||
*/
|
||||
public static final String KEY_OC_URL = "oc_url";
|
||||
/**
|
||||
* Version should be 3 numbers separated by dot so it can be parsed by
|
||||
* {@link com.owncloud.android.lib.resources.status.utils.OwnCloudVersion}
|
||||
*/
|
||||
public static final String KEY_OC_VERSION = "oc_version";
|
||||
/**
|
||||
* Base url should point to owncloud installation without trailing / ie:
|
||||
* http://server/path or https://owncloud.server
|
||||
*/
|
||||
public static final String KEY_OC_BASE_URL = "oc_base_url";
|
||||
/**
|
||||
* Flag signaling if the ownCloud server can be accessed with OAuth2 access tokens.
|
||||
*/
|
||||
public static final String KEY_SUPPORTS_OAUTH2 = "oc_supports_oauth2";
|
||||
/**
|
||||
* Flag signaling if the ownCloud server can be accessed with session cookies from SAML-based web single-sign-on.
|
||||
*/
|
||||
public static final String KEY_SUPPORTS_SAML_WEB_SSO = "oc_supports_saml_web_sso";
|
||||
/**
|
||||
* Flag signaling if the ownCloud server supports Share API"
|
||||
*/
|
||||
public static final String KEY_SUPPORTS_SHARE_API = "oc_supports_share_api";
|
||||
}
|
||||
}
|
@ -1,6 +1,5 @@
|
||||
/* ownCloud Android Library is available under MIT license
|
||||
* Copyright (C) 2014 ownCloud (http://www.owncloud.org/)
|
||||
* Copyright (C) 2012 Bartek Przybylski
|
||||
* Copyright (C) 2014 ownCloud Inc.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
@ -23,7 +22,7 @@
|
||||
*
|
||||
*/
|
||||
|
||||
package com.owncloud.android.lib.network;
|
||||
package com.owncloud.android.lib.common.network;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.net.InetAddress;
|
@ -1,5 +1,5 @@
|
||||
/* ownCloud Android Library is available under MIT license
|
||||
* Copyright (C) 2014 ownCloud (http://www.owncloud.org/)
|
||||
* Copyright (C) 2014 ownCloud Inc.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
@ -22,7 +22,7 @@
|
||||
*
|
||||
*/
|
||||
|
||||
package com.owncloud.android.lib.network;
|
||||
package com.owncloud.android.lib.common.network;
|
||||
|
||||
import java.security.KeyStore;
|
||||
import java.security.KeyStoreException;
|
@ -1,5 +1,5 @@
|
||||
/* ownCloud Android Library is available under MIT license
|
||||
* Copyright (C) 2014 ownCloud (http://www.owncloud.org/)
|
||||
* Copyright (C) 2014 ownCloud Inc.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
@ -22,7 +22,7 @@
|
||||
*
|
||||
*/
|
||||
|
||||
package com.owncloud.android.lib.network;
|
||||
package com.owncloud.android.lib.common.network;
|
||||
|
||||
import java.util.Map;
|
||||
|
@ -1,5 +1,5 @@
|
||||
/* ownCloud Android Library is available under MIT license
|
||||
* Copyright (C) 2014 ownCloud (http://www.owncloud.org/)
|
||||
* Copyright (C) 2014 ownCloud Inc.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
@ -22,7 +22,7 @@
|
||||
*
|
||||
*/
|
||||
|
||||
package com.owncloud.android.lib.network;
|
||||
package com.owncloud.android.lib.common.network;
|
||||
|
||||
import org.apache.commons.httpclient.Credentials;
|
||||
import org.apache.commons.httpclient.util.LangUtils;
|
@ -1,5 +1,5 @@
|
||||
/* ownCloud Android Library is available under MIT license
|
||||
* Copyright (C) 2014 ownCloud (http://www.owncloud.org/)
|
||||
* Copyright (C) 2014 ownCloud Inc.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
@ -22,7 +22,7 @@
|
||||
*
|
||||
*/
|
||||
|
||||
package com.owncloud.android.lib.network;
|
||||
package com.owncloud.android.lib.common.network;
|
||||
|
||||
import java.security.cert.CertPathValidatorException;
|
||||
import java.security.cert.CertificateException;
|
@ -1,5 +1,5 @@
|
||||
/* ownCloud Android Library is available under MIT license
|
||||
* Copyright (C) 2014 ownCloud (http://www.owncloud.org/)
|
||||
* Copyright (C) 2014 ownCloud Inc.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
@ -22,7 +22,7 @@
|
||||
*
|
||||
*/
|
||||
|
||||
package com.owncloud.android.lib.network;
|
||||
package com.owncloud.android.lib.common.network;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
@ -1,5 +1,5 @@
|
||||
/* ownCloud Android Library is available under MIT license
|
||||
* Copyright (C) 2014 ownCloud (http://www.owncloud.org/)
|
||||
* Copyright (C) 2014 ownCloud Inc.
|
||||
* Copyright (C) 2012 Bartek Przybylski
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
@ -23,7 +23,7 @@
|
||||
*
|
||||
*/
|
||||
|
||||
package com.owncloud.android.lib.network;
|
||||
package com.owncloud.android.lib.common.network;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
@ -1,5 +1,5 @@
|
||||
/* ownCloud Android Library is available under MIT license
|
||||
* Copyright (C) 2014 ownCloud (http://www.owncloud.org/)
|
||||
* Copyright (C) 2014 ownCloud Inc.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
@ -22,7 +22,7 @@
|
||||
*
|
||||
*/
|
||||
|
||||
package com.owncloud.android.lib.network;
|
||||
package com.owncloud.android.lib.common.network;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileInputStream;
|
@ -1,5 +1,5 @@
|
||||
/* ownCloud Android Library is available under MIT license
|
||||
* Copyright (C) 2014 ownCloud (http://www.owncloud.org/)
|
||||
* Copyright (C) 2014 ownCloud Inc.
|
||||
* Copyright (C) 2012 Bartek Przybylski
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
@ -23,7 +23,7 @@
|
||||
*
|
||||
*/
|
||||
|
||||
package com.owncloud.android.lib.network;
|
||||
package com.owncloud.android.lib.common.network;
|
||||
|
||||
public interface OnDatatransferProgressListener {
|
||||
public void onTransferProgress(long progressRate, long totalTransferredSoFar, long totalToTransfer, String fileAbsoluteName);
|
@ -1,5 +1,5 @@
|
||||
/* ownCloud Android Library is available under MIT license
|
||||
* Copyright (C) 2014 ownCloud (http://www.owncloud.org/)
|
||||
* Copyright (C) 2014 ownCloud Inc.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
@ -22,7 +22,7 @@
|
||||
*
|
||||
*/
|
||||
|
||||
package com.owncloud.android.lib.network;
|
||||
package com.owncloud.android.lib.common.network;
|
||||
|
||||
import java.util.Collection;
|
||||
|
@ -1,5 +1,5 @@
|
||||
/* ownCloud Android Library is available under MIT license
|
||||
* Copyright (C) 2014 ownCloud (http://www.owncloud.org/)
|
||||
* Copyright (C) 2014 ownCloud Inc.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
@ -22,7 +22,7 @@
|
||||
*
|
||||
*/
|
||||
|
||||
package com.owncloud.android.lib.network;
|
||||
package com.owncloud.android.lib.common.network;
|
||||
|
||||
import java.lang.ref.WeakReference;
|
||||
import java.lang.reflect.InvocationTargetException;
|
@ -1,5 +1,5 @@
|
||||
/* ownCloud Android Library is available under MIT license
|
||||
* Copyright (C) 2014 ownCloud (http://www.owncloud.org/)
|
||||
* Copyright (C) 2014 ownCloud Inc.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
@ -22,7 +22,7 @@
|
||||
*
|
||||
*/
|
||||
|
||||
package com.owncloud.android.lib.network.webdav;
|
||||
package com.owncloud.android.lib.common.network;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
@ -33,6 +33,7 @@ import org.apache.jackrabbit.webdav.property.DavPropertySet;
|
||||
|
||||
|
||||
|
||||
|
||||
import android.net.Uri;
|
||||
import android.util.Log;
|
||||
|
@ -1,5 +1,5 @@
|
||||
/* ownCloud Android Library is available under MIT license
|
||||
* Copyright (C) 2014 ownCloud (http://www.owncloud.org/)
|
||||
* Copyright (C) 2014 ownCloud Inc.
|
||||
* Copyright (C) 2012 Bartek Przybylski
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
@ -23,7 +23,7 @@
|
||||
*
|
||||
*/
|
||||
|
||||
package com.owncloud.android.lib.network.webdav;
|
||||
package com.owncloud.android.lib.common.network;
|
||||
|
||||
import java.text.ParseException;
|
||||
import java.text.SimpleDateFormat;
|
@ -1,6 +1,5 @@
|
||||
/* ownCloud Android Library is available under MIT license
|
||||
* Copyright (C) 2014 ownCloud (http://www.owncloud.org/)
|
||||
* Copyright (C) 2012 Bartek Przybylski
|
||||
* Copyright (C) 2014 ownCloud Inc.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
@ -23,7 +22,7 @@
|
||||
*
|
||||
*/
|
||||
|
||||
package com.owncloud.android.lib.operations.common;
|
||||
package com.owncloud.android.lib.common.operations;
|
||||
|
||||
|
||||
public interface OnRemoteOperationListener {
|
@ -1,6 +1,5 @@
|
||||
/* ownCloud Android Library is available under MIT license
|
||||
* Copyright (C) 2014 ownCloud (http://www.owncloud.org/)
|
||||
* Copyright (C) 2012 Bartek Przybylski
|
||||
* Copyright (C) 2014 ownCloud Inc.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
@ -23,7 +22,7 @@
|
||||
*
|
||||
*/
|
||||
|
||||
package com.owncloud.android.lib.operations.common;
|
||||
package com.owncloud.android.lib.common.operations;
|
||||
|
||||
public class OperationCancelledException extends Exception {
|
||||
|
@ -1,5 +1,5 @@
|
||||
/* ownCloud Android Library is available under MIT license
|
||||
* Copyright (C) 2014 ownCloud (http://www.owncloud.org/)
|
||||
* Copyright (C) 2014 ownCloud Inc.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
@ -22,16 +22,16 @@
|
||||
*
|
||||
*/
|
||||
|
||||
package com.owncloud.android.lib.operations.common;
|
||||
package com.owncloud.android.lib.common.operations;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
import org.apache.commons.httpclient.Credentials;
|
||||
|
||||
import com.owncloud.android.lib.network.BearerCredentials;
|
||||
import com.owncloud.android.lib.network.OwnCloudClient;
|
||||
import com.owncloud.android.lib.network.OwnCloudClientFactory;
|
||||
import com.owncloud.android.lib.operations.common.RemoteOperationResult.ResultCode;
|
||||
import com.owncloud.android.lib.common.OwnCloudClient;
|
||||
import com.owncloud.android.lib.common.OwnCloudClientFactory;
|
||||
import com.owncloud.android.lib.common.network.BearerCredentials;
|
||||
import com.owncloud.android.lib.common.operations.RemoteOperationResult.ResultCode;
|
||||
|
||||
|
||||
|
@ -1,6 +1,5 @@
|
||||
/* ownCloud Android Library is available under MIT license
|
||||
* Copyright (C) 2014 ownCloud (http://www.owncloud.org/)
|
||||
* Copyright (C) 2012 Bartek Przybylski
|
||||
* Copyright (C) 2014 ownCloud Inc.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
@ -23,7 +22,7 @@
|
||||
*
|
||||
*/
|
||||
|
||||
package com.owncloud.android.lib.operations.common;
|
||||
package com.owncloud.android.lib.common.operations;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.Serializable;
|
||||
@ -42,8 +41,8 @@ import org.apache.commons.httpclient.HttpStatus;
|
||||
import org.apache.jackrabbit.webdav.DavException;
|
||||
import org.json.JSONException;
|
||||
|
||||
import com.owncloud.android.lib.accounts.AccountUtils.AccountNotFoundException;
|
||||
import com.owncloud.android.lib.network.CertificateCombinedException;
|
||||
import com.owncloud.android.lib.common.accounts.AccountUtils.AccountNotFoundException;
|
||||
import com.owncloud.android.lib.common.network.CertificateCombinedException;
|
||||
|
||||
import android.accounts.Account;
|
||||
import android.accounts.AccountsException;
|
@ -1,6 +1,5 @@
|
||||
/* ownCloud Android Library is available under MIT license
|
||||
* Copyright (C) 2014 ownCloud (http://www.owncloud.org/)
|
||||
* Copyright (C) 2012 Bartek Przybylski
|
||||
* Copyright (C) 2014 ownCloud Inc.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
@ -23,7 +22,7 @@
|
||||
*
|
||||
*/
|
||||
|
||||
package com.owncloud.android.lib.operations.remote;
|
||||
package com.owncloud.android.lib.resources.files;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
@ -34,10 +33,10 @@ import java.util.Random;
|
||||
import org.apache.commons.httpclient.HttpException;
|
||||
import org.apache.commons.httpclient.methods.PutMethod;
|
||||
|
||||
import com.owncloud.android.lib.network.ChunkFromFileChannelRequestEntity;
|
||||
import com.owncloud.android.lib.network.OwnCloudClient;
|
||||
import com.owncloud.android.lib.network.ProgressiveDataTransferer;
|
||||
import com.owncloud.android.lib.network.webdav.WebdavUtils;
|
||||
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;
|
||||
@ -60,7 +59,7 @@ public class ChunkedUploadRemoteFileOperation extends UploadRemoteFileOperation
|
||||
FileChannel channel = null;
|
||||
RandomAccessFile raf = null;
|
||||
try {
|
||||
File file = new File(mStoragePath);
|
||||
File file = new File(mLocalPath);
|
||||
raf = new RandomAccessFile(file, "r");
|
||||
channel = raf.getChannel();
|
||||
mEntity = new ChunkFromFileChannelRequestEntity(channel, mMimeType, CHUNK_SIZE, file);
|
||||
@ -82,7 +81,7 @@ public class ChunkedUploadRemoteFileOperation extends UploadRemoteFileOperation
|
||||
mPutMethod.setRequestEntity(mEntity);
|
||||
status = client.executeMethod(mPutMethod);
|
||||
client.exhaustResponse(mPutMethod.getResponseBodyAsStream());
|
||||
Log.d(TAG, "Upload of " + mStoragePath + " to " + mRemotePath + ", chunk index " + chunkIndex + ", count " + chunkCount + ", HTTP result status " + status);
|
||||
Log.d(TAG, "Upload of " + mLocalPath + " to " + mRemotePath + ", chunk index " + chunkIndex + ", count " + chunkCount + ", HTTP result status " + status);
|
||||
if (!isSuccess(status))
|
||||
break;
|
||||
}
|
@ -1,5 +1,5 @@
|
||||
/* ownCloud Android Library is available under MIT license
|
||||
* Copyright (C) 2014 ownCloud (http://www.owncloud.org/)
|
||||
* Copyright (C) 2014 ownCloud Inc.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
@ -22,19 +22,18 @@
|
||||
*
|
||||
*/
|
||||
|
||||
package com.owncloud.android.lib.operations.remote;
|
||||
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.network.OwnCloudClient;
|
||||
import com.owncloud.android.lib.network.webdav.WebdavUtils;
|
||||
import com.owncloud.android.lib.operations.common.RemoteOperation;
|
||||
import com.owncloud.android.lib.operations.common.RemoteOperationResult;
|
||||
import com.owncloud.android.lib.operations.common.RemoteOperationResult.ResultCode;
|
||||
import com.owncloud.android.lib.utils.FileUtils;
|
||||
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;
|
||||
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
/* ownCloud Android Library is available under MIT license
|
||||
* Copyright (C) 2014 ownCloud (http://www.owncloud.org/)
|
||||
* Copyright (C) 2014 ownCloud Inc.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
@ -22,7 +22,7 @@
|
||||
*
|
||||
*/
|
||||
|
||||
package com.owncloud.android.lib.operations.remote;
|
||||
package com.owncloud.android.lib.resources.files;
|
||||
|
||||
import java.io.BufferedInputStream;
|
||||
import java.io.File;
|
||||
@ -41,12 +41,12 @@ import org.apache.http.HttpStatus;
|
||||
|
||||
import android.util.Log;
|
||||
|
||||
import com.owncloud.android.lib.network.OnDatatransferProgressListener;
|
||||
import com.owncloud.android.lib.network.OwnCloudClient;
|
||||
import com.owncloud.android.lib.network.webdav.WebdavUtils;
|
||||
import com.owncloud.android.lib.operations.common.OperationCancelledException;
|
||||
import com.owncloud.android.lib.operations.common.RemoteOperation;
|
||||
import com.owncloud.android.lib.operations.common.RemoteOperationResult;
|
||||
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;
|
||||
|
||||
/**
|
||||
* Remote operation performing the download of a remote file in the ownCloud server.
|
||||
@ -65,11 +65,11 @@ public class DownloadRemoteFileOperation extends RemoteOperation {
|
||||
private GetMethod mGet;
|
||||
|
||||
private String mRemotePath;
|
||||
private String mDownloadFolderPath;
|
||||
private String mLocalFolderPath;
|
||||
|
||||
public DownloadRemoteFileOperation(String remotePath, String downloadFolderPath) {
|
||||
public DownloadRemoteFileOperation(String remotePath, String localFolderPath) {
|
||||
mRemotePath = remotePath;
|
||||
mDownloadFolderPath = downloadFolderPath;
|
||||
mLocalFolderPath = localFolderPath;
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -157,7 +157,7 @@ public class DownloadRemoteFileOperation extends RemoteOperation {
|
||||
}
|
||||
|
||||
private String getTmpPath() {
|
||||
return mDownloadFolderPath + mRemotePath;
|
||||
return mLocalFolderPath + mRemotePath;
|
||||
}
|
||||
|
||||
public void addDatatransferProgressListener (OnDatatransferProgressListener listener) {
|
@ -1,5 +1,5 @@
|
||||
/* ownCloud Android Library is available under MIT license
|
||||
* Copyright (C) 2014 ownCloud (http://www.owncloud.org/)
|
||||
* Copyright (C) 2014 ownCloud Inc.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
@ -22,15 +22,15 @@
|
||||
*
|
||||
*/
|
||||
|
||||
package com.owncloud.android.lib.operations.remote;
|
||||
package com.owncloud.android.lib.resources.files;
|
||||
|
||||
import org.apache.commons.httpclient.HttpStatus;
|
||||
import org.apache.commons.httpclient.methods.HeadMethod;
|
||||
|
||||
import com.owncloud.android.lib.network.OwnCloudClient;
|
||||
import com.owncloud.android.lib.network.webdav.WebdavUtils;
|
||||
import com.owncloud.android.lib.operations.common.RemoteOperation;
|
||||
import com.owncloud.android.lib.operations.common.RemoteOperationResult;
|
||||
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;
|
||||
@ -56,12 +56,12 @@ public class ExistenceCheckRemoteOperation extends RemoteOperation {
|
||||
/**
|
||||
* Full constructor. Success of the operation will depend upon the value of successIfAbsent.
|
||||
*
|
||||
* @param path Path to append to the URL owned by the client instance.
|
||||
* @param remotePath Path to append to the URL owned by the client instance.
|
||||
* @param context Android application context.
|
||||
* @param successIfAbsent When 'true', the operation finishes in success if the path does NOT exist in the remote server (HTTP 404).
|
||||
*/
|
||||
public ExistenceCheckRemoteOperation(String path, Context context, boolean successIfAbsent) {
|
||||
mPath = (path != null) ? path : "";
|
||||
public ExistenceCheckRemoteOperation(String remotePath, Context context, boolean successIfAbsent) {
|
||||
mPath = (remotePath != null) ? remotePath : "";
|
||||
mContext = context;
|
||||
mSuccessIfAbsent = successIfAbsent;
|
||||
}
|
@ -1,5 +1,5 @@
|
||||
/* ownCloud Android Library is available under MIT license
|
||||
* Copyright (C) 2014 ownCloud (http://www.owncloud.org/)
|
||||
* Copyright (C) 2014 ownCloud Inc.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
@ -22,7 +22,7 @@
|
||||
*
|
||||
*/
|
||||
|
||||
package com.owncloud.android.lib.utils;
|
||||
package com.owncloud.android.lib.resources.files;
|
||||
|
||||
import java.io.File;
|
||||
|
@ -1,5 +1,5 @@
|
||||
/* ownCloud Android Library is available under MIT license
|
||||
* Copyright (C) 2014 ownCloud (http://www.owncloud.org/)
|
||||
* Copyright (C) 2014 ownCloud Inc.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
@ -21,7 +21,7 @@
|
||||
* THE SOFTWARE.
|
||||
*
|
||||
*/
|
||||
package com.owncloud.android.lib.operations.remote;
|
||||
package com.owncloud.android.lib.resources.files;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
@ -32,12 +32,11 @@ import org.apache.jackrabbit.webdav.client.methods.PropFindMethod;
|
||||
|
||||
import android.util.Log;
|
||||
|
||||
import com.owncloud.android.lib.network.OwnCloudClient;
|
||||
import com.owncloud.android.lib.network.webdav.WebdavEntry;
|
||||
import com.owncloud.android.lib.network.webdav.WebdavUtils;
|
||||
import com.owncloud.android.lib.operations.common.RemoteFile;
|
||||
import com.owncloud.android.lib.operations.common.RemoteOperation;
|
||||
import com.owncloud.android.lib.operations.common.RemoteOperationResult;
|
||||
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;
|
||||
|
||||
|
||||
/**
|
@ -1,5 +1,5 @@
|
||||
/* ownCloud Android Library is available under MIT license
|
||||
* Copyright (C) 2014 ownCloud (http://www.owncloud.org/)
|
||||
* Copyright (C) 2014 ownCloud Inc.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
@ -22,7 +22,7 @@
|
||||
*
|
||||
*/
|
||||
|
||||
package com.owncloud.android.lib.operations.remote;
|
||||
package com.owncloud.android.lib.resources.files;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
@ -33,12 +33,11 @@ import org.apache.jackrabbit.webdav.client.methods.PropFindMethod;
|
||||
|
||||
import android.util.Log;
|
||||
|
||||
import com.owncloud.android.lib.network.OwnCloudClient;
|
||||
import com.owncloud.android.lib.network.webdav.WebdavEntry;
|
||||
import com.owncloud.android.lib.network.webdav.WebdavUtils;
|
||||
import com.owncloud.android.lib.operations.common.RemoteFile;
|
||||
import com.owncloud.android.lib.operations.common.RemoteOperation;
|
||||
import com.owncloud.android.lib.operations.common.RemoteOperationResult;
|
||||
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;
|
||||
|
||||
/**
|
||||
* Remote operation performing the read of remote file or folder in the ownCloud server.
|
||||
@ -127,24 +126,24 @@ public class ReadRemoteFolderOperation extends RemoteOperation {
|
||||
* Read the data retrieved from the server about the contents of the target folder
|
||||
*
|
||||
*
|
||||
* @param dataInServer Full response got from the server with the data of the target
|
||||
* @param remoteData Full response got from the server with the data of the target
|
||||
* folder and its direct children.
|
||||
* @param client Client instance to the remote server where the data were
|
||||
* retrieved.
|
||||
* @return
|
||||
*/
|
||||
private void readData(MultiStatus dataInServer, OwnCloudClient client) {
|
||||
private void readData(MultiStatus remoteData, OwnCloudClient client) {
|
||||
mFolderAndFiles = new ArrayList<Object>();
|
||||
|
||||
// parse data from remote folder
|
||||
WebdavEntry we = new WebdavEntry(dataInServer.getResponses()[0], client.getWebdavUri().getPath());
|
||||
WebdavEntry we = new WebdavEntry(remoteData.getResponses()[0], client.getWebdavUri().getPath());
|
||||
mFolderAndFiles.add(fillOCFile(we));
|
||||
|
||||
// loop to update every child
|
||||
RemoteFile remoteFile = null;
|
||||
for (int i = 1; i < dataInServer.getResponses().length; ++i) {
|
||||
for (int i = 1; i < remoteData.getResponses().length; ++i) {
|
||||
/// new OCFile instance with the data from the server
|
||||
we = new WebdavEntry(dataInServer.getResponses()[i], client.getWebdavUri().getPath());
|
||||
we = new WebdavEntry(remoteData.getResponses()[i], client.getWebdavUri().getPath());
|
||||
remoteFile = fillOCFile(we);
|
||||
mFolderAndFiles.add(remoteFile);
|
||||
}
|
@ -1,5 +1,5 @@
|
||||
/* ownCloud Android Library is available under MIT license
|
||||
* Copyright (C) 2014 ownCloud (http://www.owncloud.org/)
|
||||
* Copyright (C) 2014 ownCloud Inc.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
@ -22,15 +22,14 @@
|
||||
*
|
||||
*/
|
||||
|
||||
package com.owncloud.android.lib.operations.common;
|
||||
package com.owncloud.android.lib.resources.files;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
import android.os.Parcel;
|
||||
import android.os.Parcelable;
|
||||
|
||||
import com.owncloud.android.lib.network.webdav.WebdavEntry;
|
||||
import com.owncloud.android.lib.utils.FileUtils;
|
||||
import com.owncloud.android.lib.common.network.WebdavEntry;
|
||||
|
||||
/**
|
||||
* Contains the data of a Remote File from a WebDavEntry
|
@ -1,5 +1,5 @@
|
||||
/* ownCloud Android Library is available under MIT license
|
||||
* Copyright (C) 2014 ownCloud (http://www.owncloud.org/)
|
||||
* Copyright (C) 2014 ownCloud Inc.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
@ -22,17 +22,17 @@
|
||||
*
|
||||
*/
|
||||
|
||||
package com.owncloud.android.lib.operations.remote;
|
||||
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.network.OwnCloudClient;
|
||||
import com.owncloud.android.lib.network.webdav.WebdavUtils;
|
||||
import com.owncloud.android.lib.operations.common.RemoteOperation;
|
||||
import com.owncloud.android.lib.operations.common.RemoteOperationResult;
|
||||
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;
|
||||
|
||||
/**
|
||||
* Remote operation performing the removal of a remote file or folder in the ownCloud server.
|
@ -1,5 +1,5 @@
|
||||
/* ownCloud Android Library is available under MIT license
|
||||
* Copyright (C) 2014 ownCloud (http://www.owncloud.org/)
|
||||
* Copyright (C) 2014 ownCloud Inc.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
@ -22,7 +22,7 @@
|
||||
*
|
||||
*/
|
||||
|
||||
package com.owncloud.android.lib.operations.remote;
|
||||
package com.owncloud.android.lib.resources.files;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
@ -30,12 +30,11 @@ import org.apache.jackrabbit.webdav.client.methods.DavMethodBase;
|
||||
|
||||
import android.util.Log;
|
||||
|
||||
import com.owncloud.android.lib.network.OwnCloudClient;
|
||||
import com.owncloud.android.lib.network.webdav.WebdavUtils;
|
||||
import com.owncloud.android.lib.operations.common.RemoteOperation;
|
||||
import com.owncloud.android.lib.operations.common.RemoteOperationResult;
|
||||
import com.owncloud.android.lib.operations.common.RemoteOperationResult.ResultCode;
|
||||
import com.owncloud.android.lib.utils.FileUtils;
|
||||
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;
|
||||
|
||||
|
||||
/**
|
@ -1,5 +1,5 @@
|
||||
/* ownCloud Android Library is available under MIT license
|
||||
* Copyright (C) 2014 ownCloud (http://www.owncloud.org/)
|
||||
* Copyright (C) 2014 ownCloud Inc.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
@ -22,7 +22,7 @@
|
||||
*
|
||||
*/
|
||||
|
||||
package com.owncloud.android.lib.operations.remote;
|
||||
package com.owncloud.android.lib.resources.files;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
@ -35,14 +35,14 @@ import org.apache.commons.httpclient.methods.PutMethod;
|
||||
import org.apache.commons.httpclient.methods.RequestEntity;
|
||||
import org.apache.http.HttpStatus;
|
||||
|
||||
import com.owncloud.android.lib.network.FileRequestEntity;
|
||||
import com.owncloud.android.lib.network.OnDatatransferProgressListener;
|
||||
import com.owncloud.android.lib.network.OwnCloudClient;
|
||||
import com.owncloud.android.lib.network.ProgressiveDataTransferer;
|
||||
import com.owncloud.android.lib.network.webdav.WebdavUtils;
|
||||
import com.owncloud.android.lib.operations.common.OperationCancelledException;
|
||||
import com.owncloud.android.lib.operations.common.RemoteOperation;
|
||||
import com.owncloud.android.lib.operations.common.RemoteOperationResult;
|
||||
import com.owncloud.android.lib.common.OwnCloudClient;
|
||||
import com.owncloud.android.lib.common.network.FileRequestEntity;
|
||||
import com.owncloud.android.lib.common.network.OnDatatransferProgressListener;
|
||||
import com.owncloud.android.lib.common.network.ProgressiveDataTransferer;
|
||||
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;
|
||||
|
||||
/**
|
||||
* Remote operation performing the upload of a remote file to the ownCloud server.
|
||||
@ -54,7 +54,7 @@ import com.owncloud.android.lib.operations.common.RemoteOperationResult;
|
||||
public class UploadRemoteFileOperation extends RemoteOperation {
|
||||
|
||||
|
||||
protected String mStoragePath;
|
||||
protected String mLocalPath;
|
||||
protected String mRemotePath;
|
||||
protected String mMimeType;
|
||||
protected PutMethod mPutMethod = null;
|
||||
@ -64,8 +64,8 @@ public class UploadRemoteFileOperation extends RemoteOperation {
|
||||
|
||||
protected RequestEntity mEntity = null;
|
||||
|
||||
public UploadRemoteFileOperation(String storagePath, String remotePath, String mimeType) {
|
||||
mStoragePath = storagePath;
|
||||
public UploadRemoteFileOperation(String localPath, String remotePath, String mimeType) {
|
||||
mLocalPath = localPath;
|
||||
mRemotePath = remotePath;
|
||||
mMimeType = mimeType;
|
||||
}
|
||||
@ -106,7 +106,7 @@ public class UploadRemoteFileOperation extends RemoteOperation {
|
||||
protected int uploadFile(OwnCloudClient client) throws HttpException, IOException, OperationCancelledException {
|
||||
int status = -1;
|
||||
try {
|
||||
File f = new File(mStoragePath);
|
||||
File f = new File(mLocalPath);
|
||||
mEntity = new FileRequestEntity(f, mMimeType);
|
||||
synchronized (mDataTransferListeners) {
|
||||
((ProgressiveDataTransferer)mEntity).addDatatransferProgressListeners(mDataTransferListeners);
|
@ -1,5 +1,5 @@
|
||||
/* ownCloud Android Library is available under MIT license
|
||||
* Copyright (C) 2014 ownCloud (http://www.owncloud.org/)
|
||||
* Copyright (C) 2014 ownCloud Inc.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
@ -22,7 +22,7 @@
|
||||
*
|
||||
*/
|
||||
|
||||
package com.owncloud.android.lib.operations.remote;
|
||||
package com.owncloud.android.lib.resources.shares;
|
||||
|
||||
import java.io.ByteArrayInputStream;
|
||||
import java.io.InputStream;
|
||||
@ -33,14 +33,10 @@ import org.apache.http.HttpStatus;
|
||||
|
||||
import android.util.Log;
|
||||
|
||||
import com.owncloud.android.lib.network.OwnCloudClient;
|
||||
import com.owncloud.android.lib.operations.common.OCShare;
|
||||
import com.owncloud.android.lib.operations.common.RemoteOperation;
|
||||
import com.owncloud.android.lib.operations.common.RemoteOperationResult;
|
||||
import com.owncloud.android.lib.operations.common.RemoteOperationResult.ResultCode;
|
||||
import com.owncloud.android.lib.operations.common.ShareType;
|
||||
import com.owncloud.android.lib.utils.ShareUtils;
|
||||
import com.owncloud.android.lib.utils.ShareXMLParser;
|
||||
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;
|
||||
|
||||
/**
|
||||
* Creates a new share. This allows sharing with a user or group or as a link.
|
||||
@ -48,9 +44,9 @@ import com.owncloud.android.lib.utils.ShareXMLParser;
|
||||
* @author masensio
|
||||
*
|
||||
*/
|
||||
public class CreateShareRemoteOperation extends RemoteOperation {
|
||||
public class CreateRemoteShareOperation extends RemoteOperation {
|
||||
|
||||
private static final String TAG = CreateShareRemoteOperation.class.getSimpleName();
|
||||
private static final String TAG = CreateRemoteShareOperation.class.getSimpleName();
|
||||
|
||||
private static final String PARAM_PATH = "path";
|
||||
private static final String PARAM_SHARE_TYPE = "shareType";
|
||||
@ -61,7 +57,7 @@ public class CreateShareRemoteOperation extends RemoteOperation {
|
||||
|
||||
private ArrayList<OCShare> mShares; // List of shares for result, one share in this case
|
||||
|
||||
private String mPath;
|
||||
private String mRemoteFilePath;
|
||||
private ShareType mShareType;
|
||||
private String mShareWith;
|
||||
private boolean mPublicUpload;
|
||||
@ -70,26 +66,26 @@ public class CreateShareRemoteOperation extends RemoteOperation {
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
* @param path Full path of the file/folder being shared. Mandatory argument
|
||||
* @param shareType ‘0’ = user, ‘1’ = group, ‘3’ = Public link. Mandatory argument
|
||||
* @param shareWith User/group ID with who the file should be shared. This is mandatory for shareType of 0 or 1
|
||||
* @param publicUpload If ‘false’ (default) public cannot upload to a public shared folder.
|
||||
* If ‘true’ public can upload to a shared folder. Only available for public link shares
|
||||
* @param password Password to protect a public link share. Only available for public link shares
|
||||
* @param permissions 1 - Read only – Default for “public” shares
|
||||
* 2 - Update
|
||||
* 4 - Create
|
||||
* 8 - Delete
|
||||
* 16- Re-share
|
||||
* 31- All above – Default for “private” shares
|
||||
* For user or group shares.
|
||||
* To obtain combinations, add the desired values together.
|
||||
* For instance, for “Re-Share”, “delete”, “read”, “update”, add 16+8+2+1 = 27.
|
||||
* @param remoteFilePath Full path of the file/folder being shared. Mandatory argument
|
||||
* @param shareType ‘0’ = user, ‘1’ = group, ‘3’ = Public link. Mandatory argument
|
||||
* @param shareWith User/group ID with who the file should be shared. This is mandatory for shareType of 0 or 1
|
||||
* @param publicUpload If ‘false’ (default) public cannot upload to a public shared folder.
|
||||
* If ‘true’ public can upload to a shared folder. Only available for public link shares
|
||||
* @param password Password to protect a public link share. Only available for public link shares
|
||||
* @param permissions 1 - Read only – Default for “public” shares
|
||||
* 2 - Update
|
||||
* 4 - Create
|
||||
* 8 - Delete
|
||||
* 16- Re-share
|
||||
* 31- All above – Default for “private” shares
|
||||
* For user or group shares.
|
||||
* To obtain combinations, add the desired values together.
|
||||
* For instance, for “Re-Share”, “delete”, “read”, “update”, add 16+8+2+1 = 27.
|
||||
*/
|
||||
public CreateShareRemoteOperation(String path, ShareType shareType, String shareWith, boolean publicUpload,
|
||||
public CreateRemoteShareOperation(String remoteFilePath, ShareType shareType, String shareWith, boolean publicUpload,
|
||||
String password, int permissions) {
|
||||
|
||||
mPath = path;
|
||||
mRemoteFilePath = remoteFilePath;
|
||||
mShareType = shareType;
|
||||
mShareWith = shareWith;
|
||||
mPublicUpload = publicUpload;
|
||||
@ -106,11 +102,11 @@ public class CreateShareRemoteOperation extends RemoteOperation {
|
||||
|
||||
try {
|
||||
// Post Method
|
||||
post = new PostMethod(client.getBaseUri() + ShareUtils.SHAREAPI_ROUTE);
|
||||
Log.d(TAG, "URL ------> " + client.getBaseUri() + ShareUtils.SHAREAPI_ROUTE);
|
||||
post = new PostMethod(client.getBaseUri() + ShareUtils.SHARING_API_PATH);
|
||||
Log.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, mPath);
|
||||
post.addParameter(PARAM_PATH, mRemoteFilePath);
|
||||
post.addParameter(PARAM_SHARE_TYPE, Integer.toString(mShareType.getValue()));
|
||||
post.addParameter(PARAM_SHARE_WITH, mShareWith);
|
||||
post.addParameter(PARAM_PUBLIC_UPLOAD, Boolean.toString(mPublicUpload));
|
@ -1,5 +1,5 @@
|
||||
/* ownCloud Android Library is available under MIT license
|
||||
* Copyright (C) 2014 ownCloud (http://www.owncloud.org/)
|
||||
* Copyright (C) 2014 ownCloud Inc.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
@ -22,7 +22,7 @@
|
||||
*
|
||||
*/
|
||||
|
||||
package com.owncloud.android.lib.operations.remote;
|
||||
package com.owncloud.android.lib.resources.shares;
|
||||
|
||||
import java.io.ByteArrayInputStream;
|
||||
import java.io.InputStream;
|
||||
@ -34,13 +34,10 @@ import org.apache.http.HttpStatus;
|
||||
|
||||
import android.util.Log;
|
||||
|
||||
import com.owncloud.android.lib.network.OwnCloudClient;
|
||||
import com.owncloud.android.lib.operations.common.OCShare;
|
||||
import com.owncloud.android.lib.operations.common.RemoteOperation;
|
||||
import com.owncloud.android.lib.operations.common.RemoteOperationResult;
|
||||
import com.owncloud.android.lib.operations.common.RemoteOperationResult.ResultCode;
|
||||
import com.owncloud.android.lib.utils.ShareUtils;
|
||||
import com.owncloud.android.lib.utils.ShareXMLParser;
|
||||
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;
|
||||
|
||||
/**
|
||||
* Provide a list shares for a specific file.
|
||||
@ -51,9 +48,9 @@ import com.owncloud.android.lib.utils.ShareXMLParser;
|
||||
*
|
||||
*/
|
||||
|
||||
public class GetSharesForFileRemoteOperation extends RemoteOperation {
|
||||
public class GetRemoteSharesForFileOperation extends RemoteOperation {
|
||||
|
||||
private static final String TAG = GetSharesForFileRemoteOperation.class.getSimpleName();
|
||||
private static final String TAG = GetRemoteSharesForFileOperation.class.getSimpleName();
|
||||
|
||||
private static final String PARAM_PATH = "path";
|
||||
private static final String PARAM_RESHARES = "reshares";
|
||||
@ -61,21 +58,21 @@ public class GetSharesForFileRemoteOperation extends RemoteOperation {
|
||||
|
||||
private ArrayList<OCShare> mShares; // List of shares for result, one share in this case
|
||||
|
||||
private String mPath;
|
||||
private String mRemoteFilePath;
|
||||
private boolean mReshares;
|
||||
private boolean mSubfiles;
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @param path Path to file or folder
|
||||
* @param reshares If set to ‘false’ (default), only shares from the current user are returned
|
||||
* If set to ‘true’, all shares from the given file are returned
|
||||
* @param subfiles If set to ‘false’ (default), lists only the folder being shared
|
||||
* If set to ‘true’, all shared files within the folder are returned.
|
||||
* @param remoteFilePath Path to file or folder
|
||||
* @param reshares If set to ‘false’ (default), only shares from the current user are returned
|
||||
* If set to ‘true’, all shares from the given file are returned
|
||||
* @param subfiles If set to ‘false’ (default), lists only the folder being shared
|
||||
* If set to ‘true’, all shared files within the folder are returned.
|
||||
*/
|
||||
public GetSharesForFileRemoteOperation(String path, boolean reshares, boolean subfiles) {
|
||||
mPath = path;
|
||||
public GetRemoteSharesForFileOperation(String remoteFilePath, boolean reshares, boolean subfiles) {
|
||||
mRemoteFilePath = remoteFilePath;
|
||||
mReshares = reshares;
|
||||
mSubfiles = subfiles;
|
||||
}
|
||||
@ -89,12 +86,12 @@ public class GetSharesForFileRemoteOperation extends RemoteOperation {
|
||||
|
||||
try {
|
||||
// Get Method
|
||||
get = new GetMethod(client.getBaseUri() + ShareUtils.SHAREAPI_ROUTE);
|
||||
Log.d(TAG, "URL ------> " + client.getBaseUri() + ShareUtils.SHAREAPI_ROUTE);
|
||||
get = new GetMethod(client.getBaseUri() + ShareUtils.SHARING_API_PATH);
|
||||
Log.d(TAG, "URL ------> " + client.getBaseUri() + ShareUtils.SHARING_API_PATH);
|
||||
|
||||
// Add Parameters to Get Method
|
||||
get.setQueryString(new NameValuePair[] {
|
||||
new NameValuePair(PARAM_PATH, mPath),
|
||||
new NameValuePair(PARAM_PATH, mRemoteFilePath),
|
||||
new NameValuePair(PARAM_RESHARES, String.valueOf(mReshares)),
|
||||
new NameValuePair(PARAM_SUBFILES, String.valueOf(mSubfiles))
|
||||
});
|
@ -1,5 +1,5 @@
|
||||
/* ownCloud Android Library is available under MIT license
|
||||
* Copyright (C) 2014 ownCloud (http://www.owncloud.org/)
|
||||
* Copyright (C) 2014 ownCloud Inc.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
@ -22,7 +22,7 @@
|
||||
*
|
||||
*/
|
||||
|
||||
package com.owncloud.android.lib.operations.remote;
|
||||
package com.owncloud.android.lib.resources.shares;
|
||||
|
||||
import java.io.ByteArrayInputStream;
|
||||
import java.io.InputStream;
|
||||
@ -31,13 +31,10 @@ import java.util.ArrayList;
|
||||
import org.apache.commons.httpclient.methods.GetMethod;
|
||||
import org.apache.http.HttpStatus;
|
||||
|
||||
import com.owncloud.android.lib.network.OwnCloudClient;
|
||||
import com.owncloud.android.lib.operations.common.RemoteOperation;
|
||||
import com.owncloud.android.lib.operations.common.RemoteOperationResult;
|
||||
import com.owncloud.android.lib.operations.common.RemoteOperationResult.ResultCode;
|
||||
import com.owncloud.android.lib.operations.common.OCShare;
|
||||
import com.owncloud.android.lib.utils.ShareUtils;
|
||||
import com.owncloud.android.lib.utils.ShareXMLParser;
|
||||
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;
|
||||
|
||||
@ -69,8 +66,8 @@ public class GetRemoteSharesOperation extends RemoteOperation {
|
||||
|
||||
// Get the response
|
||||
try{
|
||||
get = new GetMethod(client.getBaseUri() + ShareUtils.SHAREAPI_ROUTE);
|
||||
Log.d(TAG, "URL ------> " + client.getBaseUri() + ShareUtils.SHAREAPI_ROUTE);
|
||||
get = new GetMethod(client.getBaseUri() + ShareUtils.SHARING_API_PATH);
|
||||
Log.d(TAG, "URL ------> " + client.getBaseUri() + ShareUtils.SHARING_API_PATH);
|
||||
status = client.executeMethod(get);
|
||||
if(isSuccess(status)) {
|
||||
Log.d(TAG, "Obtain RESPONSE");
|
@ -1,5 +1,5 @@
|
||||
/* ownCloud Android Library is available under MIT license
|
||||
* Copyright (C) 2014 ownCloud (http://www.owncloud.org/)
|
||||
* Copyright (C) 2014 ownCloud Inc.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
@ -22,11 +22,11 @@
|
||||
*
|
||||
*/
|
||||
|
||||
package com.owncloud.android.lib.operations.common;
|
||||
package com.owncloud.android.lib.resources.shares;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
import com.owncloud.android.lib.utils.FileUtils;
|
||||
import com.owncloud.android.lib.resources.files.FileUtils;
|
||||
|
||||
import android.os.Parcel;
|
||||
import android.os.Parcelable;
|
@ -1,5 +1,5 @@
|
||||
/* ownCloud Android Library is available under MIT license
|
||||
* Copyright (C) 2014 ownCloud (http://www.owncloud.org/)
|
||||
* Copyright (C) 2014 ownCloud Inc.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
@ -22,7 +22,7 @@
|
||||
*
|
||||
*/
|
||||
|
||||
package com.owncloud.android.lib.operations.remote;
|
||||
package com.owncloud.android.lib.resources.shares;
|
||||
|
||||
import java.io.ByteArrayInputStream;
|
||||
import java.io.InputStream;
|
||||
@ -32,12 +32,10 @@ import org.apache.jackrabbit.webdav.client.methods.DeleteMethod;
|
||||
|
||||
import android.util.Log;
|
||||
|
||||
import com.owncloud.android.lib.network.OwnCloudClient;
|
||||
import com.owncloud.android.lib.operations.common.RemoteOperation;
|
||||
import com.owncloud.android.lib.operations.common.RemoteOperationResult;
|
||||
import com.owncloud.android.lib.operations.common.RemoteOperationResult.ResultCode;
|
||||
import com.owncloud.android.lib.utils.ShareUtils;
|
||||
import com.owncloud.android.lib.utils.ShareXMLParser;
|
||||
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;
|
||||
|
||||
/**
|
||||
* Remove a share
|
||||
@ -50,16 +48,16 @@ public class RemoveRemoteShareOperation extends RemoteOperation {
|
||||
|
||||
private static final String TAG = RemoveRemoteShareOperation.class.getSimpleName();
|
||||
|
||||
private int mIdShare;
|
||||
private int mRemoteShareId;
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @param idShare Share ID
|
||||
* @param remoteShareId Share ID
|
||||
*/
|
||||
|
||||
public RemoveRemoteShareOperation(int idShare) {
|
||||
mIdShare = idShare;
|
||||
public RemoveRemoteShareOperation(int remoteShareId) {
|
||||
mRemoteShareId = remoteShareId;
|
||||
|
||||
}
|
||||
|
||||
@ -71,9 +69,9 @@ public class RemoveRemoteShareOperation extends RemoteOperation {
|
||||
DeleteMethod delete = null;
|
||||
|
||||
try {
|
||||
String id = "/" + String.valueOf(mIdShare);
|
||||
delete = new DeleteMethod(client.getBaseUri() + ShareUtils.SHAREAPI_ROUTE + id);
|
||||
Log.d(TAG, "URL ------> " + client.getBaseUri() + ShareUtils.SHAREAPI_ROUTE + id);
|
||||
String id = "/" + String.valueOf(mRemoteShareId);
|
||||
delete = new DeleteMethod(client.getBaseUri() + ShareUtils.SHARING_API_PATH + id);
|
||||
Log.d(TAG, "URL ------> " + client.getBaseUri() + ShareUtils.SHARING_API_PATH + id);
|
||||
|
||||
status = client.executeMethod(delete);
|
||||
|
@ -1,5 +1,5 @@
|
||||
/* ownCloud Android Library is available under MIT license
|
||||
* Copyright (C) 2014 ownCloud (http://www.owncloud.org/)
|
||||
* Copyright (C) 2014 ownCloud Inc.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
@ -22,7 +22,7 @@
|
||||
*
|
||||
*/
|
||||
|
||||
package com.owncloud.android.lib.operations.common;
|
||||
package com.owncloud.android.lib.resources.shares;
|
||||
|
||||
/**
|
||||
* Enum for Share Type, with values:
|
@ -1,5 +1,5 @@
|
||||
/* ownCloud Android Library is available under MIT license
|
||||
* Copyright (C) 2014 ownCloud (http://www.owncloud.org/)
|
||||
* Copyright (C) 2014 ownCloud Inc.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
@ -22,7 +22,7 @@
|
||||
*
|
||||
*/
|
||||
|
||||
package com.owncloud.android.lib.utils;
|
||||
package com.owncloud.android.lib.resources.shares;
|
||||
|
||||
/**
|
||||
* Contains Constants for Share Operation
|
||||
@ -34,6 +34,6 @@ package com.owncloud.android.lib.utils;
|
||||
public class ShareUtils {
|
||||
|
||||
// OCS Route
|
||||
public static final String SHAREAPI_ROUTE ="/ocs/v1.php/apps/files_sharing/api/v1/shares";
|
||||
public static final String SHARING_API_PATH ="/ocs/v1.php/apps/files_sharing/api/v1/shares";
|
||||
|
||||
}
|
@ -1,5 +1,5 @@
|
||||
/* ownCloud Android Library is available under MIT license
|
||||
* Copyright (C) 2014 ownCloud (http://www.owncloud.org/)
|
||||
* Copyright (C) 2014 ownCloud Inc.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
@ -22,7 +22,7 @@
|
||||
*
|
||||
*/
|
||||
|
||||
package com.owncloud.android.lib.utils;
|
||||
package com.owncloud.android.lib.resources.shares;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
@ -35,8 +35,7 @@ import org.xmlpull.v1.XmlPullParserFactory;
|
||||
import android.util.Log;
|
||||
import android.util.Xml;
|
||||
|
||||
import com.owncloud.android.lib.operations.common.OCShare;
|
||||
import com.owncloud.android.lib.operations.common.ShareType;
|
||||
import com.owncloud.android.lib.resources.files.FileUtils;
|
||||
|
||||
/**
|
||||
* Parser for Share API Response
|
@ -1,5 +1,5 @@
|
||||
/* ownCloud Android Library is available under MIT license
|
||||
* Copyright (C) 2014 ownCloud (http://www.owncloud.org/)
|
||||
* Copyright (C) 2014 ownCloud Inc.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
@ -22,18 +22,17 @@
|
||||
*
|
||||
*/
|
||||
|
||||
package com.owncloud.android.lib.operations.remote;
|
||||
package com.owncloud.android.lib.resources.status;
|
||||
|
||||
import org.apache.commons.httpclient.HttpStatus;
|
||||
import org.apache.commons.httpclient.methods.GetMethod;
|
||||
import org.json.JSONException;
|
||||
import org.json.JSONObject;
|
||||
|
||||
import com.owncloud.android.lib.accounts.AccountUtils;
|
||||
import com.owncloud.android.lib.network.OwnCloudClient;
|
||||
import com.owncloud.android.lib.operations.common.RemoteOperation;
|
||||
import com.owncloud.android.lib.operations.common.RemoteOperationResult;
|
||||
import com.owncloud.android.lib.utils.OwnCloudVersion;
|
||||
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 android.content.Context;
|
||||
import android.net.ConnectivityManager;
|
||||
@ -48,12 +47,12 @@ import android.util.Log;
|
||||
*
|
||||
*/
|
||||
|
||||
public class OwnCloudServerCheckOperation extends RemoteOperation {
|
||||
public class GetRemoteStatusOperation extends RemoteOperation {
|
||||
|
||||
/** Maximum time to wait for a response from the server when the connection is being tested, in MILLISECONDs. */
|
||||
public static final int TRY_CONNECTION_TIMEOUT = 5000;
|
||||
|
||||
private static final String TAG = OwnCloudServerCheckOperation.class.getSimpleName();
|
||||
private static final String TAG = GetRemoteStatusOperation.class.getSimpleName();
|
||||
|
||||
private static final String OCVERSION_SHARED_SUPPORTED = "5.0.13";
|
||||
|
||||
@ -67,7 +66,7 @@ public class OwnCloudServerCheckOperation extends RemoteOperation {
|
||||
private OwnCloudVersion mOCVersion;
|
||||
private OwnCloudVersion mOCVersionString;
|
||||
|
||||
public OwnCloudServerCheckOperation(String url, Context context) {
|
||||
public GetRemoteStatusOperation(String url, Context context) {
|
||||
mUrl = url;
|
||||
mContext = context;
|
||||
mOCVersion = null;
|
@ -1,5 +1,5 @@
|
||||
/* ownCloud Android Library is available under MIT license
|
||||
* Copyright (C) 2014 ownCloud (http://www.owncloud.org/)
|
||||
* Copyright (C) 2014 ownCloud Inc.
|
||||
* Copyright (C) 2012 Bartek Przybylski
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
@ -23,7 +23,7 @@
|
||||
*
|
||||
*/
|
||||
|
||||
package com.owncloud.android.lib.utils;
|
||||
package com.owncloud.android.lib.resources.status;
|
||||
|
||||
public class OwnCloudVersion implements Comparable<OwnCloudVersion> {
|
||||
public static final OwnCloudVersion owncloud_v1 = new OwnCloudVersion(
|
@ -1,5 +1,5 @@
|
||||
/* ownCloud Android Library is available under MIT license
|
||||
* Copyright (C) 2014 ownCloud (http://www.owncloud.org/)
|
||||
* Copyright (C) 2014 ownCloud Inc.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
@ -22,7 +22,7 @@
|
||||
*
|
||||
*/
|
||||
|
||||
package com.owncloud.android.lib.operations.remote;
|
||||
package com.owncloud.android.lib.resources.users;
|
||||
|
||||
import org.apache.commons.httpclient.methods.GetMethod;
|
||||
import org.apache.http.HttpStatus;
|
||||
@ -30,9 +30,9 @@ import org.json.JSONObject;
|
||||
|
||||
import android.util.Log;
|
||||
|
||||
import com.owncloud.android.lib.network.OwnCloudClient;
|
||||
import com.owncloud.android.lib.operations.common.RemoteOperation;
|
||||
import com.owncloud.android.lib.operations.common.RemoteOperationResult;
|
||||
import com.owncloud.android.lib.common.OwnCloudClient;
|
||||
import com.owncloud.android.lib.common.operations.RemoteOperation;
|
||||
import com.owncloud.android.lib.common.operations.RemoteOperationResult;
|
||||
|
||||
|
||||
/**
|
||||
@ -44,9 +44,9 @@ import com.owncloud.android.lib.operations.common.RemoteOperationResult;
|
||||
* email
|
||||
*/
|
||||
|
||||
public class GetUserNameRemoteOperation extends RemoteOperation {
|
||||
public class GetRemoteUserNameOperation extends RemoteOperation {
|
||||
|
||||
private static final String TAG = GetUserNameRemoteOperation.class.getSimpleName();
|
||||
private static final String TAG = GetRemoteUserNameOperation.class.getSimpleName();
|
||||
|
||||
// HEADER
|
||||
private static final String HEADER_OCS_API = "OCS-APIREQUEST";
|
||||
@ -69,7 +69,7 @@ public class GetUserNameRemoteOperation extends RemoteOperation {
|
||||
}
|
||||
|
||||
|
||||
public GetUserNameRemoteOperation() {
|
||||
public GetRemoteUserNameOperation() {
|
||||
}
|
||||
|
||||
@Override
|
@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- ownCloud Android Library is available under MIT license
|
||||
Copyright (C) 2014 ownCloud (http://www.owncloud.org/)
|
||||
Copyright (C) 2014 ownCloud Inc.
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
|
@ -1,5 +1,5 @@
|
||||
<!-- ownCloud Android Library is available under MIT license
|
||||
Copyright (C) 2014 ownCloud (http://www.owncloud.org/)
|
||||
Copyright (C) 2014 ownCloud Inc.
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
|
@ -1,5 +1,5 @@
|
||||
<!-- ownCloud Android Library is available under MIT license
|
||||
Copyright (C) 2014 ownCloud (http://www.owncloud.org/)
|
||||
Copyright (C) 2014 ownCloud Inc.
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
|
@ -1,5 +1,5 @@
|
||||
<!-- ownCloud Android Library is available under MIT license
|
||||
Copyright (C) 2014 ownCloud (http://www.owncloud.org/)
|
||||
Copyright (C) 2014 ownCloud Inc.
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
|
@ -1,5 +1,5 @@
|
||||
<!-- ownCloud Android Library is available under MIT license
|
||||
Copyright (C) 2014 ownCloud (http://www.owncloud.org/)
|
||||
Copyright (C) 2014 ownCloud Inc.
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
|
@ -1,5 +1,5 @@
|
||||
<!-- ownCloud Android Library is available under MIT license
|
||||
Copyright (C) 2014 ownCloud (http://www.owncloud.org/)
|
||||
Copyright (C) 2014 ownCloud Inc.
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
|
@ -1,5 +1,5 @@
|
||||
<!-- ownCloud Android Library is available under MIT license
|
||||
Copyright (C) 2014 ownCloud (http://www.owncloud.org/)
|
||||
Copyright (C) 2014 ownCloud Inc.
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
|
@ -1,5 +1,5 @@
|
||||
<!-- ownCloud Android Library is available under MIT license
|
||||
Copyright (C) 2014 ownCloud (http://www.owncloud.org/)
|
||||
Copyright (C) 2014 ownCloud Inc.
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
|
@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- ownCloud Android Library is available under MIT license
|
||||
Copyright (C) 2014 ownCloud (http://www.owncloud.org/)
|
||||
Copyright (C) 2014 ownCloud Inc.
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
|
@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- ownCloud Android Library is available under MIT license
|
||||
Copyright (C) 2014 ownCloud (http://www.owncloud.org/)
|
||||
Copyright (C) 2014 ownCloud Inc.
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
|
@ -1,5 +1,5 @@
|
||||
<!-- ownCloud Android Library is available under MIT license
|
||||
Copyright (C) 2014 ownCloud (http://www.owncloud.org/)
|
||||
Copyright (C) 2014 ownCloud Inc.
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
|
@ -1,5 +1,5 @@
|
||||
/* ownCloud Android Library is available under MIT license
|
||||
* Copyright (C) 2014 ownCloud (http://www.owncloud.org/)
|
||||
* Copyright (C) 2014 ownCloud Inc.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
@ -26,21 +26,21 @@ package com.owncloud.android.lib.test_project;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
import com.owncloud.android.lib.network.OwnCloudClientFactory;
|
||||
import com.owncloud.android.lib.network.OwnCloudClient;
|
||||
import com.owncloud.android.lib.operations.common.RemoteFile;
|
||||
import com.owncloud.android.lib.operations.common.RemoteOperationResult;
|
||||
import com.owncloud.android.lib.operations.common.ShareType;
|
||||
import com.owncloud.android.lib.operations.remote.ChunkedUploadRemoteFileOperation;
|
||||
import com.owncloud.android.lib.operations.remote.CreateRemoteFolderOperation;
|
||||
import com.owncloud.android.lib.operations.remote.CreateShareRemoteOperation;
|
||||
import com.owncloud.android.lib.operations.remote.DownloadRemoteFileOperation;
|
||||
import com.owncloud.android.lib.operations.remote.GetRemoteSharesOperation;
|
||||
import com.owncloud.android.lib.operations.remote.ReadRemoteFolderOperation;
|
||||
import com.owncloud.android.lib.operations.remote.RemoveRemoteFileOperation;
|
||||
import com.owncloud.android.lib.operations.remote.RenameRemoteFileOperation;
|
||||
import com.owncloud.android.lib.operations.remote.UploadRemoteFileOperation;
|
||||
import com.owncloud.android.lib.operations.remote.RemoveRemoteShareOperation;
|
||||
import com.owncloud.android.lib.common.OwnCloudClientFactory;
|
||||
import com.owncloud.android.lib.common.OwnCloudClient;
|
||||
import com.owncloud.android.lib.resources.files.RemoteFile;
|
||||
import com.owncloud.android.lib.common.operations.RemoteOperationResult;
|
||||
import com.owncloud.android.lib.resources.files.ChunkedUploadRemoteFileOperation;
|
||||
import com.owncloud.android.lib.resources.files.CreateRemoteFolderOperation;
|
||||
import com.owncloud.android.lib.resources.files.DownloadRemoteFileOperation;
|
||||
import com.owncloud.android.lib.resources.files.ReadRemoteFolderOperation;
|
||||
import com.owncloud.android.lib.resources.files.RemoveRemoteFileOperation;
|
||||
import com.owncloud.android.lib.resources.files.RenameRemoteFileOperation;
|
||||
import com.owncloud.android.lib.resources.files.UploadRemoteFileOperation;
|
||||
import com.owncloud.android.lib.resources.shares.CreateRemoteShareOperation;
|
||||
import com.owncloud.android.lib.resources.shares.GetRemoteSharesOperation;
|
||||
import com.owncloud.android.lib.resources.shares.RemoveRemoteShareOperation;
|
||||
import com.owncloud.android.lib.resources.shares.ShareType;
|
||||
import com.owncloud.android.lib.test_project.R;
|
||||
|
||||
import android.net.Uri;
|
||||
@ -228,7 +228,7 @@ public class TestActivity extends Activity {
|
||||
public RemoteOperationResult createShare(String path, ShareType shareType, String shareWith, boolean publicUpload,
|
||||
String password, int permissions){
|
||||
|
||||
CreateShareRemoteOperation createOperation = new CreateShareRemoteOperation(path, shareType, shareWith, publicUpload, password, permissions);
|
||||
CreateRemoteShareOperation createOperation = new CreateRemoteShareOperation(path, shareType, shareWith, publicUpload, password, permissions);
|
||||
RemoteOperationResult result = createOperation.execute(mClient);
|
||||
|
||||
return result;
|
||||
|
@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- ownCloud Android Library is available under MIT license
|
||||
Copyright (C) 2014 ownCloud (http://www.owncloud.org/)
|
||||
Copyright (C) 2014 ownCloud Inc.
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
|
@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- ownCloud Android Library is available under MIT license
|
||||
Copyright (C) 2014 ownCloud (http://www.owncloud.org/)
|
||||
Copyright (C) 2014 ownCloud Inc.
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
|
@ -1,5 +1,5 @@
|
||||
/* ownCloud Android Library is available under MIT license
|
||||
* Copyright (C) 2014 ownCloud (http://www.owncloud.org/)
|
||||
* Copyright (C) 2014 ownCloud Inc.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
@ -26,8 +26,8 @@ package com.owncloud.android.lib.test_project.test;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Date;
|
||||
|
||||
import com.owncloud.android.lib.operations.common.RemoteOperationResult;
|
||||
import com.owncloud.android.lib.operations.common.RemoteOperationResult.ResultCode;
|
||||
import com.owncloud.android.lib.common.operations.RemoteOperationResult;
|
||||
import com.owncloud.android.lib.common.operations.RemoteOperationResult.ResultCode;
|
||||
import com.owncloud.android.lib.test_project.TestActivity;
|
||||
|
||||
import android.test.ActivityInstrumentationTestCase2;
|
||||
|
@ -1,5 +1,5 @@
|
||||
/* ownCloud Android Library is available under MIT license
|
||||
* Copyright (C) 2014 ownCloud (http://www.owncloud.org/)
|
||||
* Copyright (C) 2014 ownCloud Inc.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
@ -24,8 +24,8 @@
|
||||
|
||||
package com.owncloud.android.lib.test_project.test;
|
||||
|
||||
import com.owncloud.android.lib.operations.common.RemoteOperationResult;
|
||||
import com.owncloud.android.lib.operations.common.ShareType;
|
||||
import com.owncloud.android.lib.common.operations.RemoteOperationResult;
|
||||
import com.owncloud.android.lib.resources.shares.ShareType;
|
||||
import com.owncloud.android.lib.test_project.TestActivity;
|
||||
|
||||
import android.test.ActivityInstrumentationTestCase2;
|
||||
|
@ -1,5 +1,5 @@
|
||||
/* ownCloud Android Library is available under MIT license
|
||||
* Copyright (C) 2014 ownCloud (http://www.owncloud.org/)
|
||||
* Copyright (C) 2014 ownCloud Inc.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
@ -24,8 +24,8 @@
|
||||
|
||||
package com.owncloud.android.lib.test_project.test;
|
||||
|
||||
import com.owncloud.android.lib.operations.common.RemoteOperationResult;
|
||||
import com.owncloud.android.lib.operations.common.RemoteOperationResult.ResultCode;
|
||||
import com.owncloud.android.lib.common.operations.RemoteOperationResult;
|
||||
import com.owncloud.android.lib.common.operations.RemoteOperationResult.ResultCode;
|
||||
import com.owncloud.android.lib.test_project.TestActivity;
|
||||
|
||||
import android.test.ActivityInstrumentationTestCase2;
|
||||
|
@ -1,5 +1,5 @@
|
||||
/* ownCloud Android Library is available under MIT license
|
||||
* Copyright (C) 2014 ownCloud (http://www.owncloud.org/)
|
||||
* Copyright (C) 2014 ownCloud Inc.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
@ -27,8 +27,8 @@ package com.owncloud.android.lib.test_project.test;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Date;
|
||||
|
||||
import com.owncloud.android.lib.operations.common.RemoteFile;
|
||||
import com.owncloud.android.lib.operations.common.RemoteOperationResult;
|
||||
import com.owncloud.android.lib.resources.files.RemoteFile;
|
||||
import com.owncloud.android.lib.common.operations.RemoteOperationResult;
|
||||
import com.owncloud.android.lib.test_project.TestActivity;
|
||||
|
||||
import android.test.ActivityInstrumentationTestCase2;
|
||||
|
@ -1,5 +1,5 @@
|
||||
/* ownCloud Android Library is available under MIT license
|
||||
* Copyright (C) 2014 ownCloud (http://www.owncloud.org/)
|
||||
* Copyright (C) 2014 ownCloud Inc.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
@ -24,7 +24,7 @@
|
||||
|
||||
package com.owncloud.android.lib.test_project.test;
|
||||
|
||||
import com.owncloud.android.lib.operations.common.RemoteOperationResult;
|
||||
import com.owncloud.android.lib.common.operations.RemoteOperationResult;
|
||||
import com.owncloud.android.lib.test_project.TestActivity;
|
||||
|
||||
import android.test.ActivityInstrumentationTestCase2;
|
||||
|
@ -1,5 +1,5 @@
|
||||
/* ownCloud Android Library is available under MIT license
|
||||
* Copyright (C) 2014 ownCloud (http://www.owncloud.org/)
|
||||
* Copyright (C) 2014 ownCloud Inc.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
@ -23,7 +23,7 @@
|
||||
*/
|
||||
package com.owncloud.android.lib.test_project.test;
|
||||
|
||||
import com.owncloud.android.lib.operations.common.RemoteOperationResult;
|
||||
import com.owncloud.android.lib.common.operations.RemoteOperationResult;
|
||||
import com.owncloud.android.lib.test_project.TestActivity;
|
||||
|
||||
import android.test.ActivityInstrumentationTestCase2;
|
||||
|
@ -1,5 +1,5 @@
|
||||
/* ownCloud Android Library is available under MIT license
|
||||
* Copyright (C) 2014 ownCloud (http://www.owncloud.org/)
|
||||
* Copyright (C) 2014 ownCloud Inc.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
@ -24,7 +24,7 @@
|
||||
|
||||
package com.owncloud.android.lib.test_project.test;
|
||||
|
||||
import com.owncloud.android.lib.operations.common.RemoteOperationResult;
|
||||
import com.owncloud.android.lib.common.operations.RemoteOperationResult;
|
||||
import com.owncloud.android.lib.test_project.TestActivity;
|
||||
|
||||
import android.test.ActivityInstrumentationTestCase2;
|
||||
|
@ -1,5 +1,5 @@
|
||||
/* ownCloud Android Library is available under MIT license
|
||||
* Copyright (C) 2014 ownCloud (http://www.owncloud.org/)
|
||||
* Copyright (C) 2014 ownCloud Inc.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
@ -24,8 +24,8 @@
|
||||
|
||||
package com.owncloud.android.lib.test_project.test;
|
||||
|
||||
import com.owncloud.android.lib.operations.common.OCShare;
|
||||
import com.owncloud.android.lib.operations.common.RemoteOperationResult;
|
||||
import com.owncloud.android.lib.resources.shares.OCShare;
|
||||
import com.owncloud.android.lib.common.operations.RemoteOperationResult;
|
||||
import com.owncloud.android.lib.test_project.TestActivity;
|
||||
|
||||
import android.test.ActivityInstrumentationTestCase2;
|
||||
|
@ -1,5 +1,5 @@
|
||||
/* ownCloud Android Library is available under MIT license
|
||||
* Copyright (C) 2014 ownCloud (http://www.owncloud.org/)
|
||||
* Copyright (C) 2014 ownCloud Inc.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
@ -24,8 +24,8 @@
|
||||
|
||||
package com.owncloud.android.lib.test_project.test;
|
||||
|
||||
import com.owncloud.android.lib.operations.common.RemoteOperationResult;
|
||||
import com.owncloud.android.lib.operations.common.RemoteOperationResult.ResultCode;
|
||||
import com.owncloud.android.lib.common.operations.RemoteOperationResult;
|
||||
import com.owncloud.android.lib.common.operations.RemoteOperationResult.ResultCode;
|
||||
import com.owncloud.android.lib.test_project.TestActivity;
|
||||
|
||||
import android.test.ActivityInstrumentationTestCase2;
|
||||
|
@ -1,5 +1,5 @@
|
||||
/* ownCloud Android Library is available under MIT license
|
||||
* Copyright (C) 2014 ownCloud (http://www.owncloud.org/)
|
||||
* Copyright (C) 2014 ownCloud Inc.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
@ -37,7 +37,7 @@ import android.os.Environment;
|
||||
import android.test.ActivityInstrumentationTestCase2;
|
||||
import android.util.Log;
|
||||
|
||||
import com.owncloud.android.lib.operations.common.RemoteOperationResult;
|
||||
import com.owncloud.android.lib.common.operations.RemoteOperationResult;
|
||||
import com.owncloud.android.lib.test_project.TestActivity;
|
||||
|
||||
/**
|
||||
|
Loading…
x
Reference in New Issue
Block a user