1
0
mirror of https://github.com/owncloud/android-library.git synced 2025-06-07 16:06:08 +00:00

Merge pull request #13 from owncloud/wide_scope_clean_up

Wide scope clean up
This commit is contained in:
masensio 2014-02-18 14:53:54 +01:00
commit aaa8dc018a
82 changed files with 422 additions and 500 deletions

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<!-- ownCloud Android Library is available under MIT license <!-- 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 Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal

24
LICENSE.md Normal file
View 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.

View File

@ -1,4 +1,4 @@
# ownCloud Android Library v1.0 # ownCloud Android Library
### Introduction ### Introduction
Using ownCloud Android library it will be the easiest way to communicate with ownCloud servers. 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 #### 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 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 ### License
ownCloud Android Library is available under MIT license ownCloud Android Library is available under MIT license. See the file LICENSE.md with the full license text.
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.
#### Third part libraries #### 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. 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 ### 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. ownCloud Android library supports ownCloud server from version 4.5.

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<!-- ownCloud Android Library is available under MIT license <!-- 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 Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<!-- ownCloud Android Library is available under MIT license <!-- 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 Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<!-- ownCloud Android Library is available under MIT license <!-- 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 Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<!-- ownCloud Android Library is available under MIT license <!-- 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 Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<!-- ownCloud Android Library is available under MIT license <!-- 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 Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<!-- ownCloud Android Library is available under MIT license <!-- 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 Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<!-- ownCloud Android Library is available under MIT license <!-- 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 Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<!-- ownCloud Android Library is available under MIT license <!-- 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 Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<!-- ownCloud Android Library is available under MIT license <!-- 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 Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal

View File

@ -1,5 +1,5 @@
/* ownCloud Android Library is available under MIT license /* 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 * Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal * 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.ArrayAdapter;
import android.widget.TextView; 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> { public class FilesArrayAdapter extends ArrayAdapter<RemoteFile> {

View File

@ -1,5 +1,5 @@
/* ownCloud Android Library is available under MIT license /* 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 * Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal * 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.Iterator;
import java.util.List; import java.util.List;
import com.owncloud.android.lib.accounts.AccountUtils; import com.owncloud.android.lib.common.accounts.AccountUtils;
import com.owncloud.android.lib.network.OnDatatransferProgressListener; import com.owncloud.android.lib.common.network.OnDatatransferProgressListener;
import com.owncloud.android.lib.network.OwnCloudClientFactory; import com.owncloud.android.lib.common.OwnCloudClientFactory;
import com.owncloud.android.lib.network.OwnCloudClient; import com.owncloud.android.lib.common.OwnCloudClient;
import com.owncloud.android.lib.operations.common.OnRemoteOperationListener; import com.owncloud.android.lib.common.operations.OnRemoteOperationListener;
import com.owncloud.android.lib.operations.common.RemoteFile; import com.owncloud.android.lib.resources.files.RemoteFile;
import com.owncloud.android.lib.operations.common.RemoteOperation; import com.owncloud.android.lib.common.operations.RemoteOperation;
import com.owncloud.android.lib.operations.common.RemoteOperationResult; import com.owncloud.android.lib.common.operations.RemoteOperationResult;
import com.owncloud.android.lib.operations.remote.DownloadRemoteFileOperation; import com.owncloud.android.lib.resources.files.DownloadRemoteFileOperation;
import com.owncloud.android.lib.operations.remote.ReadRemoteFolderOperation; import com.owncloud.android.lib.resources.files.ReadRemoteFolderOperation;
import com.owncloud.android.lib.operations.remote.RemoveRemoteFileOperation; import com.owncloud.android.lib.resources.files.RemoveRemoteFileOperation;
import com.owncloud.android.lib.operations.remote.UploadRemoteFileOperation; import com.owncloud.android.lib.resources.files.UploadRemoteFileOperation;
import com.owncloud.android.lib.utils.FileUtils; import com.owncloud.android.lib.resources.files.FileUtils;
import android.app.Activity; import android.app.Activity;
import android.content.res.AssetManager; import android.content.res.AssetManager;

View File

@ -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];
}
};
}

View File

@ -1,5 +1,5 @@
/* ownCloud Android Library is available under MIT license /* 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 * Copyright (C) 2012 Bartek Przybylski
* *
* Permission is hereby granted, free of charge, to any person obtaining a copy * 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.IOException;
import java.io.InputStream; import java.io.InputStream;
@ -48,7 +48,10 @@ import org.apache.commons.httpclient.params.HttpMethodParams;
import org.apache.http.HttpStatus; import org.apache.http.HttpStatus;
import org.apache.http.params.CoreProtocolPNames; 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.net.Uri;
import android.util.Log; import android.util.Log;

View File

@ -1,5 +1,5 @@
/* ownCloud Android Library is available under MIT license /* 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 * Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal * 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.io.IOException;
import java.security.GeneralSecurityException; import java.security.GeneralSecurityException;
import com.owncloud.android.lib.accounts.AccountTypeUtils; import com.owncloud.android.lib.common.accounts.AccountTypeUtils;
import com.owncloud.android.lib.accounts.AccountUtils; import com.owncloud.android.lib.common.accounts.AccountUtils;
import com.owncloud.android.lib.accounts.OwnCloudAccount; import com.owncloud.android.lib.common.accounts.AccountUtils.AccountNotFoundException;
import com.owncloud.android.lib.accounts.AccountUtils.AccountNotFoundException; import com.owncloud.android.lib.common.network.NetworkUtils;
import android.accounts.Account; import android.accounts.Account;
import android.accounts.AccountManager; import android.accounts.AccountManager;
@ -73,8 +73,8 @@ public class OwnCloudClientFactory {
Uri webdavUri = Uri.parse(AccountUtils.constructFullURLForAccount(appContext, account)); Uri webdavUri = Uri.parse(AccountUtils.constructFullURLForAccount(appContext, account));
Uri uri = Uri.parse(AccountUtils.constructBasicURLForAccount(appContext, account)); Uri uri = Uri.parse(AccountUtils.constructBasicURLForAccount(appContext, account));
AccountManager am = AccountManager.get(appContext); AccountManager am = AccountManager.get(appContext);
boolean isOauth2 = am.getUserData(account, OwnCloudAccount.Constants.KEY_SUPPORTS_OAUTH2) != null; // TODO avoid calling to getUserData here boolean isOauth2 = am.getUserData(account, AccountUtils.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 isSamlSso = am.getUserData(account, AccountUtils.Constants.KEY_SUPPORTS_SAML_WEB_SSO) != null;
OwnCloudClient client = createOwnCloudClient(webdavUri, appContext, !isSamlSso); OwnCloudClient client = createOwnCloudClient(webdavUri, appContext, !isSamlSso);
client.setBaseUri(uri); client.setBaseUri(uri);
@ -101,8 +101,8 @@ public class OwnCloudClientFactory {
Uri webdavUri = Uri.parse(AccountUtils.constructFullURLForAccount(appContext, account)); Uri webdavUri = Uri.parse(AccountUtils.constructFullURLForAccount(appContext, account));
Uri uri = Uri.parse(AccountUtils.constructBasicURLForAccount(appContext, account)); Uri uri = Uri.parse(AccountUtils.constructBasicURLForAccount(appContext, account));
AccountManager am = AccountManager.get(appContext); AccountManager am = AccountManager.get(appContext);
boolean isOauth2 = am.getUserData(account, OwnCloudAccount.Constants.KEY_SUPPORTS_OAUTH2) != null; // TODO avoid calling to getUserData here boolean isOauth2 = am.getUserData(account, AccountUtils.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 isSamlSso = am.getUserData(account, AccountUtils.Constants.KEY_SUPPORTS_SAML_WEB_SSO) != null;
OwnCloudClient client = createOwnCloudClient(webdavUri, appContext, !isSamlSso); OwnCloudClient client = createOwnCloudClient(webdavUri, appContext, !isSamlSso);
client.setBaseUri(uri); client.setBaseUri(uri);

View File

@ -1,6 +1,5 @@
/* ownCloud Android Library is available under MIT license /* 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 * Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal * 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 * @author masensio

View File

@ -1,5 +1,5 @@
/* ownCloud Android Library is available under MIT license /* 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 * Copyright (C) 2012 Bartek Przybylski
* *
* Permission is hereby granted, free of charge, to any person obtaining a copy * 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.Account;
import android.accounts.AccountManager; import android.accounts.AccountManager;
@ -79,10 +79,10 @@ public class AccountUtils {
*/ */
public static String constructFullURLForAccount(Context context, Account account) throws AccountNotFoundException { public static String constructFullURLForAccount(Context context, Account account) throws AccountNotFoundException {
AccountManager ama = AccountManager.get(context); 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);
String strver = ama.getUserData(account, OwnCloudAccount.Constants.KEY_OC_VERSION); String strver = ama.getUserData(account, Constants.KEY_OC_VERSION);
boolean supportsOAuth = (ama.getUserData(account, OwnCloudAccount.Constants.KEY_SUPPORTS_OAUTH2) != null); boolean supportsOAuth = (ama.getUserData(account, Constants.KEY_SUPPORTS_OAUTH2) != null);
boolean supportsSamlSso = (ama.getUserData(account, OwnCloudAccount.Constants.KEY_SUPPORTS_SAML_WEB_SSO) != null); boolean supportsSamlSso = (ama.getUserData(account, Constants.KEY_SUPPORTS_SAML_WEB_SSO) != null);
OwnCloudVersion ver = new OwnCloudVersion(strver); OwnCloudVersion ver = new OwnCloudVersion(strver);
String webdavpath = getWebdavPath(ver, supportsOAuth, supportsSamlSso); String webdavpath = getWebdavPath(ver, supportsOAuth, supportsSamlSso);
@ -101,7 +101,7 @@ public class AccountUtils {
*/ */
public static String constructBasicURLForAccount(Context context, Account account) throws AccountNotFoundException { public static String constructBasicURLForAccount(Context context, Account account) throws AccountNotFoundException {
AccountManager ama = AccountManager.get(context); 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 ) if (baseurl == null )
throw new AccountNotFoundException(account, "Account not found", null); throw new AccountNotFoundException(account, "Account not found", null);
@ -126,4 +126,39 @@ public class AccountUtils {
return mFailedAccount; 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";
}
} }

View File

@ -1,6 +1,5 @@
/* ownCloud Android Library is available under MIT license /* 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 * Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal * 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.io.IOException;
import java.net.InetAddress; import java.net.InetAddress;

View File

@ -1,5 +1,5 @@
/* ownCloud Android Library is available under MIT license /* 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 * Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal * 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.KeyStore;
import java.security.KeyStoreException; import java.security.KeyStoreException;

View File

@ -1,5 +1,5 @@
/* ownCloud Android Library is available under MIT license /* 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 * Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal * 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; import java.util.Map;

View File

@ -1,5 +1,5 @@
/* ownCloud Android Library is available under MIT license /* 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 * Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal * 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.Credentials;
import org.apache.commons.httpclient.util.LangUtils; import org.apache.commons.httpclient.util.LangUtils;

View File

@ -1,5 +1,5 @@
/* ownCloud Android Library is available under MIT license /* 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 * Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal * 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.CertPathValidatorException;
import java.security.cert.CertificateException; import java.security.cert.CertificateException;

View File

@ -1,5 +1,5 @@
/* ownCloud Android Library is available under MIT license /* 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 * Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal * 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.File;
import java.io.IOException; import java.io.IOException;

View File

@ -1,5 +1,5 @@
/* ownCloud Android Library is available under MIT license /* 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 * Copyright (C) 2012 Bartek Przybylski
* *
* Permission is hereby granted, free of charge, to any person obtaining a copy * 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.File;
import java.io.IOException; import java.io.IOException;

View File

@ -1,5 +1,5 @@
/* ownCloud Android Library is available under MIT license /* 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 * Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal * 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.File;
import java.io.FileInputStream; import java.io.FileInputStream;

View File

@ -1,5 +1,5 @@
/* ownCloud Android Library is available under MIT license /* 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 * Copyright (C) 2012 Bartek Przybylski
* *
* Permission is hereby granted, free of charge, to any person obtaining a copy * 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 interface OnDatatransferProgressListener {
public void onTransferProgress(long progressRate, long totalTransferredSoFar, long totalToTransfer, String fileAbsoluteName); public void onTransferProgress(long progressRate, long totalTransferredSoFar, long totalToTransfer, String fileAbsoluteName);

View File

@ -1,5 +1,5 @@
/* ownCloud Android Library is available under MIT license /* 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 * Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal * 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; import java.util.Collection;

View File

@ -1,5 +1,5 @@
/* ownCloud Android Library is available under MIT license /* 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 * Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal * 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.ref.WeakReference;
import java.lang.reflect.InvocationTargetException; import java.lang.reflect.InvocationTargetException;

View File

@ -1,5 +1,5 @@
/* ownCloud Android Library is available under MIT license /* 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 * Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal * 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; import java.util.Date;
@ -33,6 +33,7 @@ import org.apache.jackrabbit.webdav.property.DavPropertySet;
import android.net.Uri; import android.net.Uri;
import android.util.Log; import android.util.Log;

View File

@ -1,5 +1,5 @@
/* ownCloud Android Library is available under MIT license /* 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 * Copyright (C) 2012 Bartek Przybylski
* *
* Permission is hereby granted, free of charge, to any person obtaining a copy * 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.ParseException;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;

View File

@ -1,6 +1,5 @@
/* ownCloud Android Library is available under MIT license /* 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 * Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal * 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 { public interface OnRemoteOperationListener {

View File

@ -1,6 +1,5 @@
/* ownCloud Android Library is available under MIT license /* 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 * Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal * 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 { public class OperationCancelledException extends Exception {

View File

@ -1,5 +1,5 @@
/* ownCloud Android Library is available under MIT license /* 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 * Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal * 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 java.io.IOException;
import org.apache.commons.httpclient.Credentials; import org.apache.commons.httpclient.Credentials;
import com.owncloud.android.lib.network.BearerCredentials; import com.owncloud.android.lib.common.OwnCloudClient;
import com.owncloud.android.lib.network.OwnCloudClient; import com.owncloud.android.lib.common.OwnCloudClientFactory;
import com.owncloud.android.lib.network.OwnCloudClientFactory; import com.owncloud.android.lib.common.network.BearerCredentials;
import com.owncloud.android.lib.operations.common.RemoteOperationResult.ResultCode; import com.owncloud.android.lib.common.operations.RemoteOperationResult.ResultCode;

View File

@ -1,6 +1,5 @@
/* ownCloud Android Library is available under MIT license /* 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 * Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal * 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.IOException;
import java.io.Serializable; import java.io.Serializable;
@ -42,8 +41,8 @@ import org.apache.commons.httpclient.HttpStatus;
import org.apache.jackrabbit.webdav.DavException; import org.apache.jackrabbit.webdav.DavException;
import org.json.JSONException; import org.json.JSONException;
import com.owncloud.android.lib.accounts.AccountUtils.AccountNotFoundException; import com.owncloud.android.lib.common.accounts.AccountUtils.AccountNotFoundException;
import com.owncloud.android.lib.network.CertificateCombinedException; import com.owncloud.android.lib.common.network.CertificateCombinedException;
import android.accounts.Account; import android.accounts.Account;
import android.accounts.AccountsException; import android.accounts.AccountsException;

View File

@ -1,6 +1,5 @@
/* ownCloud Android Library is available under MIT license /* 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 * Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal * 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.File;
import java.io.IOException; import java.io.IOException;
@ -34,10 +33,10 @@ import java.util.Random;
import org.apache.commons.httpclient.HttpException; import org.apache.commons.httpclient.HttpException;
import org.apache.commons.httpclient.methods.PutMethod; import org.apache.commons.httpclient.methods.PutMethod;
import com.owncloud.android.lib.network.ChunkFromFileChannelRequestEntity; import com.owncloud.android.lib.common.OwnCloudClient;
import com.owncloud.android.lib.network.OwnCloudClient; import com.owncloud.android.lib.common.network.ChunkFromFileChannelRequestEntity;
import com.owncloud.android.lib.network.ProgressiveDataTransferer; import com.owncloud.android.lib.common.network.ProgressiveDataTransferer;
import com.owncloud.android.lib.network.webdav.WebdavUtils; import com.owncloud.android.lib.common.network.WebdavUtils;
import android.util.Log; import android.util.Log;
@ -60,7 +59,7 @@ public class ChunkedUploadRemoteFileOperation extends UploadRemoteFileOperation
FileChannel channel = null; FileChannel channel = null;
RandomAccessFile raf = null; RandomAccessFile raf = null;
try { try {
File file = new File(mStoragePath); File file = new File(mLocalPath);
raf = new RandomAccessFile(file, "r"); raf = new RandomAccessFile(file, "r");
channel = raf.getChannel(); channel = raf.getChannel();
mEntity = new ChunkFromFileChannelRequestEntity(channel, mMimeType, CHUNK_SIZE, file); mEntity = new ChunkFromFileChannelRequestEntity(channel, mMimeType, CHUNK_SIZE, file);
@ -82,7 +81,7 @@ public class ChunkedUploadRemoteFileOperation extends UploadRemoteFileOperation
mPutMethod.setRequestEntity(mEntity); mPutMethod.setRequestEntity(mEntity);
status = client.executeMethod(mPutMethod); status = client.executeMethod(mPutMethod);
client.exhaustResponse(mPutMethod.getResponseBodyAsStream()); 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)) if (!isSuccess(status))
break; break;
} }

View File

@ -1,5 +1,5 @@
/* ownCloud Android Library is available under MIT license /* 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 * Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal * 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.commons.httpclient.HttpStatus;
import org.apache.jackrabbit.webdav.client.methods.MkColMethod; import org.apache.jackrabbit.webdav.client.methods.MkColMethod;
import android.util.Log; import android.util.Log;
import com.owncloud.android.lib.network.OwnCloudClient; import com.owncloud.android.lib.common.OwnCloudClient;
import com.owncloud.android.lib.network.webdav.WebdavUtils; import com.owncloud.android.lib.common.network.WebdavUtils;
import com.owncloud.android.lib.operations.common.RemoteOperation; import com.owncloud.android.lib.common.operations.RemoteOperation;
import com.owncloud.android.lib.operations.common.RemoteOperationResult; import com.owncloud.android.lib.common.operations.RemoteOperationResult;
import com.owncloud.android.lib.operations.common.RemoteOperationResult.ResultCode; import com.owncloud.android.lib.common.operations.RemoteOperationResult.ResultCode;
import com.owncloud.android.lib.utils.FileUtils;

View File

@ -1,5 +1,5 @@
/* ownCloud Android Library is available under MIT license /* 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 * Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal * 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.BufferedInputStream;
import java.io.File; import java.io.File;
@ -41,12 +41,12 @@ import org.apache.http.HttpStatus;
import android.util.Log; import android.util.Log;
import com.owncloud.android.lib.network.OnDatatransferProgressListener; import com.owncloud.android.lib.common.OwnCloudClient;
import com.owncloud.android.lib.network.OwnCloudClient; import com.owncloud.android.lib.common.network.OnDatatransferProgressListener;
import com.owncloud.android.lib.network.webdav.WebdavUtils; import com.owncloud.android.lib.common.network.WebdavUtils;
import com.owncloud.android.lib.operations.common.OperationCancelledException; import com.owncloud.android.lib.common.operations.OperationCancelledException;
import com.owncloud.android.lib.operations.common.RemoteOperation; import com.owncloud.android.lib.common.operations.RemoteOperation;
import com.owncloud.android.lib.operations.common.RemoteOperationResult; import com.owncloud.android.lib.common.operations.RemoteOperationResult;
/** /**
* Remote operation performing the download of a remote file in the ownCloud server. * 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 GetMethod mGet;
private String mRemotePath; private String mRemotePath;
private String mDownloadFolderPath; private String mLocalFolderPath;
public DownloadRemoteFileOperation(String remotePath, String downloadFolderPath) { public DownloadRemoteFileOperation(String remotePath, String localFolderPath) {
mRemotePath = remotePath; mRemotePath = remotePath;
mDownloadFolderPath = downloadFolderPath; mLocalFolderPath = localFolderPath;
} }
@Override @Override
@ -157,7 +157,7 @@ public class DownloadRemoteFileOperation extends RemoteOperation {
} }
private String getTmpPath() { private String getTmpPath() {
return mDownloadFolderPath + mRemotePath; return mLocalFolderPath + mRemotePath;
} }
public void addDatatransferProgressListener (OnDatatransferProgressListener listener) { public void addDatatransferProgressListener (OnDatatransferProgressListener listener) {

View File

@ -1,5 +1,5 @@
/* ownCloud Android Library is available under MIT license /* 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 * Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal * 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.HttpStatus;
import org.apache.commons.httpclient.methods.HeadMethod; import org.apache.commons.httpclient.methods.HeadMethod;
import com.owncloud.android.lib.network.OwnCloudClient; import com.owncloud.android.lib.common.OwnCloudClient;
import com.owncloud.android.lib.network.webdav.WebdavUtils; import com.owncloud.android.lib.common.network.WebdavUtils;
import com.owncloud.android.lib.operations.common.RemoteOperation; import com.owncloud.android.lib.common.operations.RemoteOperation;
import com.owncloud.android.lib.operations.common.RemoteOperationResult; import com.owncloud.android.lib.common.operations.RemoteOperationResult;
import android.content.Context; import android.content.Context;
import android.net.ConnectivityManager; 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. * 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 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). * @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) { public ExistenceCheckRemoteOperation(String remotePath, Context context, boolean successIfAbsent) {
mPath = (path != null) ? path : ""; mPath = (remotePath != null) ? remotePath : "";
mContext = context; mContext = context;
mSuccessIfAbsent = successIfAbsent; mSuccessIfAbsent = successIfAbsent;
} }

View File

@ -1,5 +1,5 @@
/* ownCloud Android Library is available under MIT license /* 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 * Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal * 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; import java.io.File;

View File

@ -1,5 +1,5 @@
/* ownCloud Android Library is available under MIT license /* 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 * Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal * of this software and associated documentation files (the "Software"), to deal
@ -21,7 +21,7 @@
* THE SOFTWARE. * THE SOFTWARE.
* *
*/ */
package com.owncloud.android.lib.operations.remote; package com.owncloud.android.lib.resources.files;
import java.util.ArrayList; import java.util.ArrayList;
@ -32,12 +32,11 @@ import org.apache.jackrabbit.webdav.client.methods.PropFindMethod;
import android.util.Log; import android.util.Log;
import com.owncloud.android.lib.network.OwnCloudClient; import com.owncloud.android.lib.common.OwnCloudClient;
import com.owncloud.android.lib.network.webdav.WebdavEntry; import com.owncloud.android.lib.common.network.WebdavEntry;
import com.owncloud.android.lib.network.webdav.WebdavUtils; import com.owncloud.android.lib.common.network.WebdavUtils;
import com.owncloud.android.lib.operations.common.RemoteFile; import com.owncloud.android.lib.common.operations.RemoteOperation;
import com.owncloud.android.lib.operations.common.RemoteOperation; import com.owncloud.android.lib.common.operations.RemoteOperationResult;
import com.owncloud.android.lib.operations.common.RemoteOperationResult;
/** /**

View File

@ -1,5 +1,5 @@
/* ownCloud Android Library is available under MIT license /* 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 * Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal * 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; import java.util.ArrayList;
@ -33,12 +33,11 @@ import org.apache.jackrabbit.webdav.client.methods.PropFindMethod;
import android.util.Log; import android.util.Log;
import com.owncloud.android.lib.network.OwnCloudClient; import com.owncloud.android.lib.common.OwnCloudClient;
import com.owncloud.android.lib.network.webdav.WebdavEntry; import com.owncloud.android.lib.common.network.WebdavEntry;
import com.owncloud.android.lib.network.webdav.WebdavUtils; import com.owncloud.android.lib.common.network.WebdavUtils;
import com.owncloud.android.lib.operations.common.RemoteFile; import com.owncloud.android.lib.common.operations.RemoteOperation;
import com.owncloud.android.lib.operations.common.RemoteOperation; import com.owncloud.android.lib.common.operations.RemoteOperationResult;
import com.owncloud.android.lib.operations.common.RemoteOperationResult;
/** /**
* Remote operation performing the read of remote file or folder in the ownCloud server. * 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 * 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. * folder and its direct children.
* @param client Client instance to the remote server where the data were * @param client Client instance to the remote server where the data were
* retrieved. * retrieved.
* @return * @return
*/ */
private void readData(MultiStatus dataInServer, OwnCloudClient client) { private void readData(MultiStatus remoteData, OwnCloudClient client) {
mFolderAndFiles = new ArrayList<Object>(); mFolderAndFiles = new ArrayList<Object>();
// parse data from remote folder // 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)); mFolderAndFiles.add(fillOCFile(we));
// loop to update every child // loop to update every child
RemoteFile remoteFile = null; 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 /// 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); remoteFile = fillOCFile(we);
mFolderAndFiles.add(remoteFile); mFolderAndFiles.add(remoteFile);
} }

View File

@ -1,5 +1,5 @@
/* ownCloud Android Library is available under MIT license /* 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 * Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal * 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 java.io.Serializable;
import android.os.Parcel; import android.os.Parcel;
import android.os.Parcelable; import android.os.Parcelable;
import com.owncloud.android.lib.network.webdav.WebdavEntry; import com.owncloud.android.lib.common.network.WebdavEntry;
import com.owncloud.android.lib.utils.FileUtils;
/** /**
* Contains the data of a Remote File from a WebDavEntry * Contains the data of a Remote File from a WebDavEntry

View File

@ -1,5 +1,5 @@
/* ownCloud Android Library is available under MIT license /* 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 * Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal * 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.commons.httpclient.HttpStatus;
import org.apache.jackrabbit.webdav.client.methods.DeleteMethod; import org.apache.jackrabbit.webdav.client.methods.DeleteMethod;
import android.util.Log; import android.util.Log;
import com.owncloud.android.lib.network.OwnCloudClient; import com.owncloud.android.lib.common.OwnCloudClient;
import com.owncloud.android.lib.network.webdav.WebdavUtils; import com.owncloud.android.lib.common.network.WebdavUtils;
import com.owncloud.android.lib.operations.common.RemoteOperation; import com.owncloud.android.lib.common.operations.RemoteOperation;
import com.owncloud.android.lib.operations.common.RemoteOperationResult; import com.owncloud.android.lib.common.operations.RemoteOperationResult;
/** /**
* Remote operation performing the removal of a remote file or folder in the ownCloud server. * Remote operation performing the removal of a remote file or folder in the ownCloud server.

View File

@ -1,5 +1,5 @@
/* ownCloud Android Library is available under MIT license /* 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 * Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal * 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.File;
@ -30,12 +30,11 @@ import org.apache.jackrabbit.webdav.client.methods.DavMethodBase;
import android.util.Log; import android.util.Log;
import com.owncloud.android.lib.network.OwnCloudClient; import com.owncloud.android.lib.common.OwnCloudClient;
import com.owncloud.android.lib.network.webdav.WebdavUtils; import com.owncloud.android.lib.common.network.WebdavUtils;
import com.owncloud.android.lib.operations.common.RemoteOperation; import com.owncloud.android.lib.common.operations.RemoteOperation;
import com.owncloud.android.lib.operations.common.RemoteOperationResult; import com.owncloud.android.lib.common.operations.RemoteOperationResult;
import com.owncloud.android.lib.operations.common.RemoteOperationResult.ResultCode; import com.owncloud.android.lib.common.operations.RemoteOperationResult.ResultCode;
import com.owncloud.android.lib.utils.FileUtils;
/** /**

View File

@ -1,5 +1,5 @@
/* ownCloud Android Library is available under MIT license /* 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 * Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal * 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.File;
import java.io.IOException; 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.commons.httpclient.methods.RequestEntity;
import org.apache.http.HttpStatus; import org.apache.http.HttpStatus;
import com.owncloud.android.lib.network.FileRequestEntity; import com.owncloud.android.lib.common.OwnCloudClient;
import com.owncloud.android.lib.network.OnDatatransferProgressListener; import com.owncloud.android.lib.common.network.FileRequestEntity;
import com.owncloud.android.lib.network.OwnCloudClient; import com.owncloud.android.lib.common.network.OnDatatransferProgressListener;
import com.owncloud.android.lib.network.ProgressiveDataTransferer; import com.owncloud.android.lib.common.network.ProgressiveDataTransferer;
import com.owncloud.android.lib.network.webdav.WebdavUtils; import com.owncloud.android.lib.common.network.WebdavUtils;
import com.owncloud.android.lib.operations.common.OperationCancelledException; import com.owncloud.android.lib.common.operations.OperationCancelledException;
import com.owncloud.android.lib.operations.common.RemoteOperation; import com.owncloud.android.lib.common.operations.RemoteOperation;
import com.owncloud.android.lib.operations.common.RemoteOperationResult; import com.owncloud.android.lib.common.operations.RemoteOperationResult;
/** /**
* Remote operation performing the upload of a remote file to the ownCloud server. * 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 { public class UploadRemoteFileOperation extends RemoteOperation {
protected String mStoragePath; protected String mLocalPath;
protected String mRemotePath; protected String mRemotePath;
protected String mMimeType; protected String mMimeType;
protected PutMethod mPutMethod = null; protected PutMethod mPutMethod = null;
@ -64,8 +64,8 @@ public class UploadRemoteFileOperation extends RemoteOperation {
protected RequestEntity mEntity = null; protected RequestEntity mEntity = null;
public UploadRemoteFileOperation(String storagePath, String remotePath, String mimeType) { public UploadRemoteFileOperation(String localPath, String remotePath, String mimeType) {
mStoragePath = storagePath; mLocalPath = localPath;
mRemotePath = remotePath; mRemotePath = remotePath;
mMimeType = mimeType; mMimeType = mimeType;
} }
@ -106,7 +106,7 @@ public class UploadRemoteFileOperation extends RemoteOperation {
protected int uploadFile(OwnCloudClient client) throws HttpException, IOException, OperationCancelledException { protected int uploadFile(OwnCloudClient client) throws HttpException, IOException, OperationCancelledException {
int status = -1; int status = -1;
try { try {
File f = new File(mStoragePath); File f = new File(mLocalPath);
mEntity = new FileRequestEntity(f, mMimeType); mEntity = new FileRequestEntity(f, mMimeType);
synchronized (mDataTransferListeners) { synchronized (mDataTransferListeners) {
((ProgressiveDataTransferer)mEntity).addDatatransferProgressListeners(mDataTransferListeners); ((ProgressiveDataTransferer)mEntity).addDatatransferProgressListeners(mDataTransferListeners);

View File

@ -1,5 +1,5 @@
/* ownCloud Android Library is available under MIT license /* 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 * Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal * 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.ByteArrayInputStream;
import java.io.InputStream; import java.io.InputStream;
@ -33,14 +33,10 @@ import org.apache.http.HttpStatus;
import android.util.Log; import android.util.Log;
import com.owncloud.android.lib.network.OwnCloudClient; import com.owncloud.android.lib.common.OwnCloudClient;
import com.owncloud.android.lib.operations.common.OCShare; import com.owncloud.android.lib.common.operations.RemoteOperation;
import com.owncloud.android.lib.operations.common.RemoteOperation; import com.owncloud.android.lib.common.operations.RemoteOperationResult;
import com.owncloud.android.lib.operations.common.RemoteOperationResult; import com.owncloud.android.lib.common.operations.RemoteOperationResult.ResultCode;
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;
/** /**
* Creates a new share. This allows sharing with a user or group or as a link. * 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 * @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_PATH = "path";
private static final String PARAM_SHARE_TYPE = "shareType"; 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 ArrayList<OCShare> mShares; // List of shares for result, one share in this case
private String mPath; private String mRemoteFilePath;
private ShareType mShareType; private ShareType mShareType;
private String mShareWith; private String mShareWith;
private boolean mPublicUpload; private boolean mPublicUpload;
@ -70,26 +66,26 @@ public class CreateShareRemoteOperation extends RemoteOperation {
/** /**
* Constructor * Constructor
* @param path Full path of the file/folder being shared. Mandatory argument * @param remoteFilePath Full path of the file/folder being shared. Mandatory argument
* @param shareType 0 = user, 1 = group, 3 = Public link. 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 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. * @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 * 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 password Password to protect a public link share. Only available for public link shares
* @param permissions 1 - Read only Default for public shares * @param permissions 1 - Read only Default for public shares
* 2 - Update * 2 - Update
* 4 - Create * 4 - Create
* 8 - Delete * 8 - Delete
* 16- Re-share * 16- Re-share
* 31- All above Default for private shares * 31- All above Default for private shares
* For user or group shares. * For user or group shares.
* To obtain combinations, add the desired values together. * To obtain combinations, add the desired values together.
* For instance, for Re-Share, delete, read, update, add 16+8+2+1 = 27. * 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) { String password, int permissions) {
mPath = path; mRemoteFilePath = remoteFilePath;
mShareType = shareType; mShareType = shareType;
mShareWith = shareWith; mShareWith = shareWith;
mPublicUpload = publicUpload; mPublicUpload = publicUpload;
@ -106,11 +102,11 @@ public class CreateShareRemoteOperation extends RemoteOperation {
try { try {
// Post Method // Post Method
post = new PostMethod(client.getBaseUri() + ShareUtils.SHAREAPI_ROUTE); post = new PostMethod(client.getBaseUri() + ShareUtils.SHARING_API_PATH);
Log.d(TAG, "URL ------> " + client.getBaseUri() + ShareUtils.SHAREAPI_ROUTE); 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.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_TYPE, Integer.toString(mShareType.getValue()));
post.addParameter(PARAM_SHARE_WITH, mShareWith); post.addParameter(PARAM_SHARE_WITH, mShareWith);
post.addParameter(PARAM_PUBLIC_UPLOAD, Boolean.toString(mPublicUpload)); post.addParameter(PARAM_PUBLIC_UPLOAD, Boolean.toString(mPublicUpload));

View File

@ -1,5 +1,5 @@
/* ownCloud Android Library is available under MIT license /* 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 * Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal * 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.ByteArrayInputStream;
import java.io.InputStream; import java.io.InputStream;
@ -34,13 +34,10 @@ import org.apache.http.HttpStatus;
import android.util.Log; import android.util.Log;
import com.owncloud.android.lib.network.OwnCloudClient; import com.owncloud.android.lib.common.OwnCloudClient;
import com.owncloud.android.lib.operations.common.OCShare; import com.owncloud.android.lib.common.operations.RemoteOperation;
import com.owncloud.android.lib.operations.common.RemoteOperation; import com.owncloud.android.lib.common.operations.RemoteOperationResult;
import com.owncloud.android.lib.operations.common.RemoteOperationResult; import com.owncloud.android.lib.common.operations.RemoteOperationResult.ResultCode;
import com.owncloud.android.lib.operations.common.RemoteOperationResult.ResultCode;
import com.owncloud.android.lib.utils.ShareUtils;
import com.owncloud.android.lib.utils.ShareXMLParser;
/** /**
* Provide a list shares for a specific file. * 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_PATH = "path";
private static final String PARAM_RESHARES = "reshares"; 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 ArrayList<OCShare> mShares; // List of shares for result, one share in this case
private String mPath; private String mRemoteFilePath;
private boolean mReshares; private boolean mReshares;
private boolean mSubfiles; private boolean mSubfiles;
/** /**
* Constructor * Constructor
* *
* @param path Path to file or folder * @param remoteFilePath Path to file or folder
* @param reshares If set to false (default), only shares from the current user are returned * @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 * 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 * @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. * If set to true, all shared files within the folder are returned.
*/ */
public GetSharesForFileRemoteOperation(String path, boolean reshares, boolean subfiles) { public GetRemoteSharesForFileOperation(String remoteFilePath, boolean reshares, boolean subfiles) {
mPath = path; mRemoteFilePath = remoteFilePath;
mReshares = reshares; mReshares = reshares;
mSubfiles = subfiles; mSubfiles = subfiles;
} }
@ -89,12 +86,12 @@ public class GetSharesForFileRemoteOperation extends RemoteOperation {
try { try {
// Get Method // Get Method
get = new GetMethod(client.getBaseUri() + ShareUtils.SHAREAPI_ROUTE); get = new GetMethod(client.getBaseUri() + ShareUtils.SHARING_API_PATH);
Log.d(TAG, "URL ------> " + client.getBaseUri() + ShareUtils.SHAREAPI_ROUTE); Log.d(TAG, "URL ------> " + client.getBaseUri() + ShareUtils.SHARING_API_PATH);
// Add Parameters to Get Method // Add Parameters to Get Method
get.setQueryString(new NameValuePair[] { get.setQueryString(new NameValuePair[] {
new NameValuePair(PARAM_PATH, mPath), new NameValuePair(PARAM_PATH, mRemoteFilePath),
new NameValuePair(PARAM_RESHARES, String.valueOf(mReshares)), new NameValuePair(PARAM_RESHARES, String.valueOf(mReshares)),
new NameValuePair(PARAM_SUBFILES, String.valueOf(mSubfiles)) new NameValuePair(PARAM_SUBFILES, String.valueOf(mSubfiles))
}); });

View File

@ -1,5 +1,5 @@
/* ownCloud Android Library is available under MIT license /* 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 * Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal * 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.ByteArrayInputStream;
import java.io.InputStream; import java.io.InputStream;
@ -31,13 +31,10 @@ import java.util.ArrayList;
import org.apache.commons.httpclient.methods.GetMethod; import org.apache.commons.httpclient.methods.GetMethod;
import org.apache.http.HttpStatus; import org.apache.http.HttpStatus;
import com.owncloud.android.lib.network.OwnCloudClient; import com.owncloud.android.lib.common.OwnCloudClient;
import com.owncloud.android.lib.operations.common.RemoteOperation; import com.owncloud.android.lib.common.operations.RemoteOperation;
import com.owncloud.android.lib.operations.common.RemoteOperationResult; import com.owncloud.android.lib.common.operations.RemoteOperationResult;
import com.owncloud.android.lib.operations.common.RemoteOperationResult.ResultCode; import com.owncloud.android.lib.common.operations.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 android.util.Log; import android.util.Log;
@ -69,8 +66,8 @@ public class GetRemoteSharesOperation extends RemoteOperation {
// Get the response // Get the response
try{ try{
get = new GetMethod(client.getBaseUri() + ShareUtils.SHAREAPI_ROUTE); get = new GetMethod(client.getBaseUri() + ShareUtils.SHARING_API_PATH);
Log.d(TAG, "URL ------> " + client.getBaseUri() + ShareUtils.SHAREAPI_ROUTE); Log.d(TAG, "URL ------> " + client.getBaseUri() + ShareUtils.SHARING_API_PATH);
status = client.executeMethod(get); status = client.executeMethod(get);
if(isSuccess(status)) { if(isSuccess(status)) {
Log.d(TAG, "Obtain RESPONSE"); Log.d(TAG, "Obtain RESPONSE");

View File

@ -1,5 +1,5 @@
/* ownCloud Android Library is available under MIT license /* 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 * Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal * 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 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.Parcel;
import android.os.Parcelable; import android.os.Parcelable;

View File

@ -1,5 +1,5 @@
/* ownCloud Android Library is available under MIT license /* 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 * Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal * 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.ByteArrayInputStream;
import java.io.InputStream; import java.io.InputStream;
@ -32,12 +32,10 @@ import org.apache.jackrabbit.webdav.client.methods.DeleteMethod;
import android.util.Log; import android.util.Log;
import com.owncloud.android.lib.network.OwnCloudClient; import com.owncloud.android.lib.common.OwnCloudClient;
import com.owncloud.android.lib.operations.common.RemoteOperation; import com.owncloud.android.lib.common.operations.RemoteOperation;
import com.owncloud.android.lib.operations.common.RemoteOperationResult; import com.owncloud.android.lib.common.operations.RemoteOperationResult;
import com.owncloud.android.lib.operations.common.RemoteOperationResult.ResultCode; import com.owncloud.android.lib.common.operations.RemoteOperationResult.ResultCode;
import com.owncloud.android.lib.utils.ShareUtils;
import com.owncloud.android.lib.utils.ShareXMLParser;
/** /**
* Remove a share * Remove a share
@ -50,16 +48,16 @@ public class RemoveRemoteShareOperation extends RemoteOperation {
private static final String TAG = RemoveRemoteShareOperation.class.getSimpleName(); private static final String TAG = RemoveRemoteShareOperation.class.getSimpleName();
private int mIdShare; private int mRemoteShareId;
/** /**
* Constructor * Constructor
* *
* @param idShare Share ID * @param remoteShareId Share ID
*/ */
public RemoveRemoteShareOperation(int idShare) { public RemoveRemoteShareOperation(int remoteShareId) {
mIdShare = idShare; mRemoteShareId = remoteShareId;
} }
@ -71,9 +69,9 @@ public class RemoveRemoteShareOperation extends RemoteOperation {
DeleteMethod delete = null; DeleteMethod delete = null;
try { try {
String id = "/" + String.valueOf(mIdShare); String id = "/" + String.valueOf(mRemoteShareId);
delete = new DeleteMethod(client.getBaseUri() + ShareUtils.SHAREAPI_ROUTE + id); delete = new DeleteMethod(client.getBaseUri() + ShareUtils.SHARING_API_PATH + id);
Log.d(TAG, "URL ------> " + client.getBaseUri() + ShareUtils.SHAREAPI_ROUTE + id); Log.d(TAG, "URL ------> " + client.getBaseUri() + ShareUtils.SHARING_API_PATH + id);
status = client.executeMethod(delete); status = client.executeMethod(delete);

View File

@ -1,5 +1,5 @@
/* ownCloud Android Library is available under MIT license /* 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 * Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal * 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: * Enum for Share Type, with values:

View File

@ -1,5 +1,5 @@
/* ownCloud Android Library is available under MIT license /* 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 * Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal * 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 * Contains Constants for Share Operation
@ -34,6 +34,6 @@ package com.owncloud.android.lib.utils;
public class ShareUtils { public class ShareUtils {
// OCS Route // 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";
} }

View File

@ -1,5 +1,5 @@
/* ownCloud Android Library is available under MIT license /* 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 * Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal * 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.IOException;
import java.io.InputStream; import java.io.InputStream;
@ -35,8 +35,7 @@ import org.xmlpull.v1.XmlPullParserFactory;
import android.util.Log; import android.util.Log;
import android.util.Xml; import android.util.Xml;
import com.owncloud.android.lib.operations.common.OCShare; import com.owncloud.android.lib.resources.files.FileUtils;
import com.owncloud.android.lib.operations.common.ShareType;
/** /**
* Parser for Share API Response * Parser for Share API Response

View File

@ -1,5 +1,5 @@
/* ownCloud Android Library is available under MIT license /* 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 * Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal * 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.HttpStatus;
import org.apache.commons.httpclient.methods.GetMethod; import org.apache.commons.httpclient.methods.GetMethod;
import org.json.JSONException; import org.json.JSONException;
import org.json.JSONObject; import org.json.JSONObject;
import com.owncloud.android.lib.accounts.AccountUtils; import com.owncloud.android.lib.common.OwnCloudClient;
import com.owncloud.android.lib.network.OwnCloudClient; import com.owncloud.android.lib.common.accounts.AccountUtils;
import com.owncloud.android.lib.operations.common.RemoteOperation; import com.owncloud.android.lib.common.operations.RemoteOperation;
import com.owncloud.android.lib.operations.common.RemoteOperationResult; import com.owncloud.android.lib.common.operations.RemoteOperationResult;
import com.owncloud.android.lib.utils.OwnCloudVersion;
import android.content.Context; import android.content.Context;
import android.net.ConnectivityManager; 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. */ /** 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; 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"; private static final String OCVERSION_SHARED_SUPPORTED = "5.0.13";
@ -67,7 +66,7 @@ public class OwnCloudServerCheckOperation extends RemoteOperation {
private OwnCloudVersion mOCVersion; private OwnCloudVersion mOCVersion;
private OwnCloudVersion mOCVersionString; private OwnCloudVersion mOCVersionString;
public OwnCloudServerCheckOperation(String url, Context context) { public GetRemoteStatusOperation(String url, Context context) {
mUrl = url; mUrl = url;
mContext = context; mContext = context;
mOCVersion = null; mOCVersion = null;

View File

@ -1,5 +1,5 @@
/* ownCloud Android Library is available under MIT license /* 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 * Copyright (C) 2012 Bartek Przybylski
* *
* Permission is hereby granted, free of charge, to any person obtaining a copy * 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 class OwnCloudVersion implements Comparable<OwnCloudVersion> {
public static final OwnCloudVersion owncloud_v1 = new OwnCloudVersion( public static final OwnCloudVersion owncloud_v1 = new OwnCloudVersion(

View File

@ -1,5 +1,5 @@
/* ownCloud Android Library is available under MIT license /* 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 * Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal * 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.commons.httpclient.methods.GetMethod;
import org.apache.http.HttpStatus; import org.apache.http.HttpStatus;
@ -30,9 +30,9 @@ import org.json.JSONObject;
import android.util.Log; import android.util.Log;
import com.owncloud.android.lib.network.OwnCloudClient; import com.owncloud.android.lib.common.OwnCloudClient;
import com.owncloud.android.lib.operations.common.RemoteOperation; import com.owncloud.android.lib.common.operations.RemoteOperation;
import com.owncloud.android.lib.operations.common.RemoteOperationResult; import com.owncloud.android.lib.common.operations.RemoteOperationResult;
/** /**
@ -44,9 +44,9 @@ import com.owncloud.android.lib.operations.common.RemoteOperationResult;
* email * 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 // HEADER
private static final String HEADER_OCS_API = "OCS-APIREQUEST"; private static final String HEADER_OCS_API = "OCS-APIREQUEST";
@ -69,7 +69,7 @@ public class GetUserNameRemoteOperation extends RemoteOperation {
} }
public GetUserNameRemoteOperation() { public GetRemoteUserNameOperation() {
} }
@Override @Override

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<!-- ownCloud Android Library is available under MIT license <!-- 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 Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal

View File

@ -1,5 +1,5 @@
<!-- ownCloud Android Library is available under MIT license <!-- 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 Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal

View File

@ -1,5 +1,5 @@
<!-- ownCloud Android Library is available under MIT license <!-- 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 Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal

View File

@ -1,5 +1,5 @@
<!-- ownCloud Android Library is available under MIT license <!-- 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 Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal

View File

@ -1,5 +1,5 @@
<!-- ownCloud Android Library is available under MIT license <!-- 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 Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal

View File

@ -1,5 +1,5 @@
<!-- ownCloud Android Library is available under MIT license <!-- 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 Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal

View File

@ -1,5 +1,5 @@
<!-- ownCloud Android Library is available under MIT license <!-- 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 Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal

View File

@ -1,5 +1,5 @@
<!-- ownCloud Android Library is available under MIT license <!-- 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 Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<!-- ownCloud Android Library is available under MIT license <!-- 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 Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<!-- ownCloud Android Library is available under MIT license <!-- 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 Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal

View File

@ -1,5 +1,5 @@
<!-- ownCloud Android Library is available under MIT license <!-- 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 Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal

View File

@ -1,5 +1,5 @@
/* ownCloud Android Library is available under MIT license /* 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 * Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal * 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 java.io.File;
import com.owncloud.android.lib.network.OwnCloudClientFactory; import com.owncloud.android.lib.common.OwnCloudClientFactory;
import com.owncloud.android.lib.network.OwnCloudClient; import com.owncloud.android.lib.common.OwnCloudClient;
import com.owncloud.android.lib.operations.common.RemoteFile; import com.owncloud.android.lib.resources.files.RemoteFile;
import com.owncloud.android.lib.operations.common.RemoteOperationResult; import com.owncloud.android.lib.common.operations.RemoteOperationResult;
import com.owncloud.android.lib.operations.common.ShareType; import com.owncloud.android.lib.resources.files.ChunkedUploadRemoteFileOperation;
import com.owncloud.android.lib.operations.remote.ChunkedUploadRemoteFileOperation; import com.owncloud.android.lib.resources.files.CreateRemoteFolderOperation;
import com.owncloud.android.lib.operations.remote.CreateRemoteFolderOperation; import com.owncloud.android.lib.resources.files.DownloadRemoteFileOperation;
import com.owncloud.android.lib.operations.remote.CreateShareRemoteOperation; import com.owncloud.android.lib.resources.files.ReadRemoteFolderOperation;
import com.owncloud.android.lib.operations.remote.DownloadRemoteFileOperation; import com.owncloud.android.lib.resources.files.RemoveRemoteFileOperation;
import com.owncloud.android.lib.operations.remote.GetRemoteSharesOperation; import com.owncloud.android.lib.resources.files.RenameRemoteFileOperation;
import com.owncloud.android.lib.operations.remote.ReadRemoteFolderOperation; import com.owncloud.android.lib.resources.files.UploadRemoteFileOperation;
import com.owncloud.android.lib.operations.remote.RemoveRemoteFileOperation; import com.owncloud.android.lib.resources.shares.CreateRemoteShareOperation;
import com.owncloud.android.lib.operations.remote.RenameRemoteFileOperation; import com.owncloud.android.lib.resources.shares.GetRemoteSharesOperation;
import com.owncloud.android.lib.operations.remote.UploadRemoteFileOperation; import com.owncloud.android.lib.resources.shares.RemoveRemoteShareOperation;
import com.owncloud.android.lib.operations.remote.RemoveRemoteShareOperation; import com.owncloud.android.lib.resources.shares.ShareType;
import com.owncloud.android.lib.test_project.R; import com.owncloud.android.lib.test_project.R;
import android.net.Uri; import android.net.Uri;
@ -228,7 +228,7 @@ public class TestActivity extends Activity {
public RemoteOperationResult createShare(String path, ShareType shareType, String shareWith, boolean publicUpload, public RemoteOperationResult createShare(String path, ShareType shareType, String shareWith, boolean publicUpload,
String password, int permissions){ 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); RemoteOperationResult result = createOperation.execute(mClient);
return result; return result;

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<!-- ownCloud Android Library is available under MIT license <!-- 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 Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<!-- ownCloud Android Library is available under MIT license <!-- 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 Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal

View File

@ -1,5 +1,5 @@
/* ownCloud Android Library is available under MIT license /* 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 * Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal * 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.text.SimpleDateFormat;
import java.util.Date; import java.util.Date;
import com.owncloud.android.lib.operations.common.RemoteOperationResult; import com.owncloud.android.lib.common.operations.RemoteOperationResult;
import com.owncloud.android.lib.operations.common.RemoteOperationResult.ResultCode; import com.owncloud.android.lib.common.operations.RemoteOperationResult.ResultCode;
import com.owncloud.android.lib.test_project.TestActivity; import com.owncloud.android.lib.test_project.TestActivity;
import android.test.ActivityInstrumentationTestCase2; import android.test.ActivityInstrumentationTestCase2;

View File

@ -1,5 +1,5 @@
/* ownCloud Android Library is available under MIT license /* 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 * Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal * of this software and associated documentation files (the "Software"), to deal
@ -24,8 +24,8 @@
package com.owncloud.android.lib.test_project.test; 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.operations.common.ShareType; import com.owncloud.android.lib.resources.shares.ShareType;
import com.owncloud.android.lib.test_project.TestActivity; import com.owncloud.android.lib.test_project.TestActivity;
import android.test.ActivityInstrumentationTestCase2; import android.test.ActivityInstrumentationTestCase2;

View File

@ -1,5 +1,5 @@
/* ownCloud Android Library is available under MIT license /* 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 * Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal * of this software and associated documentation files (the "Software"), to deal
@ -24,8 +24,8 @@
package com.owncloud.android.lib.test_project.test; 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.operations.common.RemoteOperationResult.ResultCode; import com.owncloud.android.lib.common.operations.RemoteOperationResult.ResultCode;
import com.owncloud.android.lib.test_project.TestActivity; import com.owncloud.android.lib.test_project.TestActivity;
import android.test.ActivityInstrumentationTestCase2; import android.test.ActivityInstrumentationTestCase2;

View File

@ -1,5 +1,5 @@
/* ownCloud Android Library is available under MIT license /* 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 * Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal * 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.text.SimpleDateFormat;
import java.util.Date; import java.util.Date;
import com.owncloud.android.lib.operations.common.RemoteFile; import com.owncloud.android.lib.resources.files.RemoteFile;
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 com.owncloud.android.lib.test_project.TestActivity;
import android.test.ActivityInstrumentationTestCase2; import android.test.ActivityInstrumentationTestCase2;

View File

@ -1,5 +1,5 @@
/* ownCloud Android Library is available under MIT license /* 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 * Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal * of this software and associated documentation files (the "Software"), to deal
@ -24,7 +24,7 @@
package com.owncloud.android.lib.test_project.test; 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 com.owncloud.android.lib.test_project.TestActivity;
import android.test.ActivityInstrumentationTestCase2; import android.test.ActivityInstrumentationTestCase2;

View File

@ -1,5 +1,5 @@
/* ownCloud Android Library is available under MIT license /* 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 * Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal * of this software and associated documentation files (the "Software"), to deal
@ -23,7 +23,7 @@
*/ */
package com.owncloud.android.lib.test_project.test; 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 com.owncloud.android.lib.test_project.TestActivity;
import android.test.ActivityInstrumentationTestCase2; import android.test.ActivityInstrumentationTestCase2;

View File

@ -1,5 +1,5 @@
/* ownCloud Android Library is available under MIT license /* 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 * Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal * of this software and associated documentation files (the "Software"), to deal
@ -24,7 +24,7 @@
package com.owncloud.android.lib.test_project.test; 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 com.owncloud.android.lib.test_project.TestActivity;
import android.test.ActivityInstrumentationTestCase2; import android.test.ActivityInstrumentationTestCase2;

View File

@ -1,5 +1,5 @@
/* ownCloud Android Library is available under MIT license /* 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 * Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal * of this software and associated documentation files (the "Software"), to deal
@ -24,8 +24,8 @@
package com.owncloud.android.lib.test_project.test; package com.owncloud.android.lib.test_project.test;
import com.owncloud.android.lib.operations.common.OCShare; import com.owncloud.android.lib.resources.shares.OCShare;
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 com.owncloud.android.lib.test_project.TestActivity;
import android.test.ActivityInstrumentationTestCase2; import android.test.ActivityInstrumentationTestCase2;

View File

@ -1,5 +1,5 @@
/* ownCloud Android Library is available under MIT license /* 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 * Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal * of this software and associated documentation files (the "Software"), to deal
@ -24,8 +24,8 @@
package com.owncloud.android.lib.test_project.test; 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.operations.common.RemoteOperationResult.ResultCode; import com.owncloud.android.lib.common.operations.RemoteOperationResult.ResultCode;
import com.owncloud.android.lib.test_project.TestActivity; import com.owncloud.android.lib.test_project.TestActivity;
import android.test.ActivityInstrumentationTestCase2; import android.test.ActivityInstrumentationTestCase2;

View File

@ -1,5 +1,5 @@
/* ownCloud Android Library is available under MIT license /* 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 * Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal * 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.test.ActivityInstrumentationTestCase2;
import android.util.Log; 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; import com.owncloud.android.lib.test_project.TestActivity;
/** /**