Merge branch 'develop' into introduce-travis-ci
authorThomas Müller <thomas.mueller@tmit.eu>
Thu, 13 Mar 2014 10:01:19 +0000 (11:01 +0100)
committerThomas Müller <thomas.mueller@tmit.eu>
Thu, 13 Mar 2014 10:01:19 +0000 (11:01 +0100)
246 files changed:
.gitmodules
AndroidManifest.xml
SETUP.md
oc_framework-test-project/.classpath [deleted file]
oc_framework-test-project/.project [deleted file]
oc_framework-test-project/.settings/org.eclipse.jdt.core.prefs [deleted file]
oc_framework-test-project/AndroidManifest.xml [deleted file]
oc_framework-test-project/assets/fileToUpload.png [deleted file]
oc_framework-test-project/assets/fileToUploadChunks.MP4 [deleted file]
oc_framework-test-project/ic_launcher-web.png [deleted file]
oc_framework-test-project/libs/android-support-v4.jar [deleted file]
oc_framework-test-project/oc_framework-test-test/.classpath [deleted file]
oc_framework-test-project/oc_framework-test-test/.project [deleted file]
oc_framework-test-project/oc_framework-test-test/.settings/org.eclipse.jdt.core.prefs [deleted file]
oc_framework-test-project/oc_framework-test-test/AndroidManifest.xml [deleted file]
oc_framework-test-project/oc_framework-test-test/project.properties [deleted file]
oc_framework-test-project/oc_framework-test-test/res/drawable-hdpi/ic_launcher.png [deleted file]
oc_framework-test-project/oc_framework-test-test/res/drawable-ldpi/ic_launcher.png [deleted file]
oc_framework-test-project/oc_framework-test-test/res/drawable-mdpi/ic_launcher.png [deleted file]
oc_framework-test-project/oc_framework-test-test/res/drawable-xhdpi/ic_launcher.png [deleted file]
oc_framework-test-project/oc_framework-test-test/res/values/strings.xml [deleted file]
oc_framework-test-project/oc_framework-test-test/src/com/owncloud/android/oc_framework_test_project/test/CreateFolderTest.java [deleted file]
oc_framework-test-project/oc_framework-test-test/src/com/owncloud/android/oc_framework_test_project/test/DeleteFileTest.java [deleted file]
oc_framework-test-project/oc_framework-test-test/src/com/owncloud/android/oc_framework_test_project/test/DownloadFileTest.java [deleted file]
oc_framework-test-project/oc_framework-test-test/src/com/owncloud/android/oc_framework_test_project/test/ReadFileTest.java [deleted file]
oc_framework-test-project/oc_framework-test-test/src/com/owncloud/android/oc_framework_test_project/test/ReadFolderTest.java [deleted file]
oc_framework-test-project/oc_framework-test-test/src/com/owncloud/android/oc_framework_test_project/test/RenameFileTest.java [deleted file]
oc_framework-test-project/oc_framework-test-test/src/com/owncloud/android/oc_framework_test_project/test/UploadFileTest.java [deleted file]
oc_framework-test-project/project.properties [deleted file]
oc_framework-test-project/res/drawable-hdpi/ic_launcher.png [deleted file]
oc_framework-test-project/res/drawable-mdpi/ic_launcher.png [deleted file]
oc_framework-test-project/res/drawable-xhdpi/ic_launcher.png [deleted file]
oc_framework-test-project/res/drawable-xxhdpi/ic_launcher.png [deleted file]
oc_framework-test-project/res/layout/activity_test.xml [deleted file]
oc_framework-test-project/res/menu/test.xml [deleted file]
oc_framework-test-project/res/values-sw600dp/dimens.xml [deleted file]
oc_framework-test-project/res/values-sw720dp-land/dimens.xml [deleted file]
oc_framework-test-project/res/values-v11/styles.xml [deleted file]
oc_framework-test-project/res/values-v14/styles.xml [deleted file]
oc_framework-test-project/res/values/dimens.xml [deleted file]
oc_framework-test-project/res/values/strings.xml [deleted file]
oc_framework-test-project/res/values/styles.xml [deleted file]
oc_framework-test-project/src/com/owncloud/android/oc_framework_test_project/TestActivity.java [deleted file]
oc_framework/.classpath [deleted file]
oc_framework/.project [deleted file]
oc_framework/.settings/org.eclipse.jdt.core.prefs [deleted file]
oc_framework/AndroidManifest.xml [deleted file]
oc_framework/build.xml [deleted file]
oc_framework/libs/commons-httpclient-3.1.jar [deleted file]
oc_framework/libs/jackrabbit-webdav-2.7.2.jar [deleted file]
oc_framework/libs/slf4j-api-1.7.5.jar [deleted file]
oc_framework/pom.xml [deleted file]
oc_framework/project.properties [deleted file]
oc_framework/res/values/empty.xml [deleted file]
oc_framework/src/com/owncloud/android/oc_framework/accounts/AccountTypeUtils.java [deleted file]
oc_framework/src/com/owncloud/android/oc_framework/accounts/AccountUtils.java [deleted file]
oc_framework/src/com/owncloud/android/oc_framework/accounts/OwnCloudAccount.java [deleted file]
oc_framework/src/com/owncloud/android/oc_framework/network/AdvancedSslSocketFactory.java [deleted file]
oc_framework/src/com/owncloud/android/oc_framework/network/AdvancedX509TrustManager.java [deleted file]
oc_framework/src/com/owncloud/android/oc_framework/network/BearerAuthScheme.java [deleted file]
oc_framework/src/com/owncloud/android/oc_framework/network/BearerCredentials.java [deleted file]
oc_framework/src/com/owncloud/android/oc_framework/network/CertificateCombinedException.java [deleted file]
oc_framework/src/com/owncloud/android/oc_framework/network/NetworkUtils.java [deleted file]
oc_framework/src/com/owncloud/android/oc_framework/network/ProgressiveDataTransferer.java [deleted file]
oc_framework/src/com/owncloud/android/oc_framework/network/ServerNameIndicator.java [deleted file]
oc_framework/src/com/owncloud/android/oc_framework/network/webdav/ChunkFromFileChannelRequestEntity.java [deleted file]
oc_framework/src/com/owncloud/android/oc_framework/network/webdav/FileRequestEntity.java [deleted file]
oc_framework/src/com/owncloud/android/oc_framework/network/webdav/OnDatatransferProgressListener.java [deleted file]
oc_framework/src/com/owncloud/android/oc_framework/network/webdav/OwnCloudClientFactory.java [deleted file]
oc_framework/src/com/owncloud/android/oc_framework/network/webdav/WebdavClient.java [deleted file]
oc_framework/src/com/owncloud/android/oc_framework/network/webdav/WebdavEntry.java [deleted file]
oc_framework/src/com/owncloud/android/oc_framework/network/webdav/WebdavUtils.java [deleted file]
oc_framework/src/com/owncloud/android/oc_framework/operations/OnRemoteOperationListener.java [deleted file]
oc_framework/src/com/owncloud/android/oc_framework/operations/OperationCancelledException.java [deleted file]
oc_framework/src/com/owncloud/android/oc_framework/operations/RemoteFile.java [deleted file]
oc_framework/src/com/owncloud/android/oc_framework/operations/RemoteOperation.java [deleted file]
oc_framework/src/com/owncloud/android/oc_framework/operations/RemoteOperationResult.java [deleted file]
oc_framework/src/com/owncloud/android/oc_framework/operations/remote/ChunkedUploadRemoteFileOperation.java [deleted file]
oc_framework/src/com/owncloud/android/oc_framework/operations/remote/CreateRemoteFolderOperation.java [deleted file]
oc_framework/src/com/owncloud/android/oc_framework/operations/remote/DownloadRemoteFileOperation.java [deleted file]
oc_framework/src/com/owncloud/android/oc_framework/operations/remote/ExistenceCheckRemoteOperation.java [deleted file]
oc_framework/src/com/owncloud/android/oc_framework/operations/remote/GetUserNameRemoteOperation.java [deleted file]
oc_framework/src/com/owncloud/android/oc_framework/operations/remote/ReadRemoteFileOperation.java [deleted file]
oc_framework/src/com/owncloud/android/oc_framework/operations/remote/ReadRemoteFolderOperation.java [deleted file]
oc_framework/src/com/owncloud/android/oc_framework/operations/remote/RemoveRemoteFileOperation.java [deleted file]
oc_framework/src/com/owncloud/android/oc_framework/operations/remote/RenameRemoteFileOperation.java [deleted file]
oc_framework/src/com/owncloud/android/oc_framework/operations/remote/UploadRemoteFileOperation.java [deleted file]
oc_framework/src/com/owncloud/android/oc_framework/utils/FileUtils.java [deleted file]
oc_framework/src/com/owncloud/android/oc_framework/utils/OwnCloudVersion.java [deleted file]
oc_jb_workaround/AndroidManifest.xml
owncloud-android-library [new submodule]
pom.xml
project.properties
res/drawable-hdpi/copy_link.png [new file with mode: 0644]
res/drawable-hdpi/sharedlink.png [new file with mode: 0644]
res/drawable-ldpi/copy_link.png [new file with mode: 0644]
res/drawable-mdpi/copy_link.png [new file with mode: 0644]
res/drawable-mdpi/sharedlink.png [new file with mode: 0644]
res/drawable-xhdpi/copy_link.png [new file with mode: 0644]
res/drawable-xhdpi/icon.png [new file with mode: 0644]
res/drawable-xhdpi/sharedlink.png [new file with mode: 0644]
res/layout-v11/activity_row.xml [new file with mode: 0644]
res/layout/activity_row.xml [new file with mode: 0644]
res/layout/list_item.xml
res/layout/ssl_untrusted_cert_layout.xml [new file with mode: 0644]
res/layout/ssl_validator_layout.xml
res/layout/sso_dialog.xml
res/menu/file_actions_menu.xml
res/values-ar/strings.xml
res/values-bg-rBG/strings.xml
res/values-bn-rBD/strings.xml
res/values-ca/strings.xml
res/values-cs-rCZ/strings.xml
res/values-cy-rGB/strings.xml
res/values-da/strings.xml
res/values-de-rAT/strings.xml
res/values-de-rCH/strings.xml
res/values-de-rDE/strings.xml
res/values-de/strings.xml
res/values-el/strings.xml
res/values-en-rGB/strings.xml
res/values-eo/strings.xml
res/values-es-rAR/strings.xml
res/values-es-rCL/strings.xml
res/values-es-rMX/strings.xml
res/values-es/strings.xml
res/values-et-rEE/strings.xml
res/values-eu-rES/strings.xml [new file with mode: 0644]
res/values-eu/strings.xml
res/values-fa/strings.xml
res/values-fi-rFI/strings.xml
res/values-fr/strings.xml
res/values-gl/strings.xml
res/values-he/strings.xml
res/values-hi/strings.xml
res/values-hu-rHU/strings.xml
res/values-ia/strings.xml
res/values-id/strings.xml
res/values-is/strings.xml
res/values-it/strings.xml
res/values-ja-rJP/strings.xml
res/values-ka-rGE/strings.xml
res/values-km/strings.xml
res/values-ko/strings.xml
res/values-lb/strings.xml
res/values-lt-rLT/strings.xml
res/values-lv/strings.xml
res/values-mk/strings.xml
res/values-ml/strings.xml [new file with mode: 0644]
res/values-mn/strings.xml [new file with mode: 0644]
res/values-nb-rNO/strings.xml
res/values-nl/strings.xml
res/values-nn-rNO/strings.xml
res/values-pa/strings.xml
res/values-pl/strings.xml
res/values-pt-rBR/strings.xml
res/values-pt-rPT/strings.xml
res/values-ro/strings.xml
res/values-ru/strings.xml
res/values-sk-rSK/strings.xml
res/values-sl/strings.xml
res/values-sq/strings.xml
res/values-sr-rSP/strings.xml
res/values-sr/strings.xml
res/values-su/strings.xml [new file with mode: 0644]
res/values-sv/strings.xml
res/values-te/strings.xml
res/values-th-rTH/strings.xml
res/values-tr/strings.xml
res/values-ug/strings.xml
res/values-uk/strings.xml
res/values-vi/strings.xml
res/values-zh-rCN/strings.xml
res/values-zh-rHK/strings.xml
res/values-zh-rTW/strings.xml
res/values/setup.xml
res/values/strings.xml
res/values/styles.xml
setup_env.bat
setup_env.sh
src/com/owncloud/android/authentication/AccountAuthenticator.java
src/com/owncloud/android/authentication/AccountUtils.java
src/com/owncloud/android/authentication/AuthenticatorActivity.java
src/com/owncloud/android/authentication/OwnCloudAccount.java [new file with mode: 0644]
src/com/owncloud/android/authentication/SsoWebViewClient.java
src/com/owncloud/android/datamodel/FileDataStorageManager.java
src/com/owncloud/android/datamodel/OCFile.java
src/com/owncloud/android/db/ProviderMeta.java
src/com/owncloud/android/files/FileHandler.java [deleted file]
src/com/owncloud/android/files/FileOperationsHelper.java [new file with mode: 0644]
src/com/owncloud/android/files/OwnCloudFileObserver.java
src/com/owncloud/android/files/services/FileDownloader.java
src/com/owncloud/android/files/services/FileObserverService.java
src/com/owncloud/android/files/services/FileUploader.java
src/com/owncloud/android/operations/CreateFolderOperation.java
src/com/owncloud/android/operations/CreateShareOperation.java [new file with mode: 0644]
src/com/owncloud/android/operations/DownloadFileOperation.java
src/com/owncloud/android/operations/GetSharesForFileOperation.java [new file with mode: 0644]
src/com/owncloud/android/operations/GetSharesOperation.java [new file with mode: 0644]
src/com/owncloud/android/operations/OAuth2GetAccessToken.java
src/com/owncloud/android/operations/OwnCloudServerCheckOperation.java [deleted file]
src/com/owncloud/android/operations/RemoveFileOperation.java
src/com/owncloud/android/operations/RenameFileOperation.java
src/com/owncloud/android/operations/SynchronizeFileOperation.java
src/com/owncloud/android/operations/SynchronizeFolderOperation.java
src/com/owncloud/android/operations/UnshareLinkOperation.java [new file with mode: 0644]
src/com/owncloud/android/operations/UpdateOCVersionOperation.java
src/com/owncloud/android/operations/UploadFileOperation.java
src/com/owncloud/android/operations/common/SyncOperation.java [new file with mode: 0644]
src/com/owncloud/android/providers/FileContentProvider.java
src/com/owncloud/android/services/OperationsService.java [new file with mode: 0644]
src/com/owncloud/android/syncadapter/AbstractOwnCloudSyncAdapter.java
src/com/owncloud/android/syncadapter/ContactSyncAdapter.java
src/com/owncloud/android/syncadapter/FileSyncAdapter.java
src/com/owncloud/android/syncadapter/FileSyncService.java
src/com/owncloud/android/ui/activity/AccountSelectActivity.java
src/com/owncloud/android/ui/activity/ConflictsResolveActivity.java
src/com/owncloud/android/ui/activity/CopyToClipboardActivity.java [new file with mode: 0644]
src/com/owncloud/android/ui/activity/FileActivity.java
src/com/owncloud/android/ui/activity/FileDisplayActivity.java
src/com/owncloud/android/ui/activity/HookActivity.java [new file with mode: 0644]
src/com/owncloud/android/ui/activity/Preferences.java
src/com/owncloud/android/ui/activity/UploadFilesActivity.java
src/com/owncloud/android/ui/activity/Uploader.java
src/com/owncloud/android/ui/adapter/CertificateCombinedExceptionViewAdapter.java [new file with mode: 0644]
src/com/owncloud/android/ui/adapter/FileListListAdapter.java
src/com/owncloud/android/ui/adapter/LocalFileListAdapter.java
src/com/owncloud/android/ui/adapter/SslCertificateViewAdapter.java [new file with mode: 0644]
src/com/owncloud/android/ui/adapter/SslErrorViewAdapter.java [new file with mode: 0644]
src/com/owncloud/android/ui/adapter/X509CertificateViewAdapter.java [new file with mode: 0644]
src/com/owncloud/android/ui/dialog/EditNameDialog.java
src/com/owncloud/android/ui/dialog/LoadingDialog.java
src/com/owncloud/android/ui/dialog/SamlWebViewDialog.java
src/com/owncloud/android/ui/dialog/ShareLinkToDialog.java [new file with mode: 0644]
src/com/owncloud/android/ui/dialog/SslUntrustedCertDialog.java [new file with mode: 0644]
src/com/owncloud/android/ui/dialog/SslValidatorDialog.java
src/com/owncloud/android/ui/fragment/FileDetailFragment.java
src/com/owncloud/android/ui/fragment/FileFragment.java
src/com/owncloud/android/ui/fragment/OCFileListFragment.java
src/com/owncloud/android/ui/preview/FileDownloadFragment.java
src/com/owncloud/android/ui/preview/PreviewImageActivity.java
src/com/owncloud/android/ui/preview/PreviewImageFragment.java
src/com/owncloud/android/ui/preview/PreviewMediaFragment.java
src/com/owncloud/android/ui/preview/PreviewVideoActivity.java
src/com/owncloud/android/utils/FileStorageUtils.java
tests/src/com/owncloud/android/test/AccountUtilsTest.java

index b41da32..f0ca872 100644 (file)
@@ -1,3 +1,6 @@
 [submodule "actionbarsherlock"]
        path = actionbarsherlock
        url = git://github.com/JakeWharton/ActionBarSherlock.git
+[submodule "owncloud-android-library"]
+       path = owncloud-android-library
+       url = git://github.com/owncloud/android-library.git
index 80fc7e3..f6d3472 100644 (file)
@@ -18,8 +18,8 @@
   along with this program.  If not, see <http://www.gnu.org/licenses/>.
  -->
 <manifest package="com.owncloud.android"
-    android:versionCode="105002"
-    android:versionName="1.5.2" xmlns:android="http://schemas.android.com/apk/res/android">
+    android:versionCode="105004"
+    android:versionName="1.5.4" xmlns:android="http://schemas.android.com/apk/res/android">
 
     <uses-permission android:name="android.permission.GET_ACCOUNTS" />
     <uses-permission android:name="android.permission.USE_CREDENTIALS" />
@@ -54,7 +54,6 @@
             >
             <intent-filter>
                 <action android:name="android.intent.action.MAIN" />
-
                 <category android:name="android.intent.category.LAUNCHER" />
             </intent-filter>
         </activity>
@@ -83,7 +82,8 @@
 
                 <data android:mimeType="*/*" >
                 </data>
-            </intent-filter>
+
+                       </intent-filter>
         </activity>
         <activity
             android:name=".ui.activity.Preferences"
         <activity android:name=".ui.activity.PreferencesNewSessionewSession" >
         </activity>
         
-        <activity      android:name=".ui.preview.PreviewImageActivity" />
+        <activity      
+            android:name=".ui.preview.PreviewImageActivity" 
+            />
                        
-        <activity      android:name=".ui.preview.PreviewVideoActivity"
-                                       android:label="@string/app_name"
-                                       android:theme="@style/Theme.ownCloud.Fullscreen" >
+        <activity      
+            android:name=".ui.preview.PreviewVideoActivity"
+                       android:label="@string/app_name"
+                       android:theme="@style/Theme.ownCloud.Fullscreen" 
+                       >
                </activity>        
 
         <service
             </intent-filter>
         </activity>
 
+        <service android:name=".services.OperationsService" />
         <service android:name=".files.services.FileDownloader" />
         <service android:name=".files.services.FileUploader" />
         <service android:name=".media.MediaService" />
         </receiver>
         <service android:name=".files.services.FileObserverService"/>
         
+        <activity 
+            android:name=".ui.activity.CopyToClipboardActivity" 
+               android:label="@string/copy_link"
+               android:icon="@drawable/copy_link" />
+        
     </application>
 
 </manifest>
index 1b5de18..a965064 100644 (file)
--- a/SETUP.md
+++ b/SETUP.md
@@ -12,6 +12,7 @@ NOTE: You must have git in your environment path variable to perform the next op
 * Pull changes from your develop branch: "git pull origin develop"
 * Make official ownCloud repo known as upstream: "git remote add upstream git@github.com:owncloud/android.git"
 * Make sure to get the latest changes from official android/develop branch: "git pull upstream develop"
+* Complete the setup of project properties and resolve pending dependencies running "setup_env.bat" or "./setup_env.sh" .
 
 At this point you can continue using different tools to build the project. Section 2, 3 and 4 describe some of the existing alternatives.  
 
@@ -19,23 +20,24 @@ At this point you can continue using different tools to build the project. Secti
   
 NOTE: You must have the Android SDK 'tools/', and 'platforms-tools/' folders in your environment path variable.
 
-* Complete the setup of project properties and resolve pending dependencies running "setup_env.bat" or "./setup_env.sh" .
 * Run "ant clean" .
-* Run "ant debug" to generate a debuggable version of the ownCkoud app.
+* Run "ant debug" to generate a debuggable version of the ownCloud app.
 
 ### 3. Building with console/maven:
 
 NOTE: You must have mvn (version >= 3.1.1) in your environment path. Current Android 'platforms-tools' need to be installed.
 
-* Download/install Android plugin for Maven, then build ownCloud with mvn:
-* "cd .."
-* "git clone https://github.com/mosabua/maven-android-sdk-deployer.git"
-* "cd maven-android-sdk-deployer"
-* "mvn -pl com.simpligility.android.sdk-deployer:android-19 -am install"
-* "cd ../android/oc_framework"
-* "mvn install"
-* "cd .."
-* Now you can create ownCloud APK using "mvn package"
+Download/install Android plugin for Maven, install owncloud-android-library, then build ownCloud with mvn:
+
+* cd ..
+* git clone https://github.com/mosabua/maven-android-sdk-deployer.git
+* cd maven-android-sdk-deployer
+* mvn -pl com.simpligility.android.sdk-deployer:android-19 -am install
+* cd ../android/owncloud-android-library
+* mvn install
+* cd ..
+
+Now you can create ownCloud APK using "mvn package"
 
 ### 4. Building with Eclipse:
 
@@ -46,15 +48,15 @@ NOTE: You must have the Android SDK 'tools/', and 'platforms-tools/' folders in
 * Clean project and compile.
 * If any error appear, check the project properties; in the 'Android' section, API Level should be greater or equal than 14.
 * Make sure android/actionbarsherlock/library/bin/library.jar was created.
-* Create a new "Android Project from Existing Code". Choose android/oc_framework as root.
+* Create a new "Android Project from Existing Code". Choose android/owncloud-android-library as root.
 * Clean project and compile.
 * If any error appear, check the project properties; in the 'Android' section, API Level should be 19 or greater.
-* Make sure android/oc_framework/bin/classes.jar was created.  
+* Make sure android/owncloud-android-library/bin/classes.jar was created.  
 * Import ownCloud Android project.
 * Clean project and compile.
 * If any error appears, check the project properties of owncloud-android project; in the 'Android' section:
   - API Level should be 19 or greater.
-  - Two library projects should appear referred in the bottom square: actionbarsherlock/library and oc_framework. Add them if needed. 
+  - Two library projects should appear referred in the bottom square: actionbarsherlock/library and owncloud-android-library. Add them if needed. 
 * After those actions you should be good to go. HAVE FUN!
 
 NOTE: Even though API level is set to 19, APK also runs on older devices because in AndroidManifest.xml minSdkVersion is set to 8.
@@ -70,6 +72,16 @@ NOTE: You must sign the [Contributor Agreement][1] before your changes can be ac
 * Again, click "Edit" and set "compare:develop"
 * Enter description and send pull request.
 
+### 6. Create another pull request:
+
+To make sure your new pull request does not contain commits which are already contained in previous PRs, create a new branch which is a clone of upstream/develop.
+
+* git fetch upstream
+* git checkout -b my_new_develop_branch upstream/develop
+* If you want to rename that branch later: "git checkout -b my_new_develop_branch_with_new_name"
+* Push branch to server: "git push -u origin name_of_local_develop_branch"
+* Use Github to issue PR
+
 
 [0]: https://github.com/owncloud/android/blob/master/CONTRIBUTING.md
 [1]: http://owncloud.org/about/contributor-agreement/
diff --git a/oc_framework-test-project/.classpath b/oc_framework-test-project/.classpath
deleted file mode 100644 (file)
index 394360f..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
-       <classpathentry kind="con" path="com.android.ide.eclipse.adt.ANDROID_FRAMEWORK"/>
-       <classpathentry exported="true" kind="con" path="com.android.ide.eclipse.adt.LIBRARIES"/>
-       <classpathentry exported="true" kind="con" path="com.android.ide.eclipse.adt.DEPENDENCIES"/>
-       <classpathentry exported="true" kind="lib" path="/oc_framework/bin/oc_framework.jar" sourcepath="/oc_framework"/>
-       <classpathentry kind="src" path="src"/>
-       <classpathentry kind="src" path="gen"/>
-       <classpathentry kind="output" path="bin/classes"/>
-</classpath>
diff --git a/oc_framework-test-project/.project b/oc_framework-test-project/.project
deleted file mode 100644 (file)
index 8c7df64..0000000
+++ /dev/null
@@ -1,33 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
-       <name>oc_framework-test-project</name>
-       <comment></comment>
-       <projects>
-       </projects>
-       <buildSpec>
-               <buildCommand>
-                       <name>com.android.ide.eclipse.adt.ResourceManagerBuilder</name>
-                       <arguments>
-                       </arguments>
-               </buildCommand>
-               <buildCommand>
-                       <name>com.android.ide.eclipse.adt.PreCompilerBuilder</name>
-                       <arguments>
-                       </arguments>
-               </buildCommand>
-               <buildCommand>
-                       <name>org.eclipse.jdt.core.javabuilder</name>
-                       <arguments>
-                       </arguments>
-               </buildCommand>
-               <buildCommand>
-                       <name>com.android.ide.eclipse.adt.ApkBuilder</name>
-                       <arguments>
-                       </arguments>
-               </buildCommand>
-       </buildSpec>
-       <natures>
-               <nature>com.android.ide.eclipse.adt.AndroidNature</nature>
-               <nature>org.eclipse.jdt.core.javanature</nature>
-       </natures>
-</projectDescription>
diff --git a/oc_framework-test-project/.settings/org.eclipse.jdt.core.prefs b/oc_framework-test-project/.settings/org.eclipse.jdt.core.prefs
deleted file mode 100644 (file)
index b080d2d..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-eclipse.preferences.version=1
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
-org.eclipse.jdt.core.compiler.compliance=1.6
-org.eclipse.jdt.core.compiler.source=1.6
diff --git a/oc_framework-test-project/AndroidManifest.xml b/oc_framework-test-project/AndroidManifest.xml
deleted file mode 100644 (file)
index 3c98ffe..0000000
+++ /dev/null
@@ -1,36 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<manifest xmlns:android="http://schemas.android.com/apk/res/android"
-    package="com.owncloud.android.oc_framework_test_project"
-    android:versionCode="1"
-    android:versionName="1.0" >
-    
-    <uses-permission android:name="android.permission.USE_CREDENTIALS" />
-    <uses-permission android:name="android.permission.GET_ACCOUNTS" />
-    <uses-permission android:name="android.permission.AUTHENTICATE_ACCOUNTS" />
-    <uses-permission android:name="android.permission.MANAGE_ACCOUNTS" />
-    <uses-permission android:name="android.permission.INTERNET"/>
-    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
-    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
-    <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
-
-       <uses-sdk
-        android:minSdkVersion="8"
-        android:targetSdkVersion="19" />
-
-    <application
-        android:allowBackup="true"
-        android:icon="@drawable/ic_launcher"
-        android:label="@string/app_name"
-        android:theme="@style/AppTheme" >
-        <activity
-            android:name="com.owncloud.android.oc_framework_test_project.TestActivity"
-            android:label="@string/app_name" >
-            <intent-filter>
-                <action android:name="android.intent.action.MAIN" />
-
-                <category android:name="android.intent.category.LAUNCHER" />
-            </intent-filter>
-        </activity>
-    </application>
-
-</manifest>
diff --git a/oc_framework-test-project/assets/fileToUpload.png b/oc_framework-test-project/assets/fileToUpload.png
deleted file mode 100644 (file)
index 915ec22..0000000
Binary files a/oc_framework-test-project/assets/fileToUpload.png and /dev/null differ
diff --git a/oc_framework-test-project/assets/fileToUploadChunks.MP4 b/oc_framework-test-project/assets/fileToUploadChunks.MP4
deleted file mode 100644 (file)
index 2422025..0000000
Binary files a/oc_framework-test-project/assets/fileToUploadChunks.MP4 and /dev/null differ
diff --git a/oc_framework-test-project/ic_launcher-web.png b/oc_framework-test-project/ic_launcher-web.png
deleted file mode 100644 (file)
index a18cbb4..0000000
Binary files a/oc_framework-test-project/ic_launcher-web.png and /dev/null differ
diff --git a/oc_framework-test-project/libs/android-support-v4.jar b/oc_framework-test-project/libs/android-support-v4.jar
deleted file mode 100644 (file)
index feaf44f..0000000
Binary files a/oc_framework-test-project/libs/android-support-v4.jar and /dev/null differ
diff --git a/oc_framework-test-project/oc_framework-test-test/.classpath b/oc_framework-test-project/oc_framework-test-test/.classpath
deleted file mode 100644 (file)
index 6c54c1c..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
-       <classpathentry exported="true" kind="con" path="com.android.ide.eclipse.adt.ANDROID_FRAMEWORK"/>
-       <classpathentry exported="true" kind="con" path="com.android.ide.eclipse.adt.LIBRARIES"/>
-       <classpathentry exported="true" kind="con" path="com.android.ide.eclipse.adt.DEPENDENCIES"/>
-       <classpathentry combineaccessrules="false" kind="src" path="/oc_framework-test-project"/>
-       <classpathentry kind="src" path="src"/>
-       <classpathentry kind="src" path="gen"/>
-       <classpathentry kind="output" path="bin/classes"/>
-</classpath>
diff --git a/oc_framework-test-project/oc_framework-test-test/.project b/oc_framework-test-project/oc_framework-test-test/.project
deleted file mode 100644 (file)
index c490827..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
-       <name>oc_framework-test</name>
-       <comment></comment>
-       <projects>
-               <project>oc_framework-test-project</project>
-       </projects>
-       <buildSpec>
-               <buildCommand>
-                       <name>com.android.ide.eclipse.adt.ResourceManagerBuilder</name>
-                       <arguments>
-                       </arguments>
-               </buildCommand>
-               <buildCommand>
-                       <name>com.android.ide.eclipse.adt.PreCompilerBuilder</name>
-                       <arguments>
-                       </arguments>
-               </buildCommand>
-               <buildCommand>
-                       <name>org.eclipse.jdt.core.javabuilder</name>
-                       <arguments>
-                       </arguments>
-               </buildCommand>
-               <buildCommand>
-                       <name>com.android.ide.eclipse.adt.ApkBuilder</name>
-                       <arguments>
-                       </arguments>
-               </buildCommand>
-       </buildSpec>
-       <natures>
-               <nature>com.android.ide.eclipse.adt.AndroidNature</nature>
-               <nature>org.eclipse.jdt.core.javanature</nature>
-       </natures>
-</projectDescription>
diff --git a/oc_framework-test-project/oc_framework-test-test/.settings/org.eclipse.jdt.core.prefs b/oc_framework-test-project/oc_framework-test-test/.settings/org.eclipse.jdt.core.prefs
deleted file mode 100644 (file)
index b080d2d..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-eclipse.preferences.version=1
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
-org.eclipse.jdt.core.compiler.compliance=1.6
-org.eclipse.jdt.core.compiler.source=1.6
diff --git a/oc_framework-test-project/oc_framework-test-test/AndroidManifest.xml b/oc_framework-test-project/oc_framework-test-test/AndroidManifest.xml
deleted file mode 100644 (file)
index 294f271..0000000
+++ /dev/null
@@ -1,17 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<manifest xmlns:android="http://schemas.android.com/apk/res/android"
-    package="com.owncloud.android.oc_framework_test_project.test"
-    android:versionCode="1"
-    android:versionName="1.0" >
-
-    <uses-sdk android:minSdkVersion="8" />
-    <application>
-        <uses-library android:name="android.test.runner" />
-    </application>
-
-    <instrumentation
-        android:name="android.test.InstrumentationTestRunner"
-        android:label="Tests for com.owncloud.android.oc_framework_test_project"
-        android:targetPackage="com.owncloud.android.oc_framework_test_project" />
-
-</manifest>
\ No newline at end of file
diff --git a/oc_framework-test-project/oc_framework-test-test/project.properties b/oc_framework-test-project/oc_framework-test-test/project.properties
deleted file mode 100644 (file)
index 4ab1256..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-# This file is automatically generated by Android Tools.
-# Do not modify this file -- YOUR CHANGES WILL BE ERASED!
-#
-# This file must be checked in Version Control Systems.
-#
-# To customize properties used by the Ant build system edit
-# "ant.properties", and override values to adapt the script to your
-# project structure.
-#
-# To enable ProGuard to shrink and obfuscate your code, uncomment this (available properties: sdk.dir, user.home):
-#proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt
-
-# Project target.
-target=android-19
diff --git a/oc_framework-test-project/oc_framework-test-test/res/drawable-hdpi/ic_launcher.png b/oc_framework-test-project/oc_framework-test-test/res/drawable-hdpi/ic_launcher.png
deleted file mode 100644 (file)
index 96a442e..0000000
Binary files a/oc_framework-test-project/oc_framework-test-test/res/drawable-hdpi/ic_launcher.png and /dev/null differ
diff --git a/oc_framework-test-project/oc_framework-test-test/res/drawable-ldpi/ic_launcher.png b/oc_framework-test-project/oc_framework-test-test/res/drawable-ldpi/ic_launcher.png
deleted file mode 100644 (file)
index 9923872..0000000
Binary files a/oc_framework-test-project/oc_framework-test-test/res/drawable-ldpi/ic_launcher.png and /dev/null differ
diff --git a/oc_framework-test-project/oc_framework-test-test/res/drawable-mdpi/ic_launcher.png b/oc_framework-test-project/oc_framework-test-test/res/drawable-mdpi/ic_launcher.png
deleted file mode 100644 (file)
index 359047d..0000000
Binary files a/oc_framework-test-project/oc_framework-test-test/res/drawable-mdpi/ic_launcher.png and /dev/null differ
diff --git a/oc_framework-test-project/oc_framework-test-test/res/drawable-xhdpi/ic_launcher.png b/oc_framework-test-project/oc_framework-test-test/res/drawable-xhdpi/ic_launcher.png
deleted file mode 100644 (file)
index 71c6d76..0000000
Binary files a/oc_framework-test-project/oc_framework-test-test/res/drawable-xhdpi/ic_launcher.png and /dev/null differ
diff --git a/oc_framework-test-project/oc_framework-test-test/res/values/strings.xml b/oc_framework-test-project/oc_framework-test-test/res/values/strings.xml
deleted file mode 100644 (file)
index 657f31d..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<resources>
-
-    <string name="app_name">Oc_framework-testTest</string>
-
-</resources>
diff --git a/oc_framework-test-project/oc_framework-test-test/src/com/owncloud/android/oc_framework_test_project/test/CreateFolderTest.java b/oc_framework-test-project/oc_framework-test-test/src/com/owncloud/android/oc_framework_test_project/test/CreateFolderTest.java
deleted file mode 100644 (file)
index 0c099b1..0000000
+++ /dev/null
@@ -1,113 +0,0 @@
-/* ownCloud Android client application
- *   Copyright (C) 2012-2013 ownCloud Inc.
- *
- *   This program is free software: you can redistribute it and/or modify
- *   it under the terms of the GNU General Public License version 2,
- *   as published by the Free Software Foundation.
- *
- *   This program is distributed in the hope that it will be useful,
- *   but WITHOUT ANY WARRANTY; without even the implied warranty of
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *   GNU General Public License for more details.
- *
- *   You should have received a copy of the GNU General Public License
- *   along with this program.  If not, see <http://www.gnu.org/licenses/>.
- *
- */
-
-package com.owncloud.android.oc_framework_test_project.test;
-
-import java.text.SimpleDateFormat;
-import java.util.Date;
-
-import com.owncloud.android.oc_framework.operations.RemoteOperationResult;
-import com.owncloud.android.oc_framework.operations.RemoteOperationResult.ResultCode;
-import com.owncloud.android.oc_framework_test_project.TestActivity;
-
-import android.test.ActivityInstrumentationTestCase2;
-
-/**
- * Class to test Create Folder Operation
- * @author masensio
- *
- */
-public class CreateFolderTest extends ActivityInstrumentationTestCase2<TestActivity> {
-
-       private TestActivity mActivity;
-       private String mCurrentDate;
-       
-       public CreateFolderTest() {
-           super(TestActivity.class);
-          
-               SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMdd_HHmmss");
-               mCurrentDate = sdf.format(new Date());
-       }
-       
-       @Override
-         protected void setUp() throws Exception {
-           super.setUp();
-           setActivityInitialTouchMode(false);
-           mActivity = getActivity();
-       }
-       
-       /**
-        * Test Create Folder
-        */
-       public void testCreateFolder() {
-
-               String remotePath = "/testCreateFolder" + mCurrentDate;
-               boolean createFullPath = true;
-               
-               RemoteOperationResult result =  mActivity.createFolder(remotePath, createFullPath);
-               assertTrue(result.isSuccess() || result.getCode() == ResultCode.TIMEOUT);
-               
-               // Create Subfolder
-               remotePath = "/testCreateFolder" + mCurrentDate + "/" + "testCreateFolder" + mCurrentDate;
-               createFullPath = true;
-               
-               result =  mActivity.createFolder(remotePath, createFullPath);
-               assertTrue(result.isSuccess() || result.getCode() == ResultCode.TIMEOUT);
-       }
-       
-       
-       /**
-        * Test to Create Folder with special characters: /  \  < >  :  "  |  ?  *
-        */
-       public void testCreateFolderSpecialCharacters() {               
-               boolean createFullPath = true;
-               
-               String remotePath = "/testSpecialCharacters_\\" + mCurrentDate;
-               RemoteOperationResult result =  mActivity.createFolder(remotePath, createFullPath);
-               assertTrue(result.getCode() == ResultCode.INVALID_CHARACTER_IN_NAME);
-               
-               remotePath = "/testSpecialCharacters_<" + mCurrentDate;         
-               result =  mActivity.createFolder(remotePath, createFullPath);
-               assertTrue(result.getCode() == ResultCode.INVALID_CHARACTER_IN_NAME);
-               
-               remotePath = "/testSpecialCharacters_>" + mCurrentDate;         
-               result =  mActivity.createFolder(remotePath, createFullPath);
-               assertTrue(result.getCode() == ResultCode.INVALID_CHARACTER_IN_NAME);
-               
-               remotePath = "/testSpecialCharacters_:" + mCurrentDate;         
-               result =  mActivity.createFolder(remotePath, createFullPath);
-               assertTrue(result.getCode() == ResultCode.INVALID_CHARACTER_IN_NAME);
-               
-               remotePath = "/testSpecialCharacters_\"" + mCurrentDate;                
-               result =  mActivity.createFolder(remotePath, createFullPath);
-               assertTrue(result.getCode() == ResultCode.INVALID_CHARACTER_IN_NAME);
-               
-               remotePath = "/testSpecialCharacters_|" + mCurrentDate;         
-               result =  mActivity.createFolder(remotePath, createFullPath);
-               assertTrue(result.getCode() == ResultCode.INVALID_CHARACTER_IN_NAME);
-               
-               remotePath = "/testSpecialCharacters_?" + mCurrentDate;         
-               result =  mActivity.createFolder(remotePath, createFullPath);
-               assertTrue(result.getCode() == ResultCode.INVALID_CHARACTER_IN_NAME);
-               
-               remotePath = "/testSpecialCharacters_*" + mCurrentDate;         
-               result =  mActivity.createFolder(remotePath, createFullPath);
-               assertTrue(result.getCode() == ResultCode.INVALID_CHARACTER_IN_NAME);
-       }
-
-
-}
diff --git a/oc_framework-test-project/oc_framework-test-test/src/com/owncloud/android/oc_framework_test_project/test/DeleteFileTest.java b/oc_framework-test-project/oc_framework-test-test/src/com/owncloud/android/oc_framework_test_project/test/DeleteFileTest.java
deleted file mode 100644 (file)
index 2086257..0000000
+++ /dev/null
@@ -1,80 +0,0 @@
-/* ownCloud Android client application
- *   Copyright (C) 2012-2013 ownCloud Inc.
- *
- *   This program is free software: you can redistribute it and/or modify
- *   it under the terms of the GNU General Public License version 2,
- *   as published by the Free Software Foundation.
- *
- *   This program is distributed in the hope that it will be useful,
- *   but WITHOUT ANY WARRANTY; without even the implied warranty of
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *   GNU General Public License for more details.
- *
- *   You should have received a copy of the GNU General Public License
- *   along with this program.  If not, see <http://www.gnu.org/licenses/>.
- *
- */
-
-package com.owncloud.android.oc_framework_test_project.test;
-
-import com.owncloud.android.oc_framework.operations.RemoteOperationResult;
-import com.owncloud.android.oc_framework.operations.RemoteOperationResult.ResultCode;
-import com.owncloud.android.oc_framework_test_project.TestActivity;
-
-import android.test.ActivityInstrumentationTestCase2;
-
-/**
- * Class to test Delete a File Operation
- * @author masensio
- *
- */
-
-public class DeleteFileTest extends ActivityInstrumentationTestCase2<TestActivity> {
-
-       /* Folder data to delete. */
-       private final String mFolderPath = "/folderToDelete";
-       
-       /* File to delete. */
-       private final String mFilePath = "fileToDelete.png";
-
-       private TestActivity mActivity;
-       
-       public DeleteFileTest() {
-           super(TestActivity.class);
-          
-       }
-       
-       @Override
-         protected void setUp() throws Exception {
-           super.setUp();
-           setActivityInitialTouchMode(false);
-           mActivity = getActivity();
-       }
-       
-       /**
-        * Test Remove Folder
-        */
-       public void testRemoveFolder() {
-
-               RemoteOperationResult result = mActivity.removeFile(mFolderPath);
-               assertTrue(result.isSuccess() || result.getCode() == ResultCode.FILE_NOT_FOUND);
-       }
-       
-       /**
-        * Test Remove File
-        */
-       public void testRemoveFile() {
-               
-               RemoteOperationResult result = mActivity.removeFile(mFilePath);
-               assertTrue(result.isSuccess() || result.getCode() == ResultCode.FILE_NOT_FOUND);
-       }
-
-       /**
-        * Restore initial conditions
-        */
-       public void testRestoreInitialConditions() {
-               RemoteOperationResult result = mActivity.createFolder(mFolderPath, true);
-               assertTrue(result.isSuccess());
-               
-       }
-}
diff --git a/oc_framework-test-project/oc_framework-test-test/src/com/owncloud/android/oc_framework_test_project/test/DownloadFileTest.java b/oc_framework-test-project/oc_framework-test-test/src/com/owncloud/android/oc_framework_test_project/test/DownloadFileTest.java
deleted file mode 100644 (file)
index 040deec..0000000
+++ /dev/null
@@ -1,123 +0,0 @@
-/* ownCloud Android client application
- *   Copyright (C) 2012-2013 ownCloud Inc.
- *
- *   This program is free software: you can redistribute it and/or modify
- *   it under the terms of the GNU General Public License version 2,
- *   as published by the Free Software Foundation.
- *
- *   This program is distributed in the hope that it will be useful,
- *   but WITHOUT ANY WARRANTY; without even the implied warranty of
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *   GNU General Public License for more details.
- *
- *   You should have received a copy of the GNU General Public License
- *   along with this program.  If not, see <http://www.gnu.org/licenses/>.
- *
- */
-
-package com.owncloud.android.oc_framework_test_project.test;
-
-import java.text.SimpleDateFormat;
-import java.util.Date;
-
-import com.owncloud.android.oc_framework.operations.RemoteFile;
-import com.owncloud.android.oc_framework.operations.RemoteOperationResult;
-import com.owncloud.android.oc_framework_test_project.TestActivity;
-
-import android.test.ActivityInstrumentationTestCase2;
-
-/**
- * Class to test Download File Operation
- * @author masensio
- *
- */
-
-public class DownloadFileTest extends ActivityInstrumentationTestCase2<TestActivity> {
-
-       
-       /* Files to download. These files must exist on the account */
-       private final String mRemoteFilePng = "/fileToDownload.png";
-       private final String mRemoteFileChunks = "/fileToDownload.mp4";
-       private final String mRemoteFileSpecialChars = "/@file@download.png";
-       private final String mRemoteFileSpecialCharsChunks = "/@file@download.mp4";
-       private final String mRemoteFileNotFound = "/fileNotFound.png"; /* This file mustn't exist on the account */
-       
-       private String mCurrentDate;
-       
-       
-       private TestActivity mActivity;
-       
-       public DownloadFileTest() {
-           super(TestActivity.class);
-           
-               SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMdd_HHmmss");
-               mCurrentDate = sdf.format(new Date());
-       }
-       
-       @Override
-         protected void setUp() throws Exception {
-           super.setUp();
-           setActivityInitialTouchMode(false);
-           mActivity = getActivity();
-       }
-
-       /**
-        * Test Download a File
-        */
-       public void testDownloadFile() {
-               String temporalFolder = "/download" + mCurrentDate;
-               
-               RemoteFile remoteFile= new RemoteFile(mRemoteFilePng);
-
-               RemoteOperationResult result = mActivity.downloadFile(remoteFile, temporalFolder);
-               assertTrue(result.isSuccess());
-       }
-       
-       /**
-        * Test Download a File with chunks
-        */
-       public void testDownloadFileChunks() {
-               String temporalFolder = "/download" + mCurrentDate;
-               
-               RemoteFile remoteFile= new RemoteFile(mRemoteFileChunks);
-
-               RemoteOperationResult result = mActivity.downloadFile(remoteFile, temporalFolder);
-               assertTrue(result.isSuccess());
-       }
-       
-       /**
-        * Test Download a File with special chars
-        */
-       public void testDownloadFileSpecialChars() {
-               String temporalFolder = "/download" + mCurrentDate;
-               
-               RemoteFile remoteFile= new RemoteFile(mRemoteFileSpecialChars);
-
-               RemoteOperationResult result = mActivity.downloadFile(remoteFile, temporalFolder);
-               assertTrue(result.isSuccess());
-       }
-       
-       /**
-        * Test Download a File with special chars and chunks
-        */
-       public void testDownloadFileSpecialCharsChunks() {
-               String temporalFolder = "/download" + mCurrentDate;
-               
-               RemoteFile remoteFile= new RemoteFile(mRemoteFileSpecialCharsChunks);
-
-               RemoteOperationResult result = mActivity.downloadFile(remoteFile, temporalFolder);
-               assertTrue(result.isSuccess());
-       }
-       
-       /**
-        * Test Download a Not Found File 
-        */
-       public void testDownloadFileNotFound() {
-               String temporalFolder = "/download" + mCurrentDate;
-
-               RemoteFile remoteFile = new RemoteFile(mRemoteFileNotFound);
-
-               RemoteOperationResult result = mActivity.downloadFile(remoteFile, temporalFolder);
-               assertFalse(result.isSuccess());
-       }
-}
diff --git a/oc_framework-test-project/oc_framework-test-test/src/com/owncloud/android/oc_framework_test_project/test/ReadFileTest.java b/oc_framework-test-project/oc_framework-test-test/src/com/owncloud/android/oc_framework_test_project/test/ReadFileTest.java
deleted file mode 100644 (file)
index b75732b..0000000
+++ /dev/null
@@ -1,61 +0,0 @@
-/* ownCloud Android client application
- *   Copyright (C) 2012-2013 ownCloud Inc.
- *
- *   This program is free software: you can redistribute it and/or modify
- *   it under the terms of the GNU General Public License version 2,
- *   as published by the Free Software Foundation.
- *
- *   This program is distributed in the hope that it will be useful,
- *   but WITHOUT ANY WARRANTY; without even the implied warranty of
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *   GNU General Public License for more details.
- *
- *   You should have received a copy of the GNU General Public License
- *   along with this program.  If not, see <http://www.gnu.org/licenses/>.
- *
- */
-
-package com.owncloud.android.oc_framework_test_project.test;
-
-import com.owncloud.android.oc_framework.operations.RemoteOperationResult;
-import com.owncloud.android.oc_framework_test_project.TestActivity;
-
-import android.test.ActivityInstrumentationTestCase2;
-
-/**
- * Class to test Read File Operation
- * @author masensio
- *
- */
-
-public class ReadFileTest extends      ActivityInstrumentationTestCase2<TestActivity> {
-       
-       /* File data to read. This file must exist on the account */
-    private final String mRemoteFolderPath = "/fileToRead.txt";
-    
-    
-    private TestActivity mActivity;
-    
-    public ReadFileTest() {
-        super(TestActivity.class);
-    }
-    
-    @Override
-      protected void setUp() throws Exception {
-        super.setUp();
-        setActivityInitialTouchMode(false);
-        mActivity = getActivity();
-    }
-
-    /**
-     * Test Read File
-     */
-    public void testReadFile() {
-
-            RemoteOperationResult result = mActivity.readFile(mRemoteFolderPath);
-            assertTrue(result.getData().size() ==  1);
-            assertTrue(result.isSuccess());
-    }
-    
-
-}
diff --git a/oc_framework-test-project/oc_framework-test-test/src/com/owncloud/android/oc_framework_test_project/test/ReadFolderTest.java b/oc_framework-test-project/oc_framework-test-test/src/com/owncloud/android/oc_framework_test_project/test/ReadFolderTest.java
deleted file mode 100644 (file)
index ed9ccef..0000000
+++ /dev/null
@@ -1,62 +0,0 @@
-/* ownCloud Android client application
- *   Copyright (C) 2012-2013 ownCloud Inc.
- *
- *   This program is free software: you can redistribute it and/or modify
- *   it under the terms of the GNU General Public License version 2,
- *   as published by the Free Software Foundation.
- *
- *   This program is distributed in the hope that it will be useful,
- *   but WITHOUT ANY WARRANTY; without even the implied warranty of
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *   GNU General Public License for more details.
- *
- *   You should have received a copy of the GNU General Public License
- *   along with this program.  If not, see <http://www.gnu.org/licenses/>.
- *
- */
-
-package com.owncloud.android.oc_framework_test_project.test;
-
-import com.owncloud.android.oc_framework.operations.RemoteOperationResult;
-import com.owncloud.android.oc_framework_test_project.TestActivity;
-
-import android.test.ActivityInstrumentationTestCase2;
-
-/**
- * Class to test Read Folder Operation
- * @author masensio
- *
- */
-
-public class ReadFolderTest extends    ActivityInstrumentationTestCase2<TestActivity> {
-       
-
-       /* Folder data to read. This folder must exist on the account */
-       private final String mRemoteFolderPath = "/folderToRead";
-       
-       
-       private TestActivity mActivity;
-       
-       public ReadFolderTest() {
-           super(TestActivity.class);
-       }
-       
-       @Override
-         protected void setUp() throws Exception {
-           super.setUp();
-           setActivityInitialTouchMode(false);
-           mActivity = getActivity();
-       }
-
-       /**
-        * Test Read Folder
-        */
-       public void testReadFolder() {
-
-               RemoteOperationResult result = mActivity.readFile(mRemoteFolderPath);
-               assertTrue(result.getData().size() > 1);
-               assertTrue(result.getData().size() == 4);
-               assertTrue(result.isSuccess());
-       }
-       
-}
diff --git a/oc_framework-test-project/oc_framework-test-test/src/com/owncloud/android/oc_framework_test_project/test/RenameFileTest.java b/oc_framework-test-project/oc_framework-test-test/src/com/owncloud/android/oc_framework_test_project/test/RenameFileTest.java
deleted file mode 100644 (file)
index 7de3553..0000000
+++ /dev/null
@@ -1,170 +0,0 @@
-/* ownCloud Android client application
- *   Copyright (C) 2012-2013 ownCloud Inc.
- *
- *   This program is free software: you can redistribute it and/or modify
- *   it under the terms of the GNU General Public License version 2,
- *   as published by the Free Software Foundation.
- *
- *   This program is distributed in the hope that it will be useful,
- *   but WITHOUT ANY WARRANTY; without even the implied warranty of
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *   GNU General Public License for more details.
- *
- *   You should have received a copy of the GNU General Public License
- *   along with this program.  If not, see <http://www.gnu.org/licenses/>.
- *
- */
-
-package com.owncloud.android.oc_framework_test_project.test;
-
-import com.owncloud.android.oc_framework.operations.RemoteOperationResult;
-import com.owncloud.android.oc_framework.operations.RemoteOperationResult.ResultCode;
-import com.owncloud.android.oc_framework_test_project.TestActivity;
-
-import android.test.ActivityInstrumentationTestCase2;
-
-/**
- * Class to test Rename File Operation
- * @author masensio
- *
- */
-
-public class RenameFileTest extends ActivityInstrumentationTestCase2<TestActivity> {
-
-       /* Folder data to rename. This folder must exist on the account */
-       private final String mOldFolderName = "folderToRename";
-       private final String mOldFolderPath = "/folderToRename";
-       private final String mNewFolderName = "renamedFolder"; 
-       private final String mNewFolderPath = "/renamedFolder";
-       
-       /* File data to rename. This file must exist on the account */
-       private final String mOldFileName = "fileToRename.png";
-       private final String mOldFilePath = "/fileToRename.png";
-       private final String mNewFileName = "renamedFile";
-       private final String mFileExtension = ".png";
-       private final String mNewFilePath ="/renamedFile.png";
-       
-       
-       private TestActivity mActivity;
-       
-       public RenameFileTest() {
-           super(TestActivity.class);
-          
-       }
-       
-       @Override
-         protected void setUp() throws Exception {
-           super.setUp();
-           setActivityInitialTouchMode(false);
-           mActivity = getActivity();
-       }
-       
-       /**
-        * Test Rename Folder
-        */
-       public void testRenameFolder() {
-
-               RemoteOperationResult result = mActivity.renameFile(mOldFolderName, mOldFolderPath, 
-                               mNewFolderName, true);
-               assertTrue(result.isSuccess());
-       }
-       
-       /**
-        * Test Rename Folder with forbidden characters : \  < >  :  "  |  ?  *
-        */
-       public void testRenameFolderForbiddenChars() {
-               
-               RemoteOperationResult result = mActivity.renameFile(mOldFolderName, mOldFolderPath, 
-                               mNewFolderName + "\\", true);
-               assertTrue(result.getCode() == ResultCode.INVALID_CHARACTER_IN_NAME);
-               
-               result = mActivity.renameFile(mOldFolderName, mOldFolderPath, 
-                               mNewFolderName + "<", true);
-               assertTrue(result.getCode() == ResultCode.INVALID_CHARACTER_IN_NAME);
-               
-               result = mActivity.renameFile(mOldFolderName, mOldFolderPath, 
-                               mNewFolderName + ">", true);
-               assertTrue(result.getCode() == ResultCode.INVALID_CHARACTER_IN_NAME);
-               
-               result = mActivity.renameFile(mOldFolderName, mOldFolderPath, 
-                               mNewFolderName + ":", true);
-               assertTrue(result.getCode() == ResultCode.INVALID_CHARACTER_IN_NAME);
-               
-               result = mActivity.renameFile(mOldFolderName, mOldFolderPath, 
-                               mNewFolderName + "\"", true);
-               assertTrue(result.getCode() == ResultCode.INVALID_CHARACTER_IN_NAME);
-               
-               result = mActivity.renameFile(mOldFolderName, mOldFolderPath, 
-                               mNewFolderName + "|", true);
-               assertTrue(result.getCode() == ResultCode.INVALID_CHARACTER_IN_NAME);
-               
-               result = mActivity.renameFile(mOldFolderName, mOldFolderPath, 
-                               mNewFolderName + "?", true);
-               assertTrue(result.getCode() == ResultCode.INVALID_CHARACTER_IN_NAME);
-               
-               result = mActivity.renameFile(mOldFolderName, mOldFolderPath, 
-                               mNewFolderName + "*", true);
-               assertTrue(result.getCode() == ResultCode.INVALID_CHARACTER_IN_NAME);
-       }
-       
-       /**
-        * Test Rename File
-        */
-       public void testRenameFile() {
-               RemoteOperationResult result = mActivity.renameFile(mOldFileName, mOldFilePath, 
-                               mNewFileName + mFileExtension, false);
-               assertTrue(result.isSuccess());
-       }
-       
-       
-       /**
-        * Test Rename Folder with forbidden characters: \  < >  :  "  |  ?  *
-        */
-       public void testRenameFileForbiddenChars() {            
-               RemoteOperationResult result = mActivity.renameFile(mOldFileName, mOldFilePath, 
-                               mNewFileName + "\\" + mFileExtension, false);
-               assertTrue(result.getCode() == ResultCode.INVALID_CHARACTER_IN_NAME);
-               
-               result = mActivity.renameFile(mOldFileName, mOldFilePath, 
-                               mNewFileName + "<" + mFileExtension, false);
-               assertTrue(result.getCode() == ResultCode.INVALID_CHARACTER_IN_NAME);
-               
-               result = mActivity.renameFile(mOldFileName, mOldFilePath, 
-                               mNewFileName + ">" + mFileExtension, false);
-               assertTrue(result.getCode() == ResultCode.INVALID_CHARACTER_IN_NAME);
-               
-               result = mActivity.renameFile(mOldFileName, mOldFilePath, 
-                               mNewFileName + ":" + mFileExtension, false);
-               assertTrue(result.getCode() == ResultCode.INVALID_CHARACTER_IN_NAME);
-               
-               result = mActivity.renameFile(mOldFileName, mOldFilePath, 
-                               mNewFileName + "\"" + mFileExtension, false);
-               assertTrue(result.getCode() == ResultCode.INVALID_CHARACTER_IN_NAME);
-               
-               result = mActivity.renameFile(mOldFileName, mOldFilePath, 
-                               mNewFileName + "|" + mFileExtension, false);
-               assertTrue(result.getCode() == ResultCode.INVALID_CHARACTER_IN_NAME);
-               
-               result = mActivity.renameFile(mOldFileName, mOldFilePath, 
-                               mNewFileName + "?" + mFileExtension, false);
-               assertTrue(result.getCode() == ResultCode.INVALID_CHARACTER_IN_NAME);
-               
-               result = mActivity.renameFile(mOldFileName, mOldFilePath, 
-                               mNewFileName + "*" + mFileExtension, false);
-               assertTrue(result.getCode() == ResultCode.INVALID_CHARACTER_IN_NAME);
-               
-       }
-       
-       
-       /**
-        * Restore initial conditions
-        */
-       public void testRestoreInitialConditions() {
-               RemoteOperationResult result = mActivity.renameFile(mNewFolderName, mNewFolderPath, mOldFolderName, true);
-               assertTrue(result.isSuccess());
-               
-               result = mActivity.renameFile(mNewFileName + mFileExtension, mNewFilePath, mOldFileName, false);
-               assertTrue(result.isSuccess());
-       }
-       
-}
diff --git a/oc_framework-test-project/oc_framework-test-test/src/com/owncloud/android/oc_framework_test_project/test/UploadFileTest.java b/oc_framework-test-project/oc_framework-test-test/src/com/owncloud/android/oc_framework_test_project/test/UploadFileTest.java
deleted file mode 100644 (file)
index 6710371..0000000
+++ /dev/null
@@ -1,161 +0,0 @@
-/* ownCloud Android client application
- *   Copyright (C) 2012-2013 ownCloud Inc.
- *
- *   This program is free software: you can redistribute it and/or modify
- *   it under the terms of the GNU General Public License version 2,
- *   as published by the Free Software Foundation.
- *
- *   This program is distributed in the hope that it will be useful,
- *   but WITHOUT ANY WARRANTY; without even the implied warranty of
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *   GNU General Public License for more details.
- *
- *   You should have received a copy of the GNU General Public License
- *   along with this program.  If not, see <http://www.gnu.org/licenses/>.
- *
- */
-
-package com.owncloud.android.oc_framework_test_project.test;
-
-import java.io.File;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.OutputStream;
-import java.text.SimpleDateFormat;
-import java.util.Date;
-
-import android.content.res.AssetManager;
-import android.os.Environment;
-import android.test.ActivityInstrumentationTestCase2;
-import android.util.Log;
-
-import com.owncloud.android.oc_framework.operations.RemoteOperationResult;
-import com.owncloud.android.oc_framework_test_project.TestActivity;
-
-/**
- * Class to test Update File Operation
- * @author masensio
- *
- */
-
-public class UploadFileTest extends ActivityInstrumentationTestCase2<TestActivity> {
-
-       /* Files to upload. These files must exists on the device */    
-       private final String mFileToUpload = "fileToUpload.png";
-       private final String mMimeType = "image/png";
-       
-       private final String mFileToUploadWithChunks = "fileToUploadChunks.MP4";
-       private final String mMimeTypeWithChunks = "video/mp4";
-       
-       private final String mFileNotFound = "fileNotFound.png";
-       
-       private final String mStoragePath = "/owncloud/tmp/uploadTest";
-       private String mPath;
-       
-       private String mCurrentDate;
-       
-       private TestActivity mActivity;
-       
-       public UploadFileTest() {
-           super(TestActivity.class);
-          
-       }
-       
-       @Override
-         protected void setUp() throws Exception {
-           super.setUp();
-           setActivityInitialTouchMode(false);
-           mActivity = getActivity();
-           
-           SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMdd_HHmmss");
-           mCurrentDate = sdf.format(new Date());
-           
-           File sdCard = Environment.getExternalStorageDirectory();
-        mPath =  sdCard.getAbsolutePath() + "/" + mStoragePath + mCurrentDate;
-        
-               //mActivity.createFolder(mPath, true);
-        
-           copyAssets();
-       }
-
-       /**
-        * Copy Files to ulpload to SdCard
-        */
-       private void copyAssets() {
-               AssetManager assetManager = getActivity().getAssets();
-               String[] files = { mFileToUpload, mFileToUploadWithChunks }; 
-           
-           // Folder with contents
-        File folder = new File(mPath);
-        folder.mkdirs();
-        
-        
-           for(String filename : files) {
-               InputStream in = null;
-               OutputStream out = null;
-               try {
-                 in = assetManager.open(filename);
-                 File outFile = new File(folder, filename);
-                 out = new FileOutputStream(outFile);
-                 copyFile(in, out);
-                 in.close();
-                 in = null;
-                 out.flush();
-                 out.close();
-                 out = null;
-               } catch(IOException e) {
-                   Log.e("tag", "Failed to copy asset file: " + filename, e);
-               }       
-           }
-       }
-       
-       private void copyFile(InputStream in, OutputStream out) throws IOException {
-           byte[] buffer = new byte[1024];
-           int read;
-           while((read = in.read(buffer)) != -1){
-             out.write(buffer, 0, read);
-           }
-       }
-       
-       
-       /**
-        * Test Upload File without chunks
-        */
-       public void testUploadFile() {
-
-               String storagePath = mPath + "/" + mFileToUpload;
-               //String remotePath = "/uploadTest" + mCurrentDate + "/" + mFileToUpload;
-               String remotePath = "/" + mFileToUpload;
-               
-               RemoteOperationResult result = mActivity.uploadFile(storagePath, remotePath, mMimeType);
-               assertTrue(result.isSuccess());
-       }
-       
-       /**
-        * Test Upload File with chunks
-        */
-       public void testUploadFileWithChunks() {
-
-               String storagePath = mPath + "/" + mFileToUploadWithChunks;
-               //String remotePath = "/uploadTest" + mCurrentDate + "/" +mFileToUploadWithChunks;
-               String remotePath = "/" + mFileToUploadWithChunks;
-               
-               RemoteOperationResult result = mActivity.uploadFile(storagePath, remotePath, mMimeTypeWithChunks);
-               assertTrue(result.isSuccess());
-       }
-       
-       /**
-        * Test Upload Not Found File
-        */
-       public void testUploadFileNotFound() {
-
-               String storagePath = mPath + "/" + mFileNotFound;
-               //String remotePath = "/uploadTest" + mCurrentDate + "/" + mFileToUpload;
-               String remotePath = "/" + mFileNotFound;
-               
-               RemoteOperationResult result = mActivity.uploadFile(storagePath, remotePath, mMimeType);
-               assertFalse(result.isSuccess());
-       }
-       
-}
diff --git a/oc_framework-test-project/project.properties b/oc_framework-test-project/project.properties
deleted file mode 100644 (file)
index 153d36b..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-# This file is automatically generated by Android Tools.
-# Do not modify this file -- YOUR CHANGES WILL BE ERASED!
-#
-# This file must be checked in Version Control Systems.
-#
-# To customize properties used by the Ant build system edit
-# "ant.properties", and override values to adapt the script to your
-# project structure.
-#
-# To enable ProGuard to shrink and obfuscate your code, uncomment this (available properties: sdk.dir, user.home):
-#proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt
-
-# Project target.
-target=android-19
-android.library.reference.1=../oc_framework
diff --git a/oc_framework-test-project/res/drawable-hdpi/ic_launcher.png b/oc_framework-test-project/res/drawable-hdpi/ic_launcher.png
deleted file mode 100644 (file)
index 288b665..0000000
Binary files a/oc_framework-test-project/res/drawable-hdpi/ic_launcher.png and /dev/null differ
diff --git a/oc_framework-test-project/res/drawable-mdpi/ic_launcher.png b/oc_framework-test-project/res/drawable-mdpi/ic_launcher.png
deleted file mode 100644 (file)
index 6ae570b..0000000
Binary files a/oc_framework-test-project/res/drawable-mdpi/ic_launcher.png and /dev/null differ
diff --git a/oc_framework-test-project/res/drawable-xhdpi/ic_launcher.png b/oc_framework-test-project/res/drawable-xhdpi/ic_launcher.png
deleted file mode 100644 (file)
index d4fb7cd..0000000
Binary files a/oc_framework-test-project/res/drawable-xhdpi/ic_launcher.png and /dev/null differ
diff --git a/oc_framework-test-project/res/drawable-xxhdpi/ic_launcher.png b/oc_framework-test-project/res/drawable-xxhdpi/ic_launcher.png
deleted file mode 100644 (file)
index 85a6081..0000000
Binary files a/oc_framework-test-project/res/drawable-xxhdpi/ic_launcher.png and /dev/null differ
diff --git a/oc_framework-test-project/res/layout/activity_test.xml b/oc_framework-test-project/res/layout/activity_test.xml
deleted file mode 100644 (file)
index 42c4fbd..0000000
+++ /dev/null
@@ -1,16 +0,0 @@
-<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
-    xmlns:tools="http://schemas.android.com/tools"
-    android:layout_width="match_parent"
-    android:layout_height="match_parent"
-    android:paddingBottom="@dimen/activity_vertical_margin"
-    android:paddingLeft="@dimen/activity_horizontal_margin"
-    android:paddingRight="@dimen/activity_horizontal_margin"
-    android:paddingTop="@dimen/activity_vertical_margin"
-    tools:context=".TestActivity" >
-
-    <TextView
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        android:text="@string/hello_world" />
-
-</RelativeLayout>
diff --git a/oc_framework-test-project/res/menu/test.xml b/oc_framework-test-project/res/menu/test.xml
deleted file mode 100644 (file)
index c002028..0000000
+++ /dev/null
@@ -1,9 +0,0 @@
-<menu xmlns:android="http://schemas.android.com/apk/res/android" >
-
-    <item
-        android:id="@+id/action_settings"
-        android:orderInCategory="100"
-        android:showAsAction="never"
-        android:title="@string/action_settings"/>
-
-</menu>
diff --git a/oc_framework-test-project/res/values-sw600dp/dimens.xml b/oc_framework-test-project/res/values-sw600dp/dimens.xml
deleted file mode 100644 (file)
index 44f01db..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-<resources>
-
-    <!--
-         Customize dimensions originally defined in res/values/dimens.xml (such as
-         screen margins) for sw600dp devices (e.g. 7" tablets) here.
-    -->
-
-</resources>
diff --git a/oc_framework-test-project/res/values-sw720dp-land/dimens.xml b/oc_framework-test-project/res/values-sw720dp-land/dimens.xml
deleted file mode 100644 (file)
index 61e3fa8..0000000
+++ /dev/null
@@ -1,9 +0,0 @@
-<resources>
-
-    <!--
-         Customize dimensions originally defined in res/values/dimens.xml (such as
-         screen margins) for sw720dp devices (e.g. 10" tablets) in landscape here.
-    -->
-    <dimen name="activity_horizontal_margin">128dp</dimen>
-
-</resources>
diff --git a/oc_framework-test-project/res/values-v11/styles.xml b/oc_framework-test-project/res/values-v11/styles.xml
deleted file mode 100644 (file)
index 3c02242..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-<resources>
-
-    <!--
-        Base application theme for API 11+. This theme completely replaces
-        AppBaseTheme from res/values/styles.xml on API 11+ devices.
-    -->
-    <style name="AppBaseTheme" parent="android:Theme.Holo.Light">
-        <!-- API 11 theme customizations can go here. -->
-    </style>
-
-</resources>
diff --git a/oc_framework-test-project/res/values-v14/styles.xml b/oc_framework-test-project/res/values-v14/styles.xml
deleted file mode 100644 (file)
index a91fd03..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-<resources>
-
-    <!--
-        Base application theme for API 14+. This theme completely replaces
-        AppBaseTheme from BOTH res/values/styles.xml and
-        res/values-v11/styles.xml on API 14+ devices.
-    -->
-    <style name="AppBaseTheme" parent="android:Theme.Holo.Light.DarkActionBar">
-        <!-- API 14 theme customizations can go here. -->
-    </style>
-
-</resources>
diff --git a/oc_framework-test-project/res/values/dimens.xml b/oc_framework-test-project/res/values/dimens.xml
deleted file mode 100644 (file)
index 55c1e59..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-<resources>
-
-    <!-- Default screen margins, per the Android Design guidelines. -->
-    <dimen name="activity_horizontal_margin">16dp</dimen>
-    <dimen name="activity_vertical_margin">16dp</dimen>
-
-</resources>
diff --git a/oc_framework-test-project/res/values/strings.xml b/oc_framework-test-project/res/values/strings.xml
deleted file mode 100644 (file)
index 3a21cff..0000000
+++ /dev/null
@@ -1,9 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<resources>
-
-    <string name="app_name">oc_framework-test-project</string>
-    <string name="action_settings">Settings</string>
-    <string name="hello_world">Hello world!</string>
-    <string name="test_account_not_found">The test account %1$s could not be found in the device</string>
-
-</resources>
diff --git a/oc_framework-test-project/res/values/styles.xml b/oc_framework-test-project/res/values/styles.xml
deleted file mode 100644 (file)
index 6ce89c7..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-<resources>
-
-    <!--
-        Base application theme, dependent on API level. This theme is replaced
-        by AppBaseTheme from res/values-vXX/styles.xml on newer devices.
-    -->
-    <style name="AppBaseTheme" parent="android:Theme.Light">
-        <!--
-            Theme customizations available in newer API levels can go in
-            res/values-vXX/styles.xml, while customizations related to
-            backward-compatibility can go here.
-        -->
-    </style>
-
-    <!-- Application theme. -->
-    <style name="AppTheme" parent="AppBaseTheme">
-        <!-- All customizations that are NOT specific to a particular API-level can go here. -->
-    </style>
-
-</resources>
diff --git a/oc_framework-test-project/src/com/owncloud/android/oc_framework_test_project/TestActivity.java b/oc_framework-test-project/src/com/owncloud/android/oc_framework_test_project/TestActivity.java
deleted file mode 100644 (file)
index 2030a8f..0000000
+++ /dev/null
@@ -1,173 +0,0 @@
-/* ownCloud Android client application
- *   Copyright (C) 2012-2013 ownCloud Inc.
- *
- *   This program is free software: you can redistribute it and/or modify
- *   it under the terms of the GNU General Public License version 2,
- *   as published by the Free Software Foundation.
- *
- *   This program is distributed in the hope that it will be useful,
- *   but WITHOUT ANY WARRANTY; without even the implied warranty of
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *   GNU General Public License for more details.
- *
- *   You should have received a copy of the GNU General Public License
- *   along with this program.  If not, see <http://www.gnu.org/licenses/>.
- *
- */
-
-package com.owncloud.android.oc_framework_test_project;
-
-import java.io.File;
-
-import com.owncloud.android.oc_framework.network.webdav.OwnCloudClientFactory;
-import com.owncloud.android.oc_framework.network.webdav.WebdavClient;
-import com.owncloud.android.oc_framework.operations.RemoteFile;
-import com.owncloud.android.oc_framework.operations.RemoteOperationResult;
-import com.owncloud.android.oc_framework.operations.remote.ChunkedUploadRemoteFileOperation;
-import com.owncloud.android.oc_framework.operations.remote.CreateRemoteFolderOperation;
-import com.owncloud.android.oc_framework.operations.remote.DownloadRemoteFileOperation;
-import com.owncloud.android.oc_framework.operations.remote.ReadRemoteFolderOperation;
-import com.owncloud.android.oc_framework.operations.remote.RemoveRemoteFileOperation;
-import com.owncloud.android.oc_framework.operations.remote.RenameRemoteFileOperation;
-import com.owncloud.android.oc_framework.operations.remote.UploadRemoteFileOperation;
-
-import android.net.Uri;
-import android.os.Bundle;
-import android.os.Environment;
-import android.app.Activity;
-import android.view.Menu;
-
-/**
- * Activity to test OC framework
- * @author masensio
- * @author David A. Velasco
- */
-
-public class TestActivity extends Activity {
-       
-       // This account must exists on the simulator / device
-       private static final String mServerUri = "https://beta.owncloud.com/owncloud/remote.php/webdav";
-       private static final String mUser = "testandroid";
-       private static final String mPass = "testandroid";
-       private static final boolean mChunked = true;
-       
-       //private Account mAccount = null;
-       private WebdavClient mClient;
-       
-       @Override
-       protected void onCreate(Bundle savedInstanceState) {
-               super.onCreate(savedInstanceState);
-               setContentView(R.layout.activity_test);
-       Uri uri = Uri.parse(mServerUri);
-       mClient = OwnCloudClientFactory.createOwnCloudClient(uri ,getApplicationContext(), true);
-       mClient.setBasicCredentials(mUser, mPass);
-       }
-
-       @Override
-       public boolean onCreateOptionsMenu(Menu menu) {
-               // Inflate the menu; this adds items to the action bar if it is present.
-               getMenuInflater().inflate(R.menu.test, menu);
-               return true;
-       }
-
-       /**
-        * Access to the library method to Create a Folder
-        * @param remotePath            Full path to the new directory to create in the remote server.
-     * @param createFullPath        'True' means that all the ancestor folders should be created if don't exist yet.
-        * 
-        * @return
-        */
-       public RemoteOperationResult createFolder(String remotePath, boolean createFullPath) {
-               
-               CreateRemoteFolderOperation createOperation = new CreateRemoteFolderOperation(remotePath, createFullPath);
-               RemoteOperationResult result =  createOperation.execute(mClient);
-               
-               return result;
-       }
-       
-       /**
-        * Access to the library method to Rename a File or Folder
-        * @param oldName                       Old name of the file.
-     * @param oldRemotePath            Old remote path of the file. For folders it starts and ends by "/"
-     * @param newName                  New name to set as the name of file.
-     * @param isFolder                 'true' for folder and 'false' for files
-     * 
-     * @return
-     */
-
-       public RemoteOperationResult renameFile(String oldName, String oldRemotePath, String newName, boolean isFolder) {
-               
-               RenameRemoteFileOperation renameOperation = new RenameRemoteFileOperation(oldName, oldRemotePath, newName, isFolder);
-               RemoteOperationResult result = renameOperation.execute(mClient);
-               
-               return result;
-       }
-       
-       /** 
-        * Access to the library method to Remove a File or Folder
-        * 
-        * @param remotePath    Remote path of the file or folder in the server.
-        * @return
-        */
-       public RemoteOperationResult removeFile(String remotePath) {
-               
-               RemoveRemoteFileOperation removeOperation = new RemoveRemoteFileOperation(remotePath);
-               RemoteOperationResult result = removeOperation.execute(mClient);
-               
-               return result;
-       }
-       
-       /**
-        * Access to the library method to Read a Folder (PROPFIND DEPTH 1)
-        * @param remotePath
-        * 
-        * @return
-        */
-       public RemoteOperationResult readFile(String remotePath) {
-               
-               ReadRemoteFolderOperation readOperation= new ReadRemoteFolderOperation(remotePath);
-               RemoteOperationResult result = readOperation.execute(mClient);
-
-               return result;
-       }
-       
-       /**
-        * Access to the library method to Download a File
-        * @param remotePath
-        * 
-        * @return
-        */
-       public RemoteOperationResult downloadFile(RemoteFile remoteFile, String temporalFolder) {
-               // Create folder 
-               String path =  "/owncloud/tmp/" + temporalFolder;
-               File sdCard = Environment.getExternalStorageDirectory();
-               File folder = new File(sdCard.getAbsolutePath() + "/" + path);
-               folder.mkdirs();
-               
-               DownloadRemoteFileOperation downloadOperation = new DownloadRemoteFileOperation(remoteFile, folder.getAbsolutePath());
-               RemoteOperationResult result = downloadOperation.execute(mClient);
-
-               return result;
-       }
-       
-       /** Access to the library method to Upload a File 
-        * @param storagePath
-        * @param remotePath
-        * @param mimeType
-        * 
-        * @return
-        */
-       public RemoteOperationResult uploadFile(String storagePath, String remotePath, String mimeType) {
-
-               UploadRemoteFileOperation uploadOperation;
-               if ( mChunked && (new File(storagePath)).length() > ChunkedUploadRemoteFileOperation.CHUNK_SIZE ) {
-            uploadOperation = new ChunkedUploadRemoteFileOperation(storagePath, remotePath, mimeType);
-        } else {
-            uploadOperation = new UploadRemoteFileOperation(storagePath, remotePath, mimeType);
-        }
-               
-               RemoteOperationResult result = uploadOperation.execute(mClient);
-               
-               return result;
-       }
-}
diff --git a/oc_framework/.classpath b/oc_framework/.classpath
deleted file mode 100644 (file)
index 5176974..0000000
+++ /dev/null
@@ -1,9 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
-       <classpathentry kind="con" path="com.android.ide.eclipse.adt.ANDROID_FRAMEWORK"/>
-       <classpathentry exported="true" kind="con" path="com.android.ide.eclipse.adt.LIBRARIES"/>
-       <classpathentry exported="true" kind="con" path="com.android.ide.eclipse.adt.DEPENDENCIES"/>
-       <classpathentry kind="src" path="src"/>
-       <classpathentry kind="src" path="gen"/>
-       <classpathentry kind="output" path="bin/classes"/>
-</classpath>
diff --git a/oc_framework/.project b/oc_framework/.project
deleted file mode 100644 (file)
index 18812a0..0000000
+++ /dev/null
@@ -1,33 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
-       <name>oc_framework</name>
-       <comment></comment>
-       <projects>
-       </projects>
-       <buildSpec>
-               <buildCommand>
-                       <name>com.android.ide.eclipse.adt.ResourceManagerBuilder</name>
-                       <arguments>
-                       </arguments>
-               </buildCommand>
-               <buildCommand>
-                       <name>com.android.ide.eclipse.adt.PreCompilerBuilder</name>
-                       <arguments>
-                       </arguments>
-               </buildCommand>
-               <buildCommand>
-                       <name>org.eclipse.jdt.core.javabuilder</name>
-                       <arguments>
-                       </arguments>
-               </buildCommand>
-               <buildCommand>
-                       <name>com.android.ide.eclipse.adt.ApkBuilder</name>
-                       <arguments>
-                       </arguments>
-               </buildCommand>
-       </buildSpec>
-       <natures>
-               <nature>com.android.ide.eclipse.adt.AndroidNature</nature>
-               <nature>org.eclipse.jdt.core.javanature</nature>
-       </natures>
-</projectDescription>
diff --git a/oc_framework/.settings/org.eclipse.jdt.core.prefs b/oc_framework/.settings/org.eclipse.jdt.core.prefs
deleted file mode 100644 (file)
index b080d2d..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-eclipse.preferences.version=1
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
-org.eclipse.jdt.core.compiler.compliance=1.6
-org.eclipse.jdt.core.compiler.source=1.6
diff --git a/oc_framework/AndroidManifest.xml b/oc_framework/AndroidManifest.xml
deleted file mode 100644 (file)
index 836b4a0..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<manifest xmlns:android="http://schemas.android.com/apk/res/android"
-    package="com.owncloud.android.oc_framework"
-    android:versionCode="1"
-    android:versionName="1.0" >
-
-    <uses-sdk
-        android:minSdkVersion="8"
-        android:targetSdkVersion="19" />
-
-</manifest>
diff --git a/oc_framework/build.xml b/oc_framework/build.xml
deleted file mode 100644 (file)
index 6b112f4..0000000
+++ /dev/null
@@ -1,92 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<project name="ownCloudFramework" default="help">
-
-    <!-- The local.properties file is created and updated by the 'android' tool.
-         It contains the path to the SDK. It should *NOT* be checked into
-         Version Control Systems. -->
-    <property file="local.properties" />
-
-    <!-- The ant.properties file can be created by you. It is only edited by the
-         'android' tool to add properties to it.
-         This is the place to change some Ant specific build properties.
-         Here are some properties you may want to change/update:
-
-         source.dir
-             The name of the source directory. Default is 'src'.
-         out.dir
-             The name of the output directory. Default is 'bin'.
-
-         For other overridable properties, look at the beginning of the rules
-         files in the SDK, at tools/ant/build.xml
-
-         Properties related to the SDK location or the project target should
-         be updated using the 'android' tool with the 'update' action.
-
-         This file is an integral part of the build system for your
-         application and should be checked into Version Control Systems.
-
-         -->
-    <property file="ant.properties" />
-
-    <!-- if sdk.dir was not set from one of the property file, then
-         get it from the ANDROID_HOME env var.
-         This must be done before we load project.properties since
-         the proguard config can use sdk.dir -->
-    <property environment="env" />
-    <condition property="sdk.dir" value="${env.ANDROID_HOME}">
-        <isset property="env.ANDROID_HOME" />
-    </condition>
-
-    <!-- The project.properties file is created and updated by the 'android'
-         tool, as well as ADT.
-
-         This contains project specific properties such as project target, and library
-         dependencies. Lower level build properties are stored in ant.properties
-         (or in .classpath for Eclipse projects).
-
-         This file is an integral part of the build system for your
-         application and should be checked into Version Control Systems. -->
-    <loadproperties srcFile="project.properties" />
-
-    <!-- quick check on sdk.dir -->
-    <fail
-            message="sdk.dir is missing. Make sure to generate local.properties using 'android update project' or to inject it through the ANDROID_HOME environment variable."
-            unless="sdk.dir"
-    />
-
-    <!--
-        Import per project custom build rules if present at the root of the project.
-        This is the place to put custom intermediary targets such as:
-            -pre-build
-            -pre-compile
-            -post-compile (This is typically used for code obfuscation.
-                           Compiled code location: ${out.classes.absolute.dir}
-                           If this is not done in place, override ${out.dex.input.absolute.dir})
-            -post-package
-            -post-build
-            -pre-clean
-    -->
-    <import file="custom_rules.xml" optional="true" />
-
-    <!-- Import the actual build file.
-
-         To customize existing targets, there are two options:
-         - Customize only one target:
-             - copy/paste the target into this file, *before* the
-               <import> task.
-             - customize it to your needs.
-         - Customize the whole content of build.xml
-             - copy/paste the content of the rules files (minus the top node)
-               into this file, replacing the <import> task.
-             - customize to your needs.
-
-         ***********************
-         ****** IMPORTANT ******
-         ***********************
-         In all cases you must update the value of version-tag below to read 'custom' instead of an integer,
-         in order to avoid having your file be overridden by tools such as "android update project"
-    -->
-    <!-- version-tag: 1 -->
-    <import file="${sdk.dir}/tools/ant/build.xml" />
-
-</project>
diff --git a/oc_framework/libs/commons-httpclient-3.1.jar b/oc_framework/libs/commons-httpclient-3.1.jar
deleted file mode 100755 (executable)
index 7c59774..0000000
Binary files a/oc_framework/libs/commons-httpclient-3.1.jar and /dev/null differ
diff --git a/oc_framework/libs/jackrabbit-webdav-2.7.2.jar b/oc_framework/libs/jackrabbit-webdav-2.7.2.jar
deleted file mode 100755 (executable)
index 6ebfbf7..0000000
Binary files a/oc_framework/libs/jackrabbit-webdav-2.7.2.jar and /dev/null differ
diff --git a/oc_framework/libs/slf4j-api-1.7.5.jar b/oc_framework/libs/slf4j-api-1.7.5.jar
deleted file mode 100755 (executable)
index 8f004d3..0000000
Binary files a/oc_framework/libs/slf4j-api-1.7.5.jar and /dev/null differ
diff --git a/oc_framework/pom.xml b/oc_framework/pom.xml
deleted file mode 100755 (executable)
index e811ffd..0000000
+++ /dev/null
@@ -1,75 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
-
-    <modelVersion>4.0.0</modelVersion>
-    <groupId>com.owncloud.android</groupId>
-    <artifactId>oc_framework</artifactId>
-    <version>${owncloud.version}</version>
-    <packaging>jar</packaging>
-    <name>oc_framework for Owncloud Android</name>
-
-    <properties>
-        <owncloud.version>1.5.1-SNAPSHOT</owncloud.version>
-        <java-version>1.6</java-version>
-        <!-- Given by maven-android-sdk-deployer -->
-        <google.android-version>4.4_r1</google.android-version>
-        <!-- Usually the latest Android API -->
-        <google.android-api>19</google.android-api>
-    </properties>
-
-    <description>oc_framwork for Owncloud for Android</description>
-    
-    <dependencies>
-
-        <dependency>
-            <groupId>android</groupId>
-            <artifactId>android</artifactId>
-            <version>${google.android-version}</version>
-            <scope>provided</scope>
-        </dependency>
-
-        <dependency>
-            <groupId>org.apache.jackrabbit</groupId>
-            <artifactId>jackrabbit-webdav</artifactId>
-            <version>2.7.2</version>
-        </dependency>
-
-    </dependencies>
-
-    <build>
-        <finalName>${project.artifactId}</finalName>
-
-        <sourceDirectory>src</sourceDirectory>
-
-        <plugins>
-
-            <plugin>
-                <groupId>org.apache.maven.plugins</groupId>
-                <artifactId>maven-compiler-plugin</artifactId>
-                <version>3.0</version>
-                <configuration>
-                    <source>${java-version}</source>
-                    <target>${java-version}</target>
-                </configuration>
-            </plugin>
-
-            <plugin>
-                <groupId>com.jayway.maven.plugins.android.generation2</groupId>
-                <artifactId>android-maven-plugin</artifactId>
-                <version>3.8.0</version>
-                <configuration>
-                    <sdk>
-                        <path>${env.ANDROID_HOME}</path>
-                        <platform>${google.android-api}</platform>
-                    </sdk>
-                </configuration>
-                <extensions>true</extensions>
-            </plugin>
-
-        </plugins>
-
-    </build>
-
-</project>
-
diff --git a/oc_framework/project.properties b/oc_framework/project.properties
deleted file mode 100644 (file)
index 91d2b02..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-# This file is automatically generated by Android Tools.
-# Do not modify this file -- YOUR CHANGES WILL BE ERASED!
-#
-# This file must be checked in Version Control Systems.
-#
-# To customize properties used by the Ant build system edit
-# "ant.properties", and override values to adapt the script to your
-# project structure.
-#
-# To enable ProGuard to shrink and obfuscate your code, uncomment this (available properties: sdk.dir, user.home):
-#proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt
-
-# Project target.
-target=android-19
-android.library=true
diff --git a/oc_framework/res/values/empty.xml b/oc_framework/res/values/empty.xml
deleted file mode 100644 (file)
index 42eba3c..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<resources/>
diff --git a/oc_framework/src/com/owncloud/android/oc_framework/accounts/AccountTypeUtils.java b/oc_framework/src/com/owncloud/android/oc_framework/accounts/AccountTypeUtils.java
deleted file mode 100644 (file)
index 2c9db68..0000000
+++ /dev/null
@@ -1,43 +0,0 @@
-/* ownCloud Android client application
- *   Copyright (C) 2012  Bartek Przybylski
- *   Copyright (C) 2012-2013 ownCloud Inc.
- *
- *   This program is free software: you can redistribute it and/or modify
- *   it under the terms of the GNU General Public License version 2,
- *   as published by the Free Software Foundation.
- *
- *   This program is distributed in the hope that it will be useful,
- *   but WITHOUT ANY WARRANTY; without even the implied warranty of
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *   GNU General Public License for more details.
- *
- *   You should have received a copy of the GNU General Public License
- *   along with this program.  If not, see <http://www.gnu.org/licenses/>.
- *
- */
-
-package com.owncloud.android.oc_framework.accounts;
-
-/**
- * @author masensio
- * @author David A. Velasco
- */
-public class AccountTypeUtils {
-
-    public static String getAuthTokenTypePass(String accountType) {
-        return accountType + ".password";
-    }
-    
-    public static String getAuthTokenTypeAccessToken(String accountType) {
-        return accountType  + ".oauth2.access_token";
-    }
-    
-    public static String getAuthTokenTypeRefreshToken(String accountType) {
-        return accountType  + ".oauth2.refresh_token";
-    }
-    
-    public static String getAuthTokenTypeSamlSessionCookie(String accountType) {
-        return accountType  +  ".saml.web_sso.session_cookie";
-    }
-    
-}
diff --git a/oc_framework/src/com/owncloud/android/oc_framework/accounts/AccountUtils.java b/oc_framework/src/com/owncloud/android/oc_framework/accounts/AccountUtils.java
deleted file mode 100644 (file)
index 72946dc..0000000
+++ /dev/null
@@ -1,128 +0,0 @@
-/* ownCloud Android client application
- *   Copyright (C) 2012  Bartek Przybylski
- *   Copyright (C) 2012-2013 ownCloud Inc.
- *
- *   This program is free software: you can redistribute it and/or modify
- *   it under the terms of the GNU General Public License version 2,
- *   as published by the Free Software Foundation.
- *
- *   This program is distributed in the hope that it will be useful,
- *   but WITHOUT ANY WARRANTY; without even the implied warranty of
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *   GNU General Public License for more details.
- *
- *   You should have received a copy of the GNU General Public License
- *   along with this program.  If not, see <http://www.gnu.org/licenses/>.
- *
- */
-
-package com.owncloud.android.oc_framework.accounts;
-
-import com.owncloud.android.oc_framework.utils.OwnCloudVersion;
-
-import android.accounts.Account;
-import android.accounts.AccountManager;
-import android.accounts.AccountsException;
-import android.content.Context;
-
-public class AccountUtils {
-    public static final String WEBDAV_PATH_1_2 = "/webdav/owncloud.php";
-    public static final String WEBDAV_PATH_2_0 = "/files/webdav.php";
-    public static final String WEBDAV_PATH_4_0 = "/remote.php/webdav";
-    private static final String ODAV_PATH = "/remote.php/odav";
-    private static final String SAML_SSO_PATH = "/remote.php/webdav";
-    public static final String CARDDAV_PATH_2_0 = "/apps/contacts/carddav.php";
-    public static final String CARDDAV_PATH_4_0 = "/remote/carddav.php";
-    public static final String STATUS_PATH = "/status.php";
-
-    /**
-     * 
-     * @param version version of owncloud
-     * @return webdav path for given OC version, null if OC version unknown
-     */
-    public static String getWebdavPath(OwnCloudVersion version, boolean supportsOAuth, boolean supportsSamlSso) {
-        if (version != null) {
-            if (supportsOAuth) {
-                return ODAV_PATH;
-            }
-            if (supportsSamlSso) {
-                return SAML_SSO_PATH;
-            }
-            if (version.compareTo(OwnCloudVersion.owncloud_v4) >= 0)
-                return WEBDAV_PATH_4_0;
-            if (version.compareTo(OwnCloudVersion.owncloud_v3) >= 0
-                    || version.compareTo(OwnCloudVersion.owncloud_v2) >= 0)
-                return WEBDAV_PATH_2_0;
-            if (version.compareTo(OwnCloudVersion.owncloud_v1) >= 0)
-                return WEBDAV_PATH_1_2;
-        }
-        return null;
-    }
-    
-//    /**
-//     * Returns the proper URL path to access the WebDAV interface of an ownCloud server,
-//     * according to its version and the authorization method used.
-//     * 
-//     * @param   version         Version of ownCloud server.
-//     * @param   authTokenType   Authorization token type, matching some of the AUTH_TOKEN_TYPE_* constants in {@link AccountAuthenticator}. 
-//     * @return                  WebDAV path for given OC version and authorization method, null if OC version is unknown.
-//     */
-//    public static String getWebdavPath(OwnCloudVersion version, String authTokenType) {
-//        if (version != null) {
-//            if (MainApp.getAuthTokenTypeAccessToken().equals(authTokenType)) {
-//                return ODAV_PATH;
-//            }
-//            if (MainApp.getAuthTokenTypeSamlSessionCookie().equals(authTokenType)) {
-//                return SAML_SSO_PATH;
-//            }
-//            if (version.compareTo(OwnCloudVersion.owncloud_v4) >= 0)
-//                return WEBDAV_PATH_4_0;
-//            if (version.compareTo(OwnCloudVersion.owncloud_v3) >= 0
-//                    || version.compareTo(OwnCloudVersion.owncloud_v2) >= 0)
-//                return WEBDAV_PATH_2_0;
-//            if (version.compareTo(OwnCloudVersion.owncloud_v1) >= 0)
-//                return WEBDAV_PATH_1_2;
-//        }
-//        return null;
-//    }
-    
-    /**
-     * Constructs full url to host and webdav resource basing on host version
-     * @param context
-     * @param account
-     * @return url or null on failure
-     * @throws AccountNotFoundException     When 'account' is unknown for the AccountManager
-     */
-    public static String constructFullURLForAccount(Context context, Account account) throws AccountNotFoundException {
-        AccountManager ama = AccountManager.get(context);
-        String baseurl = ama.getUserData(account, OwnCloudAccount.Constants.KEY_OC_BASE_URL);
-        String strver  = ama.getUserData(account, OwnCloudAccount.Constants.KEY_OC_VERSION);
-        boolean supportsOAuth = (ama.getUserData(account, OwnCloudAccount.Constants.KEY_SUPPORTS_OAUTH2) != null);
-        boolean supportsSamlSso = (ama.getUserData(account, OwnCloudAccount.Constants.KEY_SUPPORTS_SAML_WEB_SSO) != null);
-        OwnCloudVersion ver = new OwnCloudVersion(strver);
-        String webdavpath = getWebdavPath(ver, supportsOAuth, supportsSamlSso);
-
-        if (baseurl == null || webdavpath == null) 
-            throw new AccountNotFoundException(account, "Account not found", null);
-        
-        return baseurl + webdavpath;
-    }
-    
-    
-    public static class AccountNotFoundException extends AccountsException {
-        
-               /** Generated - should be refreshed every time the class changes!! */
-               private static final long serialVersionUID = -1684392454798508693L;
-        
-        private Account mFailedAccount; 
-                
-        public AccountNotFoundException(Account failedAccount, String message, Throwable cause) {
-            super(message, cause);
-            mFailedAccount = failedAccount;
-        }
-        
-        public Account getFailedAccount() {
-            return mFailedAccount;
-        }
-    }
-}
diff --git a/oc_framework/src/com/owncloud/android/oc_framework/accounts/OwnCloudAccount.java b/oc_framework/src/com/owncloud/android/oc_framework/accounts/OwnCloudAccount.java
deleted file mode 100644 (file)
index 73fdb65..0000000
+++ /dev/null
@@ -1,105 +0,0 @@
-/* ownCloud Android client application
- *   Copyright (C) 2012-2013 ownCloud Inc.
- *
- *   This program is free software: you can redistribute it and/or modify
- *   it under the terms of the GNU General Public License version 2,
- *   as published by the Free Software Foundation.
- *
- *   This program is distributed in the hope that it will be useful,
- *   but WITHOUT ANY WARRANTY; without even the implied warranty of
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *   GNU General Public License for more details.
- *
- *   You should have received a copy of the GNU General Public License
- *   along with this program.  If not, see <http://www.gnu.org/licenses/>.
- *
- */
-
-package com.owncloud.android.oc_framework.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.oc_framework.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.oc_framework.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";
-       }
-       
-       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];
-        }
-    };
-       
-}
diff --git a/oc_framework/src/com/owncloud/android/oc_framework/network/AdvancedSslSocketFactory.java b/oc_framework/src/com/owncloud/android/oc_framework/network/AdvancedSslSocketFactory.java
deleted file mode 100644 (file)
index 775473a..0000000
+++ /dev/null
@@ -1,289 +0,0 @@
-/* ownCloud Android client application
- *   Copyright (C) 2012 Bartek Przybylski
- *   Copyright (C) 2012-2013 ownCloud Inc.
- *
- *   This program is free software: you can redistribute it and/or modify
- *   it under the terms of the GNU General Public License version 2,
- *   as published by the Free Software Foundation.
- *
- *   This program is distributed in the hope that it will be useful,
- *   but WITHOUT ANY WARRANTY; without even the implied warranty of
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *   GNU General Public License for more details.
- *
- *   You should have received a copy of the GNU General Public License
- *   along with this program.  If not, see <http://www.gnu.org/licenses/>.
- *
- */
-
-package com.owncloud.android.oc_framework.network;
-
-import java.io.IOException;
-import java.net.InetAddress;
-import java.net.InetSocketAddress;
-import java.net.Socket;
-import java.net.SocketAddress;
-import java.net.UnknownHostException;
-//import java.security.Provider;
-import java.security.cert.X509Certificate;
-//import java.util.Enumeration;
-
-import javax.net.SocketFactory;
-import javax.net.ssl.SSLContext;
-import javax.net.ssl.SSLException;
-import javax.net.ssl.SSLHandshakeException;
-//import javax.net.ssl.SSLParameters;
-import javax.net.ssl.SSLPeerUnverifiedException;
-import javax.net.ssl.SSLSession;
-import javax.net.ssl.SSLSocket;
-
-import org.apache.commons.httpclient.ConnectTimeoutException;
-import org.apache.commons.httpclient.params.HttpConnectionParams;
-import org.apache.commons.httpclient.protocol.ProtocolSocketFactory;
-import org.apache.http.conn.ssl.X509HostnameVerifier;
-
-//import android.os.Build;
-import android.util.Log;
-
-
-
-/**
- * AdvancedSSLProtocolSocketFactory allows to create SSL {@link Socket}s with 
- * a custom SSLContext and an optional Hostname Verifier.
- * 
- * @author David A. Velasco
- */
-
-public class AdvancedSslSocketFactory implements ProtocolSocketFactory {
-
-    private static final String TAG = AdvancedSslSocketFactory.class.getSimpleName();
-    
-    private SSLContext mSslContext = null;
-    private AdvancedX509TrustManager mTrustManager = null;
-    private X509HostnameVerifier mHostnameVerifier = null;
-
-    public SSLContext getSslContext() {
-        return mSslContext;
-    }
-    
-    /**
-     * Constructor for AdvancedSSLProtocolSocketFactory.
-     */
-    public AdvancedSslSocketFactory(SSLContext sslContext, AdvancedX509TrustManager trustManager, X509HostnameVerifier hostnameVerifier) {
-        if (sslContext == null)
-            throw new IllegalArgumentException("AdvancedSslSocketFactory can not be created with a null SSLContext");
-        if (trustManager == null)
-            throw new IllegalArgumentException("AdvancedSslSocketFactory can not be created with a null Trust Manager");
-        mSslContext = sslContext;
-        mTrustManager = trustManager;
-        mHostnameVerifier = hostnameVerifier;
-    }
-
-    /**
-     * @see ProtocolSocketFactory#createSocket(java.lang.String,int,java.net.InetAddress,int)
-     */
-    public Socket createSocket(String host, int port, InetAddress clientHost, int clientPort) throws IOException, UnknownHostException {
-        Socket socket = mSslContext.getSocketFactory().createSocket(host, port, clientHost, clientPort);
-        verifyPeerIdentity(host, port, socket);
-        return socket;
-    }
-
-    /*
-    private void logSslInfo() {
-       if (Build.VERSION.SDK_INT > Build.VERSION_CODES.FROYO) {
-               Log.v(TAG, "SUPPORTED SSL PARAMETERS");
-               logSslParameters(mSslContext.getSupportedSSLParameters());
-               Log.v(TAG, "DEFAULT SSL PARAMETERS");
-               logSslParameters(mSslContext.getDefaultSSLParameters());
-               Log.i(TAG, "CURRENT PARAMETERS");
-               Log.i(TAG, "Protocol: " + mSslContext.getProtocol());
-       }
-       Log.i(TAG, "PROVIDER");
-       logSecurityProvider(mSslContext.getProvider());
-       }
-    
-    private void logSecurityProvider(Provider provider) {
-       Log.i(TAG, "name: " + provider.getName());
-       Log.i(TAG, "version: " + provider.getVersion());
-       Log.i(TAG, "info: " + provider.getInfo());
-       Enumeration<?> keys = provider.propertyNames();
-       String key;
-       while (keys.hasMoreElements()) {
-               key = (String) keys.nextElement();
-               Log.i(TAG, "  property " + key + " : " + provider.getProperty(key));
-       }
-       }
-
-       private void logSslParameters(SSLParameters params) {
-       Log.v(TAG, "Cipher suites: ");
-       String [] elements = params.getCipherSuites();
-       for (int i=0; i<elements.length ; i++) {
-               Log.v(TAG, "  " + elements[i]);
-       }
-       Log.v(TAG, "Protocols: ");
-       elements = params.getProtocols();
-       for (int i=0; i<elements.length ; i++) {
-               Log.v(TAG, "  " + elements[i]);
-       }
-       }
-       */
-
-       /**
-     * Attempts to get a new socket connection to the given host within the
-     * given time limit.
-     * 
-     * @param host the host name/IP
-     * @param port the port on the host
-     * @param clientHost the local host name/IP to bind the socket to
-     * @param clientPort the port on the local machine
-     * @param params {@link HttpConnectionParams Http connection parameters}
-     * 
-     * @return Socket a new socket
-     * 
-     * @throws IOException if an I/O error occurs while creating the socket
-     * @throws UnknownHostException if the IP address of the host cannot be
-     *             determined
-     */
-    public Socket createSocket(final String host, final int port,
-            final InetAddress localAddress, final int localPort,
-            final HttpConnectionParams params) throws IOException,
-            UnknownHostException, ConnectTimeoutException {
-        Log.d(TAG, "Creating SSL Socket with remote " + host + ":" + port + ", local " + localAddress + ":" + localPort + ", params: " + params);
-        if (params == null) {
-            throw new IllegalArgumentException("Parameters may not be null");
-        } 
-        int timeout = params.getConnectionTimeout();
-        
-        //logSslInfo();
-        
-        SocketFactory socketfactory = mSslContext.getSocketFactory();
-        Log.d(TAG, " ... with connection timeout " + timeout + " and socket timeout " + params.getSoTimeout());
-        Socket socket = socketfactory.createSocket();
-        SocketAddress localaddr = new InetSocketAddress(localAddress, localPort);
-        SocketAddress remoteaddr = new InetSocketAddress(host, port);
-        socket.setSoTimeout(params.getSoTimeout());
-        socket.bind(localaddr);
-        ServerNameIndicator.setServerNameIndication(host, (SSLSocket)socket);
-        socket.connect(remoteaddr, timeout);
-        verifyPeerIdentity(host, port, socket);
-        return socket;
-    }
-
-       /**
-     * @see ProtocolSocketFactory#createSocket(java.lang.String,int)
-     */
-    public Socket createSocket(String host, int port) throws IOException,
-            UnknownHostException {
-       Log.d(TAG, "Creating SSL Socket with remote " + host + ":" + port);
-        Socket socket = mSslContext.getSocketFactory().createSocket(host, port);
-        verifyPeerIdentity(host, port, socket);
-        return socket; 
-    }
-
-    public boolean equals(Object obj) {
-        return ((obj != null) && obj.getClass().equals(
-                AdvancedSslSocketFactory.class));
-    }
-
-    public int hashCode() {
-        return AdvancedSslSocketFactory.class.hashCode();
-    }
-
-
-    public X509HostnameVerifier getHostNameVerifier() {
-        return mHostnameVerifier;
-    }
-    
-    
-    public void setHostNameVerifier(X509HostnameVerifier hostnameVerifier) {
-        mHostnameVerifier = hostnameVerifier;
-    }
-    
-    /**
-     * Verifies the identity of the server. 
-     * 
-     * The server certificate is verified first.
-     * 
-     * Then, the host name is compared with the content of the server certificate using the current host name verifier, if any.
-     * @param socket
-     */
-    private void verifyPeerIdentity(String host, int port, Socket socket) throws IOException {
-        try {
-            CertificateCombinedException failInHandshake = null;
-            /// 1. VERIFY THE SERVER CERTIFICATE through the registered TrustManager (that should be an instance of AdvancedX509TrustManager) 
-            try {
-                SSLSocket sock = (SSLSocket) socket;    // a new SSLSession instance is created as a "side effect" 
-                sock.startHandshake();
-                
-            } catch (RuntimeException e) {
-                
-                if (e instanceof CertificateCombinedException) {
-                    failInHandshake = (CertificateCombinedException) e;
-                } else {
-                    Throwable cause = e.getCause();
-                    Throwable previousCause = null;
-                    while (cause != null && cause != previousCause && !(cause instanceof CertificateCombinedException)) {
-                        previousCause = cause;
-                        cause = cause.getCause();
-                    }
-                    if (cause != null && cause instanceof CertificateCombinedException) {
-                        failInHandshake = (CertificateCombinedException)cause;
-                    }
-                }
-                if (failInHandshake == null) {
-                    throw e;
-                }
-                failInHandshake.setHostInUrl(host);
-                
-            }
-            
-            /// 2. VERIFY HOSTNAME
-            SSLSession newSession = null;
-            boolean verifiedHostname = true;
-            if (mHostnameVerifier != null) {
-                if (failInHandshake != null) {
-                    /// 2.1 : a new SSLSession instance was NOT created in the handshake
-                    X509Certificate serverCert = failInHandshake.getServerCertificate();
-                    try {
-                        mHostnameVerifier.verify(host, serverCert);
-                    } catch (SSLException e) {
-                        verifiedHostname = false;
-                    }
-                
-                } else {
-                    /// 2.2 : a new SSLSession instance was created in the handshake
-                    newSession = ((SSLSocket)socket).getSession();
-                    if (!mTrustManager.isKnownServer((X509Certificate)(newSession.getPeerCertificates()[0]))) {
-                        verifiedHostname = mHostnameVerifier.verify(host, newSession); 
-                    }
-                }
-            }
-
-            /// 3. Combine the exceptions to throw, if any
-            if (!verifiedHostname) {
-                SSLPeerUnverifiedException pue = new SSLPeerUnverifiedException("Names in the server certificate do not match to " + host + " in the URL");
-                if (failInHandshake == null) {
-                    failInHandshake = new CertificateCombinedException((X509Certificate) newSession.getPeerCertificates()[0]);
-                    failInHandshake.setHostInUrl(host);
-                }
-                failInHandshake.setSslPeerUnverifiedException(pue);
-                pue.initCause(failInHandshake);
-                throw pue;
-                
-            } else if (failInHandshake != null) {
-                SSLHandshakeException hse = new SSLHandshakeException("Server certificate could not be verified");
-                hse.initCause(failInHandshake);
-                throw hse;
-            }
-            
-        } catch (IOException io) {        
-            try {
-                socket.close();
-            } catch (Exception x) {
-                // NOTHING - irrelevant exception for the caller 
-            }
-            throw io;
-        }
-    }
-    
-}
diff --git a/oc_framework/src/com/owncloud/android/oc_framework/network/AdvancedX509TrustManager.java b/oc_framework/src/com/owncloud/android/oc_framework/network/AdvancedX509TrustManager.java
deleted file mode 100644 (file)
index 4bad3ef..0000000
+++ /dev/null
@@ -1,148 +0,0 @@
-/* ownCloud Android client application
- *   Copyright (C) 2012-2013 ownCloud Inc.
- *
- *   This program is free software: you can redistribute it and/or modify
- *   it under the terms of the GNU General Public License version 2,
- *   as published by the Free Software Foundation.
- *
- *   This program is distributed in the hope that it will be useful,
- *   but WITHOUT ANY WARRANTY; without even the implied warranty of
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *   GNU General Public License for more details.
- *
- *   You should have received a copy of the GNU General Public License
- *   along with this program.  If not, see <http://www.gnu.org/licenses/>.
- *
- */
-
-package com.owncloud.android.oc_framework.network;
-
-import java.security.KeyStore;
-import java.security.KeyStoreException;
-import java.security.NoSuchAlgorithmException;
-import java.security.cert.CertPathValidatorException;
-import java.security.cert.CertStoreException;
-import java.security.cert.CertificateException;
-import java.security.cert.CertificateExpiredException;
-import java.security.cert.CertificateNotYetValidException;
-import java.security.cert.X509Certificate;
-
-import javax.net.ssl.TrustManager;
-import javax.net.ssl.TrustManagerFactory;
-import javax.net.ssl.X509TrustManager;
-
-import android.util.Log;
-
-
-
-/**
- * @author David A. Velasco
- */
-public class AdvancedX509TrustManager implements X509TrustManager {
-    
-    private static final String TAG = AdvancedX509TrustManager.class.getSimpleName();
-
-    private X509TrustManager mStandardTrustManager = null;
-    private KeyStore mKnownServersKeyStore;
-
-    /**
-     * Constructor for AdvancedX509TrustManager
-     * 
-     * @param  knownServersCertStore    Local certificates store with server certificates explicitly trusted by the user.
-     * @throws CertStoreException       When no default X509TrustManager instance was found in the system.
-     */
-    public AdvancedX509TrustManager(KeyStore knownServersKeyStore)
-            throws NoSuchAlgorithmException, KeyStoreException, CertStoreException {
-        super();
-        TrustManagerFactory factory = TrustManagerFactory
-                .getInstance(TrustManagerFactory.getDefaultAlgorithm());
-        factory.init((KeyStore)null);
-        mStandardTrustManager = findX509TrustManager(factory);
-
-        mKnownServersKeyStore = knownServersKeyStore;
-    }
-    
-    
-    /**
-     * Locates the first X509TrustManager provided by a given TrustManagerFactory
-     * @param factory               TrustManagerFactory to inspect in the search for a X509TrustManager
-     * @return                      The first X509TrustManager found in factory.
-     * @throws CertStoreException   When no X509TrustManager instance was found in factory
-     */
-    private X509TrustManager findX509TrustManager(TrustManagerFactory factory) throws CertStoreException {
-        TrustManager tms[] = factory.getTrustManagers();
-        for (int i = 0; i < tms.length; i++) {
-            if (tms[i] instanceof X509TrustManager) {
-                return (X509TrustManager) tms[i];
-            }
-        }
-        return null;
-    }
-    
-
-    /**
-     * @see javax.net.ssl.X509TrustManager#checkClientTrusted(X509Certificate[],
-     *      String authType)
-     */
-    public void checkClientTrusted(X509Certificate[] certificates, String authType) throws CertificateException {
-        mStandardTrustManager.checkClientTrusted(certificates, authType);
-    }
-
-    
-    /**
-     * @see javax.net.ssl.X509TrustManager#checkServerTrusted(X509Certificate[],
-     *      String authType)
-     */
-    public void checkServerTrusted(X509Certificate[] certificates, String authType) throws CertificateException {
-        if (!isKnownServer(certificates[0])) {
-               CertificateCombinedException result = new CertificateCombinedException(certificates[0]);
-               try {
-                       certificates[0].checkValidity();
-               } catch (CertificateExpiredException c) {
-                       result.setCertificateExpiredException(c);
-                       
-               } catch (CertificateNotYetValidException c) {
-                result.setCertificateNotYetException(c);
-               }
-               
-               try {
-                   mStandardTrustManager.checkServerTrusted(certificates, authType);
-               } catch (CertificateException c) {
-                Throwable cause = c.getCause();
-                Throwable previousCause = null;
-                while (cause != null && cause != previousCause && !(cause instanceof CertPathValidatorException)) {     // getCause() is not funny
-                    previousCause = cause;
-                    cause = cause.getCause();
-                }
-                if (cause != null && cause instanceof CertPathValidatorException) {
-                       result.setCertPathValidatorException((CertPathValidatorException)cause);
-                } else {
-                       result.setOtherCertificateException(c);
-                }
-               }
-               
-               if (result.isException())
-                       throw result;
-
-        }
-    }
-    
-    
-    /**
-     * @see javax.net.ssl.X509TrustManager#getAcceptedIssuers()
-     */
-    public X509Certificate[] getAcceptedIssuers() {
-        return mStandardTrustManager.getAcceptedIssuers();
-    }
-
-    
-    public boolean isKnownServer(X509Certificate cert) {
-        try {
-            return (mKnownServersKeyStore.getCertificateAlias(cert) != null);
-        } catch (KeyStoreException e) {
-            Log.d(TAG, "Fail while checking certificate in the known-servers store");
-            return false;
-        }
-    }
-    
-}
\ No newline at end of file
diff --git a/oc_framework/src/com/owncloud/android/oc_framework/network/BearerAuthScheme.java b/oc_framework/src/com/owncloud/android/oc_framework/network/BearerAuthScheme.java
deleted file mode 100644 (file)
index 7d9df09..0000000
+++ /dev/null
@@ -1,272 +0,0 @@
-/* ownCloud Android client application
- *   Copyright (C) 2012  ownCloud Inc.
- *
- *   This program is free software: you can redistribute it and/or modify
- *   it under the terms of the GNU General Public License version 2,
- *   as published by the Free Software Foundation.
- *
- *   This program is distributed in the hope that it will be useful,
- *   but WITHOUT ANY WARRANTY; without even the implied warranty of
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *   GNU General Public License for more details.
- *
- *   You should have received a copy of the GNU General Public License
- *   along with this program.  If not, see <http://www.gnu.org/licenses/>.
- *
- */
-
-
-package com.owncloud.android.oc_framework.network;
-
-import java.util.Map;
-
-import org.apache.commons.httpclient.Credentials;
-import org.apache.commons.httpclient.HttpMethod;
-import org.apache.commons.httpclient.auth.AuthChallengeParser;
-import org.apache.commons.httpclient.auth.AuthScheme;
-import org.apache.commons.httpclient.auth.AuthenticationException;
-import org.apache.commons.httpclient.auth.InvalidCredentialsException;
-import org.apache.commons.httpclient.auth.MalformedChallengeException;
-
-import android.util.Log;
-
-
-
-/**
- * Bearer authentication scheme as defined in RFC 6750.
- * 
- * @author David A. Velasco
- */
-
-public class BearerAuthScheme implements AuthScheme /*extends RFC2617Scheme*/ {
-    
-    private static final String TAG = BearerAuthScheme.class.getSimpleName();
-
-    public static final String AUTH_POLICY = "Bearer";
-    
-    /** Whether the bearer authentication process is complete */
-    private boolean mComplete;
-    
-    /** Authentication parameter map */
-    @SuppressWarnings("rawtypes")
-       private Map mParams = null;
-    
-    
-    /**
-     * Default constructor for the bearer authentication scheme.
-     */
-    public BearerAuthScheme() {
-        mComplete = false;
-    }
-
-    /**
-     * Constructor for the basic authentication scheme.
-     * 
-     * @param   challenge                       Authentication challenge
-     * 
-     * @throws  MalformedChallengeException     Thrown if the authentication challenge is malformed
-     * 
-     * @deprecated Use parameterless constructor and {@link AuthScheme#processChallenge(String)} method
-     */
-    public BearerAuthScheme(final String challenge) throws MalformedChallengeException {
-        processChallenge(challenge);
-        mComplete = true;
-    }
-
-    /**
-     * Returns textual designation of the bearer authentication scheme.
-     * 
-     * @return "Bearer"
-     */
-    public String getSchemeName() {
-        return "bearer";
-    }
-
-    /**
-     * Processes the Bearer challenge.
-     *  
-     * @param   challenge                   The challenge string
-     * 
-     * @throws MalformedChallengeException  Thrown if the authentication challenge is malformed
-     */
-    public void processChallenge(String challenge) throws MalformedChallengeException {
-        String s = AuthChallengeParser.extractScheme(challenge);
-        if (!s.equalsIgnoreCase(getSchemeName())) {
-            throw new MalformedChallengeException(
-              "Invalid " + getSchemeName() + " challenge: " + challenge); 
-        }
-        mParams = AuthChallengeParser.extractParams(challenge);
-        mComplete = true;
-    }
-
-    /**
-     * Tests if the Bearer authentication process has been completed.
-     * 
-     * @return 'true' if Bearer authorization has been processed, 'false' otherwise.
-     */
-    public boolean isComplete() {
-        return this.mComplete;
-    }
-
-    /**
-     * Produces bearer authorization string for the given set of 
-     * {@link Credentials}.
-     * 
-     * @param   credentials                     The set of credentials to be used for authentication
-     * @param   method                          Method name is ignored by the bearer authentication scheme
-     * @param   uri                             URI is ignored by the bearer authentication scheme
-     * @throws  InvalidCredentialsException     If authentication credentials are not valid or not applicable 
-     *                                          for this authentication scheme
-     * @throws  AuthenticationException         If authorization string cannot be generated due to an authentication failure
-     * @return  A bearer authorization string
-     * 
-     * @deprecated Use {@link #authenticate(Credentials, HttpMethod)}
-     */
-    public String authenticate(Credentials credentials, String method, String uri) throws AuthenticationException {
-        Log.d(TAG, "enter BearerScheme.authenticate(Credentials, String, String)");
-
-        BearerCredentials bearer = null;
-        try {
-            bearer = (BearerCredentials) credentials;
-        } catch (ClassCastException e) {
-            throw new InvalidCredentialsException(
-             "Credentials cannot be used for bearer authentication: " 
-              + credentials.getClass().getName());
-        }
-        return BearerAuthScheme.authenticate(bearer);
-    }
-
-    
-    /**
-     * Returns 'false'. Bearer authentication scheme is request based.
-     * 
-     * @return 'false'.
-     */
-    public boolean isConnectionBased() {
-        return false;    
-    }
-
-    /**
-     * Produces bearer authorization string for the given set of {@link Credentials}.
-     * 
-     * @param   credentials                     The set of credentials to be used for authentication
-     * @param   method                          The method being authenticated
-     * @throws  InvalidCredentialsException     If authentication credentials are not valid or not applicable for this authentication 
-     *                                          scheme.
-     * @throws AuthenticationException         If authorization string cannot be generated due to an authentication failure.
-     * 
-     * @return a basic authorization string
-     */
-    public String authenticate(Credentials credentials, HttpMethod method) throws AuthenticationException {
-        Log.d(TAG, "enter BearerScheme.authenticate(Credentials, HttpMethod)");
-
-        if (method == null) {
-            throw new IllegalArgumentException("Method may not be null");
-        }
-        BearerCredentials bearer = null;
-        try {
-            bearer = (BearerCredentials) credentials;
-        } catch (ClassCastException e) {
-            throw new InvalidCredentialsException(
-                    "Credentials cannot be used for bearer authentication: " 
-                    + credentials.getClass().getName());
-        }
-        return BearerAuthScheme.authenticate(
-            bearer, 
-            method.getParams().getCredentialCharset());
-    }
-    
-    /**
-     * @deprecated Use {@link #authenticate(BearerCredentials, String)}
-     * 
-     * Returns a bearer Authorization header value for the given 
-     * {@link BearerCredentials}.
-     * 
-     * @param   credentials     The credentials to encode.
-     * 
-     * @return                  A bearer authorization string
-     */
-    public static String authenticate(BearerCredentials credentials) {
-        return authenticate(credentials, "ISO-8859-1");
-    }
-
-    /**
-     * Returns a bearer Authorization header value for the given 
-     * {@link BearerCredentials} and charset.
-     * 
-     * @param   credentials         The credentials to encode.
-     * @param   charset             The charset to use for encoding the credentials
-     * 
-     * @return                      A bearer authorization string
-     * 
-     * @since 3.0
-     */
-    public static String authenticate(BearerCredentials credentials, String charset) {
-        Log.d(TAG, "enter BearerAuthScheme.authenticate(BearerCredentials, String)");
-
-        if (credentials == null) {
-            throw new IllegalArgumentException("Credentials may not be null"); 
-        }
-        if (charset == null || charset.length() == 0) {
-            throw new IllegalArgumentException("charset may not be null or empty");
-        }
-        StringBuffer buffer = new StringBuffer();
-        buffer.append(credentials.getAccessToken());
-        
-        //return "Bearer " + EncodingUtil.getAsciiString(EncodingUtil.getBytes(buffer.toString(), charset));
-        return "Bearer " + buffer.toString();
-    }
-
-    /**
-     * Returns a String identifying the authentication challenge.  This is
-     * used, in combination with the host and port to determine if
-     * authorization has already been attempted or not.  Schemes which
-     * require multiple requests to complete the authentication should
-     * return a different value for each stage in the request.
-     * 
-     * Additionally, the ID should take into account any changes to the
-     * authentication challenge and return a different value when appropriate.
-     * For example when the realm changes in basic authentication it should be
-     * considered a different authentication attempt and a different value should
-     * be returned.
-     * 
-     * This method simply returns the realm for the challenge.
-     * 
-     * @return String       a String identifying the authentication challenge.
-     * 
-     * @deprecated no longer used
-     */
-    @Override
-    public String getID() {
-        return getRealm();
-    }
-
-    /**
-     * Returns authentication parameter with the given name, if available.
-     * 
-     * @param   name    The name of the parameter to be returned
-     * 
-     * @return          The parameter with the given name
-     */
-    @Override
-    public String getParameter(String name) {
-        if (name == null) {
-            throw new IllegalArgumentException("Parameter name may not be null"); 
-        }
-        if (mParams == null) {
-            return null;
-        }
-        return (String) mParams.get(name.toLowerCase());
-    }
-
-    /**
-     * Returns authentication realm. The realm may not be null.
-     * 
-     * @return  The authentication realm
-     */
-    @Override
-    public String getRealm() {
-        return getParameter("realm");
-    }
-    
-}
diff --git a/oc_framework/src/com/owncloud/android/oc_framework/network/BearerCredentials.java b/oc_framework/src/com/owncloud/android/oc_framework/network/BearerCredentials.java
deleted file mode 100644 (file)
index 5b18e62..0000000
+++ /dev/null
@@ -1,98 +0,0 @@
-package com.owncloud.android.oc_framework.network;
-/* ownCloud Android client application
- *   Copyright (C) 2012  ownCloud Inc.
- *
- *   This program is free software: you can redistribute it and/or modify
- *   it under the terms of the GNU General Public License version 2,
- *   as published by the Free Software Foundation.
- *
- *   This program is distributed in the hope that it will be useful,
- *   but WITHOUT ANY WARRANTY; without even the implied warranty of
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *   GNU General Public License for more details.
- *
- *   You should have received a copy of the GNU General Public License
- *   along with this program.  If not, see <http://www.gnu.org/licenses/>.
- *
- */
-
-
-
-import org.apache.commons.httpclient.Credentials;
-import org.apache.commons.httpclient.util.LangUtils;
-
-/**
- * Bearer token {@link Credentials}
- *
- * @author David A. Velasco
- */
-public class BearerCredentials implements Credentials {
-
-    
-    private String mAccessToken;
-    
-    
-    /**
-     * The constructor with the bearer token
-     *
-     * @param token     The bearer token
-     */
-    public BearerCredentials(String token) {
-        /*if (token == null) {
-            throw new IllegalArgumentException("Bearer token may not be null");            
-        }*/
-        mAccessToken = (token == null) ? "" : token;
-    }
-
-
-    /**
-     * Returns the access token
-     *
-     * @return      The access token
-     */
-    public String getAccessToken() {
-        return mAccessToken;
-    }
-
-
-    /**
-     * Get this object string.
-     *
-     * @return  The access token
-     */
-    public String toString() {
-        return mAccessToken;
-    }
-
-    /**
-     * Does a hash of the access token.
-     *
-     * @return The hash code of the access token
-     */
-    public int hashCode() {
-        int hash = LangUtils.HASH_SEED;
-        hash = LangUtils.hashCode(hash, mAccessToken);
-        return hash;
-    }
-
-    /**
-     * These credentials are assumed equal if accessToken is the same.
-     *
-     * @param   o   The other object to compare with.
-     *
-     * @return      'True' if the object is equivalent.
-     */
-    public boolean equals(Object o) {
-        if (o == null) return false;
-        if (this == o) return true;
-        if (this.getClass().equals(o.getClass())) {
-            BearerCredentials that = (BearerCredentials) o;
-            if (LangUtils.equals(mAccessToken, that.mAccessToken)) {
-                return true;
-            }
-        }
-        return false;
-    }
-
-}
-
diff --git a/oc_framework/src/com/owncloud/android/oc_framework/network/CertificateCombinedException.java b/oc_framework/src/com/owncloud/android/oc_framework/network/CertificateCombinedException.java
deleted file mode 100644 (file)
index 1b262bc..0000000
+++ /dev/null
@@ -1,131 +0,0 @@
-package com.owncloud.android.oc_framework.network;
-/* ownCloud Android client application
- *   Copyright (C) 2012-2013 ownCloud Inc.
- *
- *   This program is free software: you can redistribute it and/or modify
- *   it under the terms of the GNU General Public License version 2,
- *   as published by the Free Software Foundation.
- *
- *   This program is distributed in the hope that it will be useful,
- *   but WITHOUT ANY WARRANTY; without even the implied warranty of
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *   GNU General Public License for more details.
- *
- *   You should have received a copy of the GNU General Public License
- *   along with this program.  If not, see <http://www.gnu.org/licenses/>.
- *
- */
-
-
-
-import java.security.cert.CertPathValidatorException;
-import java.security.cert.CertificateException;
-import java.security.cert.CertificateExpiredException;
-import java.security.cert.CertificateNotYetValidException;
-import java.security.cert.X509Certificate;
-
-import javax.net.ssl.SSLPeerUnverifiedException;
-
-/**
- * Exception joining all the problems that {@link AdvancedX509TrustManager} can find in
- * a certificate chain for a server.
- * 
- * This was initially created as an extension of CertificateException, but some
- * implementations of the SSL socket layer in existing devices are REPLACING the CertificateException
- * instances thrown by {@link javax.net.ssl.X509TrustManager#checkServerTrusted(X509Certificate[], String)}
- * with SSLPeerUnverifiedException FORGETTING THE CAUSING EXCEPTION instead of wrapping it. 
- * 
- * Due to this, extending RuntimeException is necessary to get that the CertificateCombinedException 
- * instance reaches {@link AdvancedSslSocketFactory#verifyPeerIdentity}.
- * 
- * BE CAREFUL. As a RuntimeException extensions, Java compilers do not require to handle it
- * in client methods. Be sure to use it only when you know exactly where it will go.
- * 
- * @author David A. Velasco
- */
-public class CertificateCombinedException extends RuntimeException {
-
-    /** Generated - to refresh every time the class changes */
-    private static final long serialVersionUID = -8875782030758554999L;
-    
-    private X509Certificate mServerCert = null;
-    private String mHostInUrl;
-
-    private CertificateExpiredException mCertificateExpiredException = null;
-    private CertificateNotYetValidException mCertificateNotYetValidException = null;
-    private CertPathValidatorException mCertPathValidatorException = null;
-    private CertificateException mOtherCertificateException = null;
-    private SSLPeerUnverifiedException mSslPeerUnverifiedException = null;
-    
-    public CertificateCombinedException(X509Certificate x509Certificate) {
-        mServerCert = x509Certificate;
-    }
-
-    public X509Certificate getServerCertificate() {
-        return mServerCert;
-    }
-
-    public String getHostInUrl() {
-        return mHostInUrl;
-    }
-
-    public void setHostInUrl(String host) {
-        mHostInUrl = host;
-    }
-
-    public CertificateExpiredException getCertificateExpiredException() {
-        return mCertificateExpiredException;
-    }
-
-    public void setCertificateExpiredException(CertificateExpiredException c) {
-        mCertificateExpiredException  = c;
-    }
-
-    public CertificateNotYetValidException getCertificateNotYetValidException() {
-        return mCertificateNotYetValidException;
-    }
-
-    public void setCertificateNotYetException(CertificateNotYetValidException c) {
-        mCertificateNotYetValidException = c;
-    }
-
-    public CertPathValidatorException getCertPathValidatorException() {
-        return mCertPathValidatorException;
-    }
-
-    public void setCertPathValidatorException(CertPathValidatorException c) {
-        mCertPathValidatorException = c;
-    }
-
-    public CertificateException getOtherCertificateException() {
-        return mOtherCertificateException;
-    }
-
-    public void setOtherCertificateException(CertificateException c) {
-        mOtherCertificateException = c;
-    }
-
-    public SSLPeerUnverifiedException getSslPeerUnverifiedException() {
-        return mSslPeerUnverifiedException ; 
-    }
-
-    public void setSslPeerUnverifiedException(SSLPeerUnverifiedException s) {
-        mSslPeerUnverifiedException = s;
-    }
-
-    public boolean isException() {
-        return (mCertificateExpiredException != null ||
-                mCertificateNotYetValidException != null ||
-                mCertPathValidatorException != null ||
-                mOtherCertificateException != null ||
-                mSslPeerUnverifiedException != null);
-    }
-
-    public boolean isRecoverable() {
-        return (mCertificateExpiredException != null ||
-                mCertificateNotYetValidException != null ||
-                mCertPathValidatorException != null ||
-                mSslPeerUnverifiedException != null);
-    }
-
-}
diff --git a/oc_framework/src/com/owncloud/android/oc_framework/network/NetworkUtils.java b/oc_framework/src/com/owncloud/android/oc_framework/network/NetworkUtils.java
deleted file mode 100644 (file)
index ac2e015..0000000
+++ /dev/null
@@ -1,168 +0,0 @@
-/* ownCloud Android client application
- *   Copyright (C) 2012-2013 ownCloud Inc.
- *
- *   This program is free software: you can redistribute it and/or modify
- *   it under the terms of the GNU General Public License version 2,
- *   as published by the Free Software Foundation.
- *
- *   This program is distributed in the hope that it will be useful,
- *   but WITHOUT ANY WARRANTY; without even the implied warranty of
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *   GNU General Public License for more details.
- *
- *   You should have received a copy of the GNU General Public License
- *   along with this program.  If not, see <http://www.gnu.org/licenses/>.
- *
- */
-package com.owncloud.android.oc_framework.network;
-
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.security.GeneralSecurityException;
-import java.security.KeyStore;
-import java.security.KeyStoreException;
-import java.security.NoSuchAlgorithmException;
-import java.security.cert.Certificate;
-import java.security.cert.CertificateException;
-
-import javax.net.ssl.SSLContext;
-import javax.net.ssl.TrustManager;
-
-import org.apache.commons.httpclient.MultiThreadedHttpConnectionManager;
-import org.apache.commons.httpclient.protocol.Protocol;
-import org.apache.http.conn.ssl.BrowserCompatHostnameVerifier;
-import org.apache.http.conn.ssl.X509HostnameVerifier;
-
-import android.content.Context;
-import android.util.Log;
-
-public class NetworkUtils {
-    
-    final private static String TAG = NetworkUtils.class.getSimpleName();
-    
-    /** Default timeout for waiting data from the server */
-    public static final int DEFAULT_DATA_TIMEOUT = 60000;
-    
-    /** Default timeout for establishing a connection */
-    public static final int DEFAULT_CONNECTION_TIMEOUT = 60000;
-
-    /** Connection manager for all the WebdavClients */
-    private static MultiThreadedHttpConnectionManager mConnManager = null;
-    
-    private static Protocol mDefaultHttpsProtocol = null;
-
-    private static AdvancedSslSocketFactory mAdvancedSslSocketFactory = null;
-
-    private static X509HostnameVerifier mHostnameVerifier = null;
-    
-    
-    /**
-     * Registers or unregisters the proper components for advanced SSL handling.
-     * @throws IOException 
-     */
-    public static void registerAdvancedSslContext(boolean register, Context context) throws GeneralSecurityException, IOException {
-        Protocol pr = null;
-        try {
-            pr = Protocol.getProtocol("https");
-            if (pr != null && mDefaultHttpsProtocol == null) {
-                mDefaultHttpsProtocol = pr;
-            }
-        } catch (IllegalStateException e) {
-            // nothing to do here; really
-        }
-        boolean isRegistered = (pr != null && pr.getSocketFactory() instanceof AdvancedSslSocketFactory);
-        if (register && !isRegistered) {
-            Protocol.registerProtocol("https", new Protocol("https", getAdvancedSslSocketFactory(context), 443));
-            
-        } else if (!register && isRegistered) {
-            if (mDefaultHttpsProtocol != null) {
-                Protocol.registerProtocol("https", mDefaultHttpsProtocol);
-            }
-        }
-    }
-    
-    public static AdvancedSslSocketFactory getAdvancedSslSocketFactory(Context context) throws GeneralSecurityException, IOException {
-        if (mAdvancedSslSocketFactory  == null) {
-            KeyStore trustStore = getKnownServersStore(context);
-            AdvancedX509TrustManager trustMgr = new AdvancedX509TrustManager(trustStore);
-            TrustManager[] tms = new TrustManager[] { trustMgr };
-                
-            SSLContext sslContext = SSLContext.getInstance("TLS");
-            sslContext.init(null, tms, null);
-                    
-            mHostnameVerifier = new BrowserCompatHostnameVerifier();
-            mAdvancedSslSocketFactory = new AdvancedSslSocketFactory(sslContext, trustMgr, mHostnameVerifier);
-        }
-        return mAdvancedSslSocketFactory;
-    }
-
-
-    private static String LOCAL_TRUSTSTORE_FILENAME = "knownServers.bks";
-    
-    private static String LOCAL_TRUSTSTORE_PASSWORD = "password";
-
-    private static KeyStore mKnownServersStore = null;
-    
-    /**
-     * Returns the local store of reliable server certificates, explicitly accepted by the user.
-     * 
-     * Returns a KeyStore instance with empty content if the local store was never created.
-     * 
-     * Loads the store from the storage environment if needed.
-     * 
-     * @param context                       Android context where the operation is being performed.
-     * @return                              KeyStore instance with explicitly-accepted server certificates. 
-     * @throws KeyStoreException            When the KeyStore instance could not be created.
-     * @throws IOException                  When an existing local trust store could not be loaded.
-     * @throws NoSuchAlgorithmException     When the existing local trust store was saved with an unsupported algorithm.
-     * @throws CertificateException         When an exception occurred while loading the certificates from the local trust store.
-     */
-    private static KeyStore getKnownServersStore(Context context) throws KeyStoreException, IOException, NoSuchAlgorithmException, CertificateException {
-        if (mKnownServersStore == null) {
-            //mKnownServersStore = KeyStore.getInstance("BKS");
-            mKnownServersStore = KeyStore.getInstance(KeyStore.getDefaultType());
-            File localTrustStoreFile = new File(context.getFilesDir(), LOCAL_TRUSTSTORE_FILENAME);
-            Log.d(TAG, "Searching known-servers store at " + localTrustStoreFile.getAbsolutePath());
-            if (localTrustStoreFile.exists()) {
-                InputStream in = new FileInputStream(localTrustStoreFile);
-                try {
-                    mKnownServersStore.load(in, LOCAL_TRUSTSTORE_PASSWORD.toCharArray());
-                } finally {
-                    in.close();
-                }
-            } else {
-                mKnownServersStore.load(null, LOCAL_TRUSTSTORE_PASSWORD.toCharArray()); // necessary to initialize an empty KeyStore instance
-            }
-        }
-        return mKnownServersStore;
-    }
-    
-    
-    public static void addCertToKnownServersStore(Certificate cert, Context context) throws  KeyStoreException, NoSuchAlgorithmException, 
-                                                                                            CertificateException, IOException {
-        KeyStore knownServers = getKnownServersStore(context);
-        knownServers.setCertificateEntry(Integer.toString(cert.hashCode()), cert);
-        FileOutputStream fos = null;
-        try {
-            fos = context.openFileOutput(LOCAL_TRUSTSTORE_FILENAME, Context.MODE_PRIVATE);
-            knownServers.store(fos, LOCAL_TRUSTSTORE_PASSWORD.toCharArray());
-        } finally {
-            fos.close();
-        }
-    }
-    
-    
-    static public MultiThreadedHttpConnectionManager getMultiThreadedConnManager() {
-        if (mConnManager == null) {
-            mConnManager = new MultiThreadedHttpConnectionManager();
-            mConnManager.getParams().setDefaultMaxConnectionsPerHost(5);
-            mConnManager.getParams().setMaxTotalConnections(5);
-        }
-        return mConnManager;
-    }
-
-
-}
diff --git a/oc_framework/src/com/owncloud/android/oc_framework/network/ProgressiveDataTransferer.java b/oc_framework/src/com/owncloud/android/oc_framework/network/ProgressiveDataTransferer.java
deleted file mode 100644 (file)
index 3a21d5f..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-package com.owncloud.android.oc_framework.network;
-/* ownCloud Android client application
- *   Copyright (C) 2012-2013 ownCloud Inc.
- *
- *   This program is free software: you can redistribute it and/or modify
- *   it under the terms of the GNU General Public License version 2,
- *   as published by the Free Software Foundation.
- *
- *   This program is distributed in the hope that it will be useful,
- *   but WITHOUT ANY WARRANTY; without even the implied warranty of
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *   GNU General Public License for more details.
- *
- *   You should have received a copy of the GNU General Public License
- *   along with this program.  If not, see <http://www.gnu.org/licenses/>.
- *
- */
-
-
-
-import java.util.Collection;
-
-import com.owncloud.android.oc_framework.network.webdav.OnDatatransferProgressListener;
-
-
-public interface ProgressiveDataTransferer {
-
-    public void addDatatransferProgressListener (OnDatatransferProgressListener listener);
-    
-    public void addDatatransferProgressListeners(Collection<OnDatatransferProgressListener> listeners);
-
-    public void removeDatatransferProgressListener(OnDatatransferProgressListener listener);
-
-}
diff --git a/oc_framework/src/com/owncloud/android/oc_framework/network/ServerNameIndicator.java b/oc_framework/src/com/owncloud/android/oc_framework/network/ServerNameIndicator.java
deleted file mode 100644 (file)
index 1a20697..0000000
+++ /dev/null
@@ -1,144 +0,0 @@
-/* ownCloud Android client application
- *   Copyright (C) 2012-2013 ownCloud Inc.
- *
- *   This program is free software: you can redistribute it and/or modify
- *   it under the terms of the GNU General Public License version 2,
- *   as published by the Free Software Foundation.
- *
- *   This program is distributed in the hope that it will be useful,
- *   but WITHOUT ANY WARRANTY; without even the implied warranty of
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *   GNU General Public License for more details.
- *
- *   You should have received a copy of the GNU General Public License
- *   along with this program.  If not, see <http://www.gnu.org/licenses/>.
- *
- */
-
-package com.owncloud.android.oc_framework.network;
-
-import java.lang.ref.WeakReference;
-import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Method;
-import java.util.concurrent.atomic.AtomicReference;
-
-import javax.net.ssl.SSLSocket;
-
-import android.util.Log;
-
-
-/**
- * Enables the support of Server Name Indication if existing 
- * in the underlying network implementation.
- * 
- * Build as a singleton.
- * 
- * @author David A. Velasco
- */
-public class ServerNameIndicator {
-       
-       private static final String TAG = ServerNameIndicator.class.getSimpleName();
-       
-       private static final AtomicReference<ServerNameIndicator> mSingleInstance = new AtomicReference<ServerNameIndicator>();
-       
-       private static final String METHOD_NAME = "setHostname";
-       
-       private final WeakReference<Class<?>> mSSLSocketClassRef;
-       private final WeakReference<Method> mSetHostnameMethodRef;
-       
-       
-       /**
-        * Private constructor, class is a singleton.
-        * 
-        * @param sslSocketClass                Underlying implementation class of {@link SSLSocket} used to connect with the server. 
-        * @param setHostnameMethod             Name of the method to call to enable the SNI support.
-        */
-       private ServerNameIndicator(Class<?> sslSocketClass, Method setHostnameMethod) {
-               mSSLSocketClassRef = new WeakReference<Class<?>>(sslSocketClass);
-               mSetHostnameMethodRef = (setHostnameMethod == null) ? null : new WeakReference<Method>(setHostnameMethod);
-       }
-       
-       
-       /**
-        * Calls the {@code #setHostname(String)} method of the underlying implementation 
-        * of {@link SSLSocket} if exists.
-        * 
-        * Creates and initializes the single instance of the class when needed
-        *
-        * @param hostname              The name of the server host of interest.
-        * @param sslSocket     Client socket to connect with the server.
-        */
-       public static void setServerNameIndication(String hostname, SSLSocket sslSocket) {
-               final Method setHostnameMethod = getMethod(sslSocket);
-               if (setHostnameMethod != null) {
-                       try {
-                               setHostnameMethod.invoke(sslSocket, hostname);
-                               Log.i(TAG, "SNI done, hostname: " + hostname);
-                               
-                       } catch (IllegalArgumentException e) {
-                               Log.e(TAG, "Call to SSLSocket#setHost(String) failed ", e);
-                               
-                       } catch (IllegalAccessException e) {
-                               Log.e(TAG, "Call to SSLSocket#setHost(String) failed ", e);
-                               
-                       } catch (InvocationTargetException e) {
-                               Log.e(TAG, "Call to SSLSocket#setHost(String) failed ", e);
-                       }
-               } else {
-                       Log.i(TAG, "SNI not supported");
-               }
-       }
-
-       
-       /**
-        * Gets the method to invoke trying to minimize the effective 
-        * application of reflection.
-        * 
-        * @param       sslSocket               Instance of the SSL socket to use in connection with server.
-        * @return                                      Method to call to indicate the server name of interest to the server.
-        */
-       private static Method getMethod(SSLSocket sslSocket) {
-               final Class<?> sslSocketClass = sslSocket.getClass();
-               final ServerNameIndicator instance = mSingleInstance.get();
-               if (instance == null) {
-                       return initFrom(sslSocketClass);
-                       
-               } else if (instance.mSSLSocketClassRef.get() != sslSocketClass) {
-                       // the underlying class changed
-                       return initFrom(sslSocketClass);
-                               
-               } else if (instance.mSetHostnameMethodRef == null) {
-                       // SNI not supported
-                       return null;
-                               
-               } else {
-                       final Method cachedSetHostnameMethod = instance.mSetHostnameMethodRef.get();
-                       return (cachedSetHostnameMethod == null) ? initFrom(sslSocketClass) : cachedSetHostnameMethod;
-               }
-       }
-
-
-       /**
-        * Singleton initializer.
-        * 
-        * Uses reflection to extract and 'cache' the method to invoke to indicate the desited host name to the server side.
-        *  
-        * @param       sslSocketClass          Underlying class providing the implementation of {@link SSLSocket}.
-        * @return                                              Method to call to indicate the server name of interest to the server.
-        */
-       private static Method initFrom(Class<?> sslSocketClass) {
-        Log.i(TAG, "SSLSocket implementation: " + sslSocketClass.getCanonicalName());
-               Method setHostnameMethod = null;
-               try {
-                       setHostnameMethod = sslSocketClass.getMethod(METHOD_NAME, String.class);
-               } catch (SecurityException e) {
-                       Log.e(TAG, "Could not access to SSLSocket#setHostname(String) method ", e);
-                       
-               } catch (NoSuchMethodException e) {
-                       Log.i(TAG, "Could not find SSLSocket#setHostname(String) method - SNI not supported");
-               }
-               mSingleInstance.set(new ServerNameIndicator(sslSocketClass, setHostnameMethod));
-               return setHostnameMethod;
-       }
-
-}
diff --git a/oc_framework/src/com/owncloud/android/oc_framework/network/webdav/ChunkFromFileChannelRequestEntity.java b/oc_framework/src/com/owncloud/android/oc_framework/network/webdav/ChunkFromFileChannelRequestEntity.java
deleted file mode 100644 (file)
index 6a4200d..0000000
+++ /dev/null
@@ -1,145 +0,0 @@
-/* ownCloud Android client application
- *   Copyright (C) 2012-2013 ownCloud Inc.
- *
- *   This program is free software: you can redistribute it and/or modify
- *   it under the terms of the GNU General Public License version 2,
- *   as published by the Free Software Foundation.
- *
- *   This program is distributed in the hope that it will be useful,
- *   but WITHOUT ANY WARRANTY; without even the implied warranty of
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *   GNU General Public License for more details.
- *
- *   You should have received a copy of the GNU General Public License
- *   along with this program.  If not, see <http://www.gnu.org/licenses/>.
- *
- */
-
-package com.owncloud.android.oc_framework.network.webdav;
-
-import java.io.File;
-import java.io.IOException;
-import java.io.OutputStream;
-import java.nio.ByteBuffer;
-import java.nio.channels.FileChannel;
-import java.util.Collection;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.Set;
-
-import org.apache.commons.httpclient.methods.RequestEntity;
-
-import com.owncloud.android.oc_framework.network.ProgressiveDataTransferer;
-
-import android.util.Log;
-
-
-/**
- * A RequestEntity that represents a PIECE of a file.
- * 
- * @author David A. Velasco
- */
-public class ChunkFromFileChannelRequestEntity implements RequestEntity, ProgressiveDataTransferer {
-
-    private static final String TAG = ChunkFromFileChannelRequestEntity.class.getSimpleName();
-    
-    //private final File mFile;
-    private final FileChannel mChannel;
-    private final String mContentType;
-    private final long mChunkSize;
-    private final File mFile;
-    private long mOffset;
-    private long mTransferred;
-    Set<OnDatatransferProgressListener> mDataTransferListeners = new HashSet<OnDatatransferProgressListener>();
-    private ByteBuffer mBuffer = ByteBuffer.allocate(4096);
-
-    public ChunkFromFileChannelRequestEntity(final FileChannel channel, final String contentType, long chunkSize, final File file) {
-        super();
-        if (channel == null) {
-            throw new IllegalArgumentException("File may not be null");
-        }
-        if (chunkSize <= 0) {
-            throw new IllegalArgumentException("Chunk size must be greater than zero");
-        }
-        mChannel = channel;
-        mContentType = contentType;
-        mChunkSize = chunkSize;
-        mFile = file;
-        mOffset = 0;
-        mTransferred = 0;
-    }
-    
-    public void setOffset(long offset) {
-        mOffset = offset;
-    }
-    
-    public long getContentLength() {
-        try {
-            return Math.min(mChunkSize, mChannel.size() - mChannel.position());
-        } catch (IOException e) {
-            return mChunkSize;
-        }
-    }
-
-    public String getContentType() {
-        return mContentType;
-    }
-
-    public boolean isRepeatable() {
-        return true;
-    }
-    
-    @Override
-    public void addDatatransferProgressListener(OnDatatransferProgressListener listener) {
-        synchronized (mDataTransferListeners) {
-            mDataTransferListeners.add(listener);
-        }
-    }
-    
-    @Override
-    public void addDatatransferProgressListeners(Collection<OnDatatransferProgressListener> listeners) {
-        synchronized (mDataTransferListeners) {
-            mDataTransferListeners.addAll(listeners);
-        }
-    }
-    
-    @Override
-    public void removeDatatransferProgressListener(OnDatatransferProgressListener listener) {
-        synchronized (mDataTransferListeners) {
-            mDataTransferListeners.remove(listener);
-        }
-    }
-    
-    
-    public void writeRequest(final OutputStream out) throws IOException {
-        int readCount = 0;
-        Iterator<OnDatatransferProgressListener> it = null;
-        
-       try {
-            mChannel.position(mOffset);
-            long size = mFile.length();
-            if (size == 0) size = -1;
-            long maxCount = Math.min(mOffset + mChunkSize, mChannel.size());
-            while (mChannel.position() < maxCount) {
-                readCount = mChannel.read(mBuffer);
-                out.write(mBuffer.array(), 0, readCount);
-                mBuffer.clear();
-                if (mTransferred < maxCount) {  // condition to avoid accumulate progress for repeated chunks
-                    mTransferred += readCount;
-                }
-                synchronized (mDataTransferListeners) {
-                    it = mDataTransferListeners.iterator();
-                    while (it.hasNext()) {
-                        it.next().onTransferProgress(readCount, mTransferred, size, mFile.getName());
-                    }
-                }
-            }
-            
-        } catch (IOException io) {
-            Log.e(TAG, io.getMessage());
-            throw new RuntimeException("Ugly solution to workaround the default policy of retries when the server falls while uploading ; temporal fix; really", io);   
-            
-        }
-    }
-
-}
\ No newline at end of file
diff --git a/oc_framework/src/com/owncloud/android/oc_framework/network/webdav/FileRequestEntity.java b/oc_framework/src/com/owncloud/android/oc_framework/network/webdav/FileRequestEntity.java
deleted file mode 100644 (file)
index 3f066f9..0000000
+++ /dev/null
@@ -1,132 +0,0 @@
-/* ownCloud Android client application
- *   Copyright (C) 2012 Bartek Przybylski
- *   Copyright (C) 2012-2013 ownCloud Inc.
- *
- *   This program is free software: you can redistribute it and/or modify
- *   it under the terms of the GNU General Public License version 2,
- *   as published by the Free Software Foundation.
- *
- *   This program is distributed in the hope that it will be useful,
- *   but WITHOUT ANY WARRANTY; without even the implied warranty of
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *   GNU General Public License for more details.
- *
- *   You should have received a copy of the GNU General Public License
- *   along with this program.  If not, see <http://www.gnu.org/licenses/>.
- *
- */
-
-package com.owncloud.android.oc_framework.network.webdav;
-
-import java.io.File;
-import java.io.IOException;
-import java.io.OutputStream;
-import java.io.RandomAccessFile;
-import java.nio.ByteBuffer;
-import java.nio.channels.FileChannel;
-import java.util.Collection;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.Set;
-
-import org.apache.commons.httpclient.methods.RequestEntity;
-
-import android.util.Log;
-
-import com.owncloud.android.oc_framework.network.ProgressiveDataTransferer;
-
-
-/**
- * A RequestEntity that represents a File.
- * 
- */
-public class FileRequestEntity implements RequestEntity, ProgressiveDataTransferer {
-
-    final File mFile;
-    final String mContentType;
-    Set<OnDatatransferProgressListener> mDataTransferListeners = new HashSet<OnDatatransferProgressListener>();
-
-    public FileRequestEntity(final File file, final String contentType) {
-        super();
-        this.mFile = file;
-        this.mContentType = contentType;
-        if (file == null) {
-            throw new IllegalArgumentException("File may not be null");
-        }
-    }
-    
-    @Override
-    public long getContentLength() {
-        return mFile.length();
-    }
-
-    @Override
-    public String getContentType() {
-        return mContentType;
-    }
-
-    @Override
-    public boolean isRepeatable() {
-        return true;
-    }
-
-    @Override
-    public void addDatatransferProgressListener(OnDatatransferProgressListener listener) {
-        synchronized (mDataTransferListeners) {
-            mDataTransferListeners.add(listener);
-        }
-    }
-    
-    @Override
-    public void addDatatransferProgressListeners(Collection<OnDatatransferProgressListener> listeners) {
-        synchronized (mDataTransferListeners) {
-            mDataTransferListeners.addAll(listeners);
-        }
-    }
-    
-    @Override
-    public void removeDatatransferProgressListener(OnDatatransferProgressListener listener) {
-        synchronized (mDataTransferListeners) {
-            mDataTransferListeners.remove(listener);
-        }
-    }
-    
-    
-    @Override
-    public void writeRequest(final OutputStream out) throws IOException {
-        //byte[] tmp = new byte[4096];
-        ByteBuffer tmp = ByteBuffer.allocate(4096);
-        int readResult = 0;
-        
-        // TODO(bprzybylski): each mem allocation can throw OutOfMemoryError we need to handle it
-        //                    globally in some fashionable manner
-        RandomAccessFile raf = new RandomAccessFile(mFile, "r");
-        FileChannel channel = raf.getChannel();
-        Iterator<OnDatatransferProgressListener> it = null;
-        long transferred = 0;
-        long size = mFile.length();
-        if (size == 0) size = -1;
-        try {
-            while ((readResult = channel.read(tmp)) >= 0) {
-                out.write(tmp.array(), 0, readResult);
-                tmp.clear();
-                transferred += readResult;
-                synchronized (mDataTransferListeners) {
-                    it = mDataTransferListeners.iterator();
-                    while (it.hasNext()) {
-                        it.next().onTransferProgress(readResult, transferred, size, mFile.getName());
-                    }
-                }
-            }
-            
-        } catch (IOException io) {
-            Log.e("FileRequestException", io.getMessage());
-            throw new RuntimeException("Ugly solution to workaround the default policy of retries when the server falls while uploading ; temporal fix; really", io);   
-            
-        } finally {
-            channel.close();
-            raf.close();
-        }
-    }
-
-}
diff --git a/oc_framework/src/com/owncloud/android/oc_framework/network/webdav/OnDatatransferProgressListener.java b/oc_framework/src/com/owncloud/android/oc_framework/network/webdav/OnDatatransferProgressListener.java
deleted file mode 100644 (file)
index 06f32b5..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-/* ownCloud Android client application
- *   Copyright (C) 2012 Bartek Przybylski
- *   Copyright (C) 2012-2013 ownCloud Inc.
- *
- *   This program is free software: you can redistribute it and/or modify
- *   it under the terms of the GNU General Public License version 2,
- *   as published by the Free Software Foundation.
- *
- *   This program is distributed in the hope that it will be useful,
- *   but WITHOUT ANY WARRANTY; without even the implied warranty of
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *   GNU General Public License for more details.
- *
- *   You should have received a copy of the GNU General Public License
- *   along with this program.  If not, see <http://www.gnu.org/licenses/>.
- *
- */
-
-package com.owncloud.android.oc_framework.network.webdav;
-
-public interface OnDatatransferProgressListener {
-    public void onTransferProgress(long progressRate);
-    public void onTransferProgress(long progressRate, long totalTransferredSoFar, long totalToTransfer, String fileName);
-}
diff --git a/oc_framework/src/com/owncloud/android/oc_framework/network/webdav/OwnCloudClientFactory.java b/oc_framework/src/com/owncloud/android/oc_framework/network/webdav/OwnCloudClientFactory.java
deleted file mode 100644 (file)
index 5c41edb..0000000
+++ /dev/null
@@ -1,151 +0,0 @@
-/* ownCloud Android client application
- *   Copyright (C) 2012-2013 ownCloud Inc.
- *
- *   This program is free software: you can redistribute it and/or modify
- *   it under the terms of the GNU General Public License version 2,
- *   as published by the Free Software Foundation.
- *
- *   This program is distributed in the hope that it will be useful,
- *   but WITHOUT ANY WARRANTY; without even the implied warranty of
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *   GNU General Public License for more details.
- *
- *   You should have received a copy of the GNU General Public License
- *   along with this program.  If not, see <http://www.gnu.org/licenses/>.
- *
- */
-package com.owncloud.android.oc_framework.network.webdav;
-
-import java.io.IOException;
-import java.security.GeneralSecurityException;
-
-import com.owncloud.android.oc_framework.accounts.AccountTypeUtils;
-import com.owncloud.android.oc_framework.accounts.AccountUtils;
-import com.owncloud.android.oc_framework.accounts.OwnCloudAccount;
-import com.owncloud.android.oc_framework.accounts.AccountUtils.AccountNotFoundException;
-import com.owncloud.android.oc_framework.network.NetworkUtils;
-
-import android.accounts.Account;
-import android.accounts.AccountManager;
-import android.accounts.AccountManagerFuture;
-import android.accounts.AuthenticatorException;
-import android.accounts.OperationCanceledException;
-import android.app.Activity;
-import android.content.Context;
-import android.net.Uri;
-import android.os.Bundle;
-import android.util.Log;
-
-public class OwnCloudClientFactory {
-    
-    final private static String TAG = OwnCloudClientFactory.class.getSimpleName();
-    
-    /** Default timeout for waiting data from the server */
-    public static final int DEFAULT_DATA_TIMEOUT = 60000;
-    
-    /** Default timeout for establishing a connection */
-    public static final int DEFAULT_CONNECTION_TIMEOUT = 60000;
-
-    
-    /**
-     * Creates a WebdavClient setup for an ownCloud account
-     * 
-     * Do not call this method from the main thread.
-     * 
-     * @param account                       The ownCloud account
-     * @param appContext                    Android application context
-     * @return                              A WebdavClient object ready to be used
-     * @throws AuthenticatorException       If the authenticator failed to get the authorization token for the account.
-     * @throws OperationCanceledException   If the authenticator operation was cancelled while getting the authorization token for the account. 
-     * @throws IOException                  If there was some I/O error while getting the authorization token for the account.
-     * @throws AccountNotFoundException     If 'account' is unknown for the AccountManager
-     */
-    public static WebdavClient createOwnCloudClient (Account account, Context appContext) throws OperationCanceledException, AuthenticatorException, IOException, AccountNotFoundException {
-        //Log_OC.d(TAG, "Creating WebdavClient associated to " + account.name);
-       
-        Uri uri = Uri.parse(AccountUtils.constructFullURLForAccount(appContext, account));
-        AccountManager am = AccountManager.get(appContext);
-        boolean isOauth2 = am.getUserData(account, OwnCloudAccount.Constants.KEY_SUPPORTS_OAUTH2) != null;   // TODO avoid calling to getUserData here
-        boolean isSamlSso = am.getUserData(account, OwnCloudAccount.Constants.KEY_SUPPORTS_SAML_WEB_SSO) != null;
-        WebdavClient client = createOwnCloudClient(uri, appContext, !isSamlSso);
-        if (isOauth2) {    
-            String accessToken = am.blockingGetAuthToken(account, AccountTypeUtils.getAuthTokenTypeAccessToken(account.type), false);
-            client.setBearerCredentials(accessToken);   // TODO not assume that the access token is a bearer token
-        
-        } else if (isSamlSso) {    // TODO avoid a call to getUserData here
-            String accessToken = am.blockingGetAuthToken(account, AccountTypeUtils.getAuthTokenTypeSamlSessionCookie(account.type), false);
-            client.setSsoSessionCookie(accessToken);
-            
-        } else {
-            String username = account.name.substring(0, account.name.lastIndexOf('@'));
-            //String password = am.getPassword(account);
-            String password = am.blockingGetAuthToken(account, AccountTypeUtils.getAuthTokenTypePass(account.type), false);
-            client.setBasicCredentials(username, password);
-        }
-        
-        return client;
-    }
-    
-    
-    public static WebdavClient createOwnCloudClient (Account account, Context appContext, Activity currentActivity) throws OperationCanceledException, AuthenticatorException, IOException, AccountNotFoundException {
-        Uri uri = Uri.parse(AccountUtils.constructFullURLForAccount(appContext, account));
-        AccountManager am = AccountManager.get(appContext);
-        boolean isOauth2 = am.getUserData(account, OwnCloudAccount.Constants.KEY_SUPPORTS_OAUTH2) != null;   // TODO avoid calling to getUserData here
-        boolean isSamlSso = am.getUserData(account, OwnCloudAccount.Constants.KEY_SUPPORTS_SAML_WEB_SSO) != null;
-        WebdavClient client = createOwnCloudClient(uri, appContext, !isSamlSso);
-        
-        if (isOauth2) {    // TODO avoid a call to getUserData here
-            AccountManagerFuture<Bundle> future =  am.getAuthToken(account,  AccountTypeUtils.getAuthTokenTypeAccessToken(account.type), null, currentActivity, null, null);
-            Bundle result = future.getResult();
-            String accessToken = result.getString(AccountManager.KEY_AUTHTOKEN);
-            if (accessToken == null) throw new AuthenticatorException("WTF!");
-            client.setBearerCredentials(accessToken);   // TODO not assume that the access token is a bearer token
-
-        } else if (isSamlSso) {    // TODO avoid a call to getUserData here
-            AccountManagerFuture<Bundle> future =  am.getAuthToken(account, AccountTypeUtils.getAuthTokenTypeSamlSessionCookie(account.type), null, currentActivity, null, null);
-            Bundle result = future.getResult();
-            String accessToken = result.getString(AccountManager.KEY_AUTHTOKEN);
-            if (accessToken == null) throw new AuthenticatorException("WTF!");
-            client.setSsoSessionCookie(accessToken);
-
-        } else {
-            String username = account.name.substring(0, account.name.lastIndexOf('@'));
-            //String password = am.getPassword(account);
-            //String password = am.blockingGetAuthToken(account, MainApp.getAuthTokenTypePass(), false);
-            AccountManagerFuture<Bundle> future =  am.getAuthToken(account,  AccountTypeUtils.getAuthTokenTypePass(account.type), null, currentActivity, null, null);
-            Bundle result = future.getResult();
-            String password = result.getString(AccountManager.KEY_AUTHTOKEN);
-            client.setBasicCredentials(username, password);
-        }
-        
-        return client;
-    }
-    
-    /**
-     * Creates a WebdavClient to access a URL and sets the desired parameters for ownCloud client connections.
-     * 
-     * @param uri       URL to the ownCloud server
-     * @param context   Android context where the WebdavClient is being created.
-     * @return          A WebdavClient object ready to be used
-     */
-    public static WebdavClient createOwnCloudClient(Uri uri, Context context, boolean followRedirects) {
-        try {
-            NetworkUtils.registerAdvancedSslContext(true, context);
-        }  catch (GeneralSecurityException e) {
-            Log.e(TAG, "Advanced SSL Context could not be loaded. Default SSL management in the system will be used for HTTPS connections", e);
-            
-        } catch (IOException e) {
-            Log.e(TAG, "The local server truststore could not be read. Default SSL management in the system will be used for HTTPS connections", e);
-        }
-        
-        WebdavClient client = new WebdavClient(NetworkUtils.getMultiThreadedConnManager());
-        
-        client.setDefaultTimeouts(DEFAULT_DATA_TIMEOUT, DEFAULT_CONNECTION_TIMEOUT);
-        client.setBaseUri(uri);
-        client.setFollowRedirects(followRedirects);
-        
-        return client;
-    }
-    
-    
-}
diff --git a/oc_framework/src/com/owncloud/android/oc_framework/network/webdav/WebdavClient.java b/oc_framework/src/com/owncloud/android/oc_framework/network/webdav/WebdavClient.java
deleted file mode 100644 (file)
index 543374c..0000000
+++ /dev/null
@@ -1,245 +0,0 @@
-/* ownCloud Android client application
- *   Copyright (C) 2011  Bartek Przybylski
- *   Copyright (C) 2012-2013 ownCloud Inc.
- *
- *   This program is free software: you can redistribute it and/or modify
- *   it under the terms of the GNU General Public License version 2,
- *   as published by the Free Software Foundation.
- *
- *   This program is distributed in the hope that it will be useful,
- *   but WITHOUT ANY WARRANTY; without even the implied warranty of
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *   GNU General Public License for more details.
- *
- *   You should have received a copy of the GNU General Public License
- *   along with this program.  If not, see <http://www.gnu.org/licenses/>.
- *
- */
-
-package com.owncloud.android.oc_framework.network.webdav;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.util.ArrayList;
-import java.util.List;
-
-import org.apache.commons.httpclient.Credentials;
-import org.apache.commons.httpclient.Header;
-import org.apache.commons.httpclient.HttpClient;
-import org.apache.commons.httpclient.HttpConnectionManager;
-import org.apache.commons.httpclient.HttpException;
-import org.apache.commons.httpclient.HttpMethod;
-import org.apache.commons.httpclient.HttpMethodBase;
-import org.apache.commons.httpclient.HttpVersion;
-import org.apache.commons.httpclient.URI;
-import org.apache.commons.httpclient.UsernamePasswordCredentials;
-import org.apache.commons.httpclient.auth.AuthPolicy;
-import org.apache.commons.httpclient.auth.AuthScope;
-import org.apache.commons.httpclient.cookie.CookiePolicy;
-import org.apache.commons.httpclient.methods.HeadMethod;
-import org.apache.commons.httpclient.params.HttpMethodParams;
-import org.apache.http.HttpStatus;
-import org.apache.http.params.CoreProtocolPNames;
-
-import com.owncloud.android.oc_framework.network.BearerAuthScheme;
-import com.owncloud.android.oc_framework.network.BearerCredentials;
-
-import android.net.Uri;
-import android.util.Log;
-
-public class WebdavClient extends HttpClient {
-    private static final int MAX_REDIRECTIONS_COUNT = 3;
-    
-    private Uri mUri;
-    private Credentials mCredentials;
-    private boolean mFollowRedirects;
-    private String mSsoSessionCookie;
-    final private static String TAG = WebdavClient.class.getSimpleName();
-    public static final String USER_AGENT = "Android-ownCloud";
-    
-    static private byte[] sExhaustBuffer = new byte[1024];
-    
-    /**
-     * Constructor
-     */
-    public WebdavClient(HttpConnectionManager connectionMgr) {
-        super(connectionMgr);
-        Log.d(TAG, "Creating WebdavClient");
-        getParams().setParameter(HttpMethodParams.USER_AGENT, USER_AGENT);
-        getParams().setParameter(CoreProtocolPNames.PROTOCOL_VERSION, HttpVersion.HTTP_1_1);
-        mFollowRedirects = true;
-        mSsoSessionCookie = null;
-    }
-
-    public void setBearerCredentials(String accessToken) {
-        AuthPolicy.registerAuthScheme(BearerAuthScheme.AUTH_POLICY, BearerAuthScheme.class);
-        
-        List<String> authPrefs = new ArrayList<String>(1);
-        authPrefs.add(BearerAuthScheme.AUTH_POLICY);
-        getParams().setParameter(AuthPolicy.AUTH_SCHEME_PRIORITY, authPrefs);        
-        
-        mCredentials = new BearerCredentials(accessToken);
-        getState().setCredentials(AuthScope.ANY, mCredentials);
-        mSsoSessionCookie = null;
-    }
-
-    public void setBasicCredentials(String username, String password) {
-        List<String> authPrefs = new ArrayList<String>(1);
-        authPrefs.add(AuthPolicy.BASIC);
-        getParams().setParameter(AuthPolicy.AUTH_SCHEME_PRIORITY, authPrefs);        
-        
-        getParams().setAuthenticationPreemptive(true);
-        mCredentials = new UsernamePasswordCredentials(username, password);
-        getState().setCredentials(AuthScope.ANY, mCredentials);
-        mSsoSessionCookie = null;
-    }
-    
-    public void setSsoSessionCookie(String accessToken) {
-        getParams().setAuthenticationPreemptive(false);
-        getParams().setCookiePolicy(CookiePolicy.IGNORE_COOKIES);
-        mSsoSessionCookie = accessToken;
-        mCredentials = null;
-    }
-    
-    
-    /**
-     * Check if a file exists in the OC server
-     * 
-     * TODO replace with ExistenceOperation
-     * 
-     * @return              'true' if the file exists; 'false' it doesn't exist
-     * @throws  Exception   When the existence could not be determined
-     */
-    public boolean existsFile(String path) throws IOException, HttpException {
-        HeadMethod head = new HeadMethod(mUri.toString() + WebdavUtils.encodePath(path));
-        try {
-            int status = executeMethod(head);
-            Log.d(TAG, "HEAD to " + path + " finished with HTTP status " + status + ((status != HttpStatus.SC_OK)?"(FAIL)":""));
-            exhaustResponse(head.getResponseBodyAsStream());
-            return (status == HttpStatus.SC_OK);
-            
-        } finally {
-            head.releaseConnection();    // let the connection available for other methods
-        }
-    }
-    
-    /**
-     * Requests the received method with the received timeout (milliseconds).
-     * 
-     * Executes the method through the inherited HttpClient.executedMethod(method).
-     * 
-     * Sets the socket and connection timeouts only for the method received.
-     * 
-     * The timeouts are both in milliseconds; 0 means 'infinite'; < 0 means 'do not change the default'
-     * 
-     * @param method            HTTP method request.
-     * @param readTimeout       Timeout to set for data reception
-     * @param conntionTimout    Timeout to set for connection establishment
-     */
-    public int executeMethod(HttpMethodBase method, int readTimeout, int connectionTimeout) throws HttpException, IOException {
-        int oldSoTimeout = getParams().getSoTimeout();
-        int oldConnectionTimeout = getHttpConnectionManager().getParams().getConnectionTimeout();
-        try {
-            if (readTimeout >= 0) { 
-                method.getParams().setSoTimeout(readTimeout);   // this should be enough...
-                getParams().setSoTimeout(readTimeout);          // ... but this looks like necessary for HTTPS
-            }
-            if (connectionTimeout >= 0) {
-                getHttpConnectionManager().getParams().setConnectionTimeout(connectionTimeout);
-            }
-            return executeMethod(method);
-        } finally {
-            getParams().setSoTimeout(oldSoTimeout);
-            getHttpConnectionManager().getParams().setConnectionTimeout(oldConnectionTimeout);
-        }
-    }
-    
-    
-    @Override
-    public int executeMethod(HttpMethod method) throws IOException, HttpException {
-        boolean customRedirectionNeeded = false;
-        try {
-            method.setFollowRedirects(mFollowRedirects);
-        } catch (Exception e) {
-            //if (mFollowRedirects) Log_OC.d(TAG, "setFollowRedirects failed for " + method.getName() + " method, custom redirection will be used if needed");
-            customRedirectionNeeded = mFollowRedirects;
-        }
-        if (mSsoSessionCookie != null && mSsoSessionCookie.length() > 0) {
-            method.setRequestHeader("Cookie", mSsoSessionCookie);
-        }
-        int status = super.executeMethod(method);
-        int redirectionsCount = 0;
-        while (customRedirectionNeeded &&
-                redirectionsCount < MAX_REDIRECTIONS_COUNT &&
-                (   status == HttpStatus.SC_MOVED_PERMANENTLY || 
-                    status == HttpStatus.SC_MOVED_TEMPORARILY ||
-                    status == HttpStatus.SC_TEMPORARY_REDIRECT)
-                ) {
-            
-            Header location = method.getResponseHeader("Location");
-            if (location != null) {
-                Log.d(TAG,  "Location to redirect: " + location.getValue());
-                method.setURI(new URI(location.getValue(), true));
-                status = super.executeMethod(method);
-                redirectionsCount++;
-                
-            } else {
-                Log.d(TAG,  "No location to redirect!");
-                status = HttpStatus.SC_NOT_FOUND;
-            }
-        }
-        
-        return status;
-    }
-
-
-    /**
-     * Exhausts a not interesting HTTP response. Encouraged by HttpClient documentation.
-     * 
-     * @param responseBodyAsStream      InputStream with the HTTP response to exhaust.
-     */
-    public void exhaustResponse(InputStream responseBodyAsStream) {
-        if (responseBodyAsStream != null) {
-            try {
-                while (responseBodyAsStream.read(sExhaustBuffer) >= 0);
-                responseBodyAsStream.close();
-            
-            } catch (IOException io) {
-                Log.e(TAG, "Unexpected exception while exhausting not interesting HTTP response; will be IGNORED", io);
-            }
-        }
-    }
-
-    /**
-     * Sets the connection and wait-for-data timeouts to be applied by default to the methods performed by this client.
-     */
-    public void setDefaultTimeouts(int defaultDataTimeout, int defaultConnectionTimeout) {
-            getParams().setSoTimeout(defaultDataTimeout);
-            getHttpConnectionManager().getParams().setConnectionTimeout(defaultConnectionTimeout);
-    }
-
-    /**
-     * Sets the base URI for the helper methods that receive paths as parameters, instead of full URLs
-     * @param uri
-     */
-    public void setBaseUri(Uri uri) {
-        mUri = uri;
-    }
-
-    public Uri getBaseUri() {
-        return mUri;
-    }
-
-    public final Credentials getCredentials() {
-        return mCredentials;
-    }
-    
-    public final String getSsoSessionCookie() {
-        return mSsoSessionCookie;
-    }
-
-    public void setFollowRedirects(boolean followRedirects) {
-        mFollowRedirects = followRedirects;
-    }
-
-}
diff --git a/oc_framework/src/com/owncloud/android/oc_framework/network/webdav/WebdavEntry.java b/oc_framework/src/com/owncloud/android/oc_framework/network/webdav/WebdavEntry.java
deleted file mode 100644 (file)
index 3bcfa36..0000000
+++ /dev/null
@@ -1,150 +0,0 @@
-/* ownCloud Android client application
- *   Copyright (C) 2012  ownCloud
- *
- *   This program is free software: you can redistribute it and/or modify
- *   it under the terms of the GNU General Public License version 2,
- *   as published by the Free Software Foundation.
- *
- *   This program is distributed in the hope that it will be useful,
- *   but WITHOUT ANY WARRANTY; without even the implied warranty of
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *   GNU General Public License for more details.
- *
- *   You should have received a copy of the GNU General Public License
- *   along with this program.  If not, see <http://www.gnu.org/licenses/>.
- *
- */
-package com.owncloud.android.oc_framework.network.webdav;
-
-import java.util.Date;
-
-import org.apache.jackrabbit.webdav.MultiStatusResponse;
-import org.apache.jackrabbit.webdav.property.DavProperty;
-import org.apache.jackrabbit.webdav.property.DavPropertyName;
-import org.apache.jackrabbit.webdav.property.DavPropertySet;
-
-
-
-import android.net.Uri;
-import android.util.Log;
-
-public class WebdavEntry {
-    private String mName, mPath, mUri, mContentType, mEtag;
-    private long mContentLength, mCreateTimestamp, mModifiedTimestamp;
-
-    public WebdavEntry(MultiStatusResponse ms, String splitElement) {
-        resetData();
-        if (ms.getStatus().length != 0) {
-            mUri = ms.getHref();
-
-            mPath = mUri.split(splitElement, 2)[1];
-
-            int status = ms.getStatus()[0].getStatusCode();
-            DavPropertySet propSet = ms.getProperties(status);
-            @SuppressWarnings("rawtypes")
-            DavProperty prop = propSet.get(DavPropertyName.DISPLAYNAME);
-            if (prop != null) {
-                mName = (String) prop.getName().toString();
-                mName = mName.substring(1, mName.length()-1);
-            }
-            else {
-                String[] tmp = mPath.split("/");
-                if (tmp.length > 0)
-                    mName = tmp[tmp.length - 1];
-            }
-
-            // use unknown mimetype as default behavior
-            mContentType = "application/octet-stream";
-            prop = propSet.get(DavPropertyName.GETCONTENTTYPE);
-            if (prop != null) {
-                mContentType = (String) prop.getValue();
-                // dvelasco: some builds of ownCloud server 4.0.x added a trailing ';' to the MIME type ; if looks fixed, but let's be cautious
-                if (mContentType.indexOf(";") >= 0) {
-                    mContentType = mContentType.substring(0, mContentType.indexOf(";"));
-                }
-            }
-            
-            // check if it's a folder in the standard way: see RFC2518 12.2 . RFC4918 14.3 
-            prop = propSet.get(DavPropertyName.RESOURCETYPE);
-            if (prop!= null) {
-                Object value = prop.getValue();
-                if (value != null) {
-                    mContentType = "DIR";   // a specific attribute would be better, but this is enough; unless while we have no reason to distinguish MIME types for folders
-                }
-            }
-
-            prop = propSet.get(DavPropertyName.GETCONTENTLENGTH);
-            if (prop != null)
-                mContentLength = Long.parseLong((String) prop.getValue());
-
-            prop = propSet.get(DavPropertyName.GETLASTMODIFIED);
-            if (prop != null) {
-                Date d = WebdavUtils
-                        .parseResponseDate((String) prop.getValue());
-                mModifiedTimestamp = (d != null) ? d.getTime() : 0;
-            }
-
-            prop = propSet.get(DavPropertyName.CREATIONDATE);
-            if (prop != null) {
-                Date d = WebdavUtils
-                        .parseResponseDate((String) prop.getValue());
-                mCreateTimestamp = (d != null) ? d.getTime() : 0;
-            }
-            
-            prop = propSet.get(DavPropertyName.GETETAG);
-            if (prop != null) {
-                mEtag = (String) prop.getValue();
-                mEtag = mEtag.substring(1, mEtag.length()-1);
-            }
-
-        } else {
-            Log.e("WebdavEntry",
-                    "General fuckup, no status for webdav response");
-        }
-    }
-
-    public String path() {
-        return mPath;
-    }
-    
-    public String decodedPath() {
-        return Uri.decode(mPath);
-    }
-
-    public String name() {
-        return mName;
-    }
-
-    public boolean isDirectory() {
-        return mContentType.equals("DIR");
-    }
-
-    public String contentType() {
-        return mContentType;
-    }
-
-    public String uri() {
-        return mUri;
-    }
-
-    public long contentLength() {
-        return mContentLength;
-    }
-
-    public long createTimestamp() {
-        return mCreateTimestamp;
-    }
-
-    public long modifiedTimestamp() {
-        return mModifiedTimestamp;
-    }
-    
-    public String etag() {
-        return mEtag;
-    }
-
-    private void resetData() {
-        mName = mUri = mContentType = null;
-        mContentLength = mCreateTimestamp = mModifiedTimestamp = 0;
-    }
-}
diff --git a/oc_framework/src/com/owncloud/android/oc_framework/network/webdav/WebdavUtils.java b/oc_framework/src/com/owncloud/android/oc_framework/network/webdav/WebdavUtils.java
deleted file mode 100644 (file)
index f5681de..0000000
+++ /dev/null
@@ -1,76 +0,0 @@
-/* ownCloud Android client application
- *   Copyright (C) 2012  Bartek Przybylski
- *   Copyright (C) 2012-2013 ownCloud Inc.
- *
- *   This program is free software: you can redistribute it and/or modify
- *   it under the terms of the GNU General Public License version 2,
- *   as published by the Free Software Foundation.
- *
- *   This program is distributed in the hope that it will be useful,
- *   but WITHOUT ANY WARRANTY; without even the implied warranty of
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *   GNU General Public License for more details.
- *
- *   You should have received a copy of the GNU General Public License
- *   along with this program.  If not, see <http://www.gnu.org/licenses/>.
- *
- */
-
-package com.owncloud.android.oc_framework.network.webdav;
-
-import java.text.ParseException;
-import java.text.SimpleDateFormat;
-import java.util.Date;
-import java.util.Locale;
-
-import android.net.Uri;
-
-public class WebdavUtils {
-    public static final SimpleDateFormat DISPLAY_DATE_FORMAT = new SimpleDateFormat(
-            "dd.MM.yyyy hh:mm");
-    private static final SimpleDateFormat DATETIME_FORMATS[] = {
-            new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss'Z'", Locale.US),
-            new SimpleDateFormat("EEE, dd MMM yyyy HH:mm:ss zzz", Locale.US),
-            new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.sss'Z'", Locale.US),
-            new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ssZ", Locale.US),
-            new SimpleDateFormat("EEE MMM dd HH:mm:ss zzz yyyy", Locale.US),
-            new SimpleDateFormat("EEEEEE, dd-MMM-yy HH:mm:ss zzz", Locale.US),
-            new SimpleDateFormat("EEE MMMM d HH:mm:ss yyyy", Locale.US) };
-
-    public static String prepareXmlForPropFind() {
-        String ret = "<?xml version=\"1.0\" ?><D:propfind xmlns:D=\"DAV:\"><D:allprop/></D:propfind>";
-        return ret;
-    }
-
-    public static String prepareXmlForPatch() {
-        return "<?xml version=\"1.0\" ?><D:propertyupdate xmlns:D=\"DAV:\"></D:propertyupdate>";
-    }
-
-    public static Date parseResponseDate(String date) {
-        Date returnDate = null;
-        for (int i = 0; i < DATETIME_FORMATS.length; ++i) {
-            try {
-                returnDate = DATETIME_FORMATS[i].parse(date);
-                return returnDate;
-            } catch (ParseException e) {
-            }
-        }
-        return null;
-    }
-
-    /**
-     * Encodes a path according to URI RFC 2396. 
-     * 
-     * If the received path doesn't start with "/", the method adds it.
-     * 
-     * @param remoteFilePath    Path
-     * @return                  Encoded path according to RFC 2396, always starting with "/"
-     */
-    public static String encodePath(String remoteFilePath) {
-        String encodedPath = Uri.encode(remoteFilePath, "/");
-        if (!encodedPath.startsWith("/"))
-            encodedPath = "/" + encodedPath;
-        return encodedPath;
-    }
-    
-}
diff --git a/oc_framework/src/com/owncloud/android/oc_framework/operations/OnRemoteOperationListener.java b/oc_framework/src/com/owncloud/android/oc_framework/operations/OnRemoteOperationListener.java
deleted file mode 100644 (file)
index a81d401..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-/* ownCloud Android client application
- *   Copyright (C) 2012 Bartek Przybylski
- *   Copyright (C) 2012-2013 ownCloud Inc.
- *
- *   This program is free software: you can redistribute it and/or modify
- *   it under the terms of the GNU General Public License version 2,
- *   as published by the Free Software Foundation.
- *
- *   This program is distributed in the hope that it will be useful,
- *   but WITHOUT ANY WARRANTY; without even the implied warranty of
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *   GNU General Public License for more details.
- *
- *   You should have received a copy of the GNU General Public License
- *   along with this program.  If not, see <http://www.gnu.org/licenses/>.
- *
- */
-
-package com.owncloud.android.oc_framework.operations;
-
-public interface OnRemoteOperationListener {
-
-       void onRemoteOperationFinish(RemoteOperation caller, RemoteOperationResult result);
-       
-}
diff --git a/oc_framework/src/com/owncloud/android/oc_framework/operations/OperationCancelledException.java b/oc_framework/src/com/owncloud/android/oc_framework/operations/OperationCancelledException.java
deleted file mode 100644 (file)
index d5fd378..0000000
+++ /dev/null
@@ -1,28 +0,0 @@
-/* ownCloud Android client application
- *   Copyright (C) 2012 Bartek Przybylski
- *   Copyright (C) 2012-2013 ownCloud Inc.
- *
- *   This program is free software: you can redistribute it and/or modify
- *   it under the terms of the GNU General Public License version 2,
- *   as published by the Free Software Foundation.
- *
- *   This program is distributed in the hope that it will be useful,
- *   but WITHOUT ANY WARRANTY; without even the implied warranty of
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *   GNU General Public License for more details.
- *
- *   You should have received a copy of the GNU General Public License
- *   along with this program.  If not, see <http://www.gnu.org/licenses/>.
- *
- */
-
-package com.owncloud.android.oc_framework.operations;
-
-public class OperationCancelledException extends Exception {
-
-    /**
-     * Generated serial version - to avoid Java warning
-     */
-    private static final long serialVersionUID = -6350981497740424983L;
-
-}
diff --git a/oc_framework/src/com/owncloud/android/oc_framework/operations/RemoteFile.java b/oc_framework/src/com/owncloud/android/oc_framework/operations/RemoteFile.java
deleted file mode 100644 (file)
index 922b270..0000000
+++ /dev/null
@@ -1,180 +0,0 @@
-/* ownCloud Android client application
- *   Copyright (C) 2012-2013 ownCloud Inc.
- *
- *   This program is free software: you can redistribute it and/or modify
- *   it under the terms of the GNU General Public License version 2,
- *   as published by the Free Software Foundation.
- *
- *   This program is distributed in the hope that it will be useful,
- *   but WITHOUT ANY WARRANTY; without even the implied warranty of
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *   GNU General Public License for more details.
- *
- *   You should have received a copy of the GNU General Public License
- *   along with this program.  If not, see <http://www.gnu.org/licenses/>.
- *
- */
-
-package com.owncloud.android.oc_framework.operations;
-
-import java.io.Serializable;
-
-import android.os.Parcel;
-import android.os.Parcelable;
-
-import com.owncloud.android.oc_framework.network.webdav.WebdavEntry;
-import com.owncloud.android.oc_framework.utils.FileUtils;
-
-/**
- *  Contains the data of a Remote File from a WebDavEntry
- * 
- *  @author masensio
- */
-
-public class RemoteFile implements Parcelable, Serializable {
-
-       /** Generated - should be refreshed every time the class changes!! */
-       private static final long serialVersionUID = 532139091191390616L;
-       
-       private String mRemotePath;
-       private String mMimeType;
-       private long mLength;
-       private long mCreationTimestamp;
-       private long mModifiedTimestamp;
-       private String mEtag;
-       
-       /** 
-        * Getters and Setters
-        */
-       
-    public String getRemotePath() {
-               return mRemotePath;
-       }
-
-       public void setRemotePath(String remotePath) {
-               this.mRemotePath = remotePath;
-       }
-
-       public String getMimeType() {
-               return mMimeType;
-       }
-
-       public void setMimeType(String mimeType) {
-               this.mMimeType = mimeType;
-       }
-
-       public long getLength() {
-               return mLength;
-       }
-
-       public void setLength(long length) {
-               this.mLength = length;
-       }
-
-       public long getCreationTimestamp() {
-               return mCreationTimestamp;
-       }
-
-       public void setCreationTimestamp(long creationTimestamp) {
-               this.mCreationTimestamp = creationTimestamp;
-       }
-
-       public long getModifiedTimestamp() {
-               return mModifiedTimestamp;
-       }
-
-       public void setModifiedTimestamp(long modifiedTimestamp) {
-               this.mModifiedTimestamp = modifiedTimestamp;
-       }
-
-       public String getEtag() {
-               return mEtag;
-       }
-
-       public void setEtag(String etag) {
-               this.mEtag = etag;
-       }
-
-       /**
-     * Create new {@link RemoteFile} with given path.
-     * 
-     * The path received must be URL-decoded. Path separator must be OCFile.PATH_SEPARATOR, and it must be the first character in 'path'.
-     * 
-     * @param path The remote path of the file.
-     */
-       public RemoteFile(String path) {
-               resetData();
-        if (path == null || path.length() <= 0 || !path.startsWith(FileUtils.PATH_SEPARATOR)) {
-            throw new IllegalArgumentException("Trying to create a OCFile with a non valid remote path: " + path);
-        }
-        mRemotePath = path;
-       }
-       
-       public RemoteFile(WebdavEntry we) {
-        this(we.decodedPath());
-        this.setCreationTimestamp(we.createTimestamp());
-        this.setLength(we.contentLength());
-        this.setMimeType(we.contentType());
-        this.setModifiedTimestamp(we.modifiedTimestamp());
-        this.setEtag(we.etag());
-       }
-
-       /**
-     * Used internally. Reset all file properties
-     */
-    private void resetData() {
-        mRemotePath = null;
-        mMimeType = null;
-        mLength = 0;
-        mCreationTimestamp = 0;
-        mModifiedTimestamp = 0;
-        mEtag = null;
-    }
-
-    /** 
-     * Parcelable Methods
-     */
-    public static final Parcelable.Creator<RemoteFile> CREATOR = new Parcelable.Creator<RemoteFile>() {
-        @Override
-        public RemoteFile createFromParcel(Parcel source) {
-            return new RemoteFile(source);
-        }
-
-        @Override
-        public RemoteFile[] newArray(int size) {
-            return new RemoteFile[size];
-        }
-    };
-    
-    
-    /**
-     * Reconstruct from parcel
-     * 
-     * @param source The source parcel
-     */
-    private RemoteFile(Parcel source) {
-        mRemotePath = source.readString();
-        mMimeType = source.readString();
-        mLength = source.readLong();
-        mCreationTimestamp = source.readLong();
-        mModifiedTimestamp = source.readLong();
-        mEtag = source.readString();
-    }
-    
-       @Override
-       public int describeContents() {
-               return this.hashCode();
-       }
-
-       @Override
-       public void writeToParcel(Parcel dest, int flags) {
-               dest.writeString(mRemotePath);
-               dest.writeString(mMimeType);    
-               dest.writeLong(mLength);
-               dest.writeLong(mCreationTimestamp);
-               dest.writeLong(mModifiedTimestamp);
-               dest.writeString(mEtag);                
-       }
-    
-    
-}
diff --git a/oc_framework/src/com/owncloud/android/oc_framework/operations/RemoteOperation.java b/oc_framework/src/com/owncloud/android/oc_framework/operations/RemoteOperation.java
deleted file mode 100644 (file)
index e18ae53..0000000
+++ /dev/null
@@ -1,287 +0,0 @@
-/* ownCloud Android client application
- *   Copyright (C) 2012-2013 ownCloud Inc.
- *
- *   This program is free software: you can redistribute it and/or modify
- *   it under the terms of the GNU General Public License version 2,
- *   as published by the Free Software Foundation.
- *
- *   This program is distributed in the hope that it will be useful,
- *   but WITHOUT ANY WARRANTY; without even the implied warranty of
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *   GNU General Public License for more details.
- *
- *   You should have received a copy of the GNU General Public License
- *   along with this program.  If not, see <http://www.gnu.org/licenses/>.
- *
- */
-package com.owncloud.android.oc_framework.operations;
-
-import java.io.IOException;
-
-import org.apache.commons.httpclient.Credentials;
-
-import com.owncloud.android.oc_framework.network.BearerCredentials;
-import com.owncloud.android.oc_framework.network.webdav.WebdavClient;
-import com.owncloud.android.oc_framework.network.webdav.OwnCloudClientFactory;
-import com.owncloud.android.oc_framework.operations.RemoteOperationResult.ResultCode;
-
-
-
-import android.accounts.Account;
-import android.accounts.AccountManager;
-import android.accounts.AccountsException;
-import android.app.Activity;
-import android.content.Context;
-import android.os.Handler;
-import android.util.Log;
-
-
-/**
- * Operation which execution involves one or several interactions with an ownCloud server.
- * 
- * Provides methods to execute the operation both synchronously or asynchronously.
- * 
- * @author David A. Velasco 
- */
-public abstract class RemoteOperation implements Runnable {
-       
-    private static final String TAG = RemoteOperation.class.getSimpleName();
-
-    /** ownCloud account in the remote ownCloud server to operate */
-    private Account mAccount = null;
-    
-    /** Android Application context */
-    private Context mContext = null;
-    
-       /** Object to interact with the remote server */
-       private WebdavClient mClient = null;
-       
-       /** Callback object to notify about the execution of the remote operation */
-       private OnRemoteOperationListener mListener = null;
-       
-       /** Handler to the thread where mListener methods will be called */
-       private Handler mListenerHandler = null;
-
-       /** Activity */
-    private Activity mCallerActivity;
-
-       
-       /**
-        *  Abstract method to implement the operation in derived classes.
-        */
-       protected abstract RemoteOperationResult run(WebdavClient client); 
-       
-
-    /**
-     * Synchronously executes the remote operation on the received ownCloud account.
-     * 
-     * Do not call this method from the main thread.
-     * 
-     * This method should be used whenever an ownCloud account is available, instead of {@link #execute(WebdavClient)}. 
-     * 
-     * @param account   ownCloud account in remote ownCloud server to reach during the execution of the operation.
-     * @param context   Android context for the component calling the method.
-     * @return          Result of the operation.
-     */
-    public final RemoteOperationResult execute(Account account, Context context) {
-        if (account == null)
-            throw new IllegalArgumentException("Trying to execute a remote operation with a NULL Account");
-        if (context == null)
-            throw new IllegalArgumentException("Trying to execute a remote operation with a NULL Context");
-        mAccount = account;
-        mContext = context.getApplicationContext();
-        try {
-            mClient = OwnCloudClientFactory.createOwnCloudClient(mAccount, mContext);
-        } catch (Exception e) {
-            Log.e(TAG, "Error while trying to access to " + mAccount.name, e);
-            return new RemoteOperationResult(e);
-        }
-        return run(mClient);
-    }
-    
-       
-       /**
-        * Synchronously executes the remote operation
-        * 
-     * Do not call this method from the main thread.
-     * 
-        * @param client        Client object to reach an ownCloud server during the execution of the operation.
-        * @return                      Result of the operation.
-        */
-       public final RemoteOperationResult execute(WebdavClient client) {
-               if (client == null)
-                       throw new IllegalArgumentException("Trying to execute a remote operation with a NULL WebdavClient");
-               mClient = client;
-               return run(client);
-       }
-
-       
-    /**
-     * Asynchronously executes the remote operation
-     * 
-     * This method should be used whenever an ownCloud account is available, instead of {@link #execute(WebdavClient)}. 
-     * 
-     * @param account           ownCloud account in remote ownCloud server to reach during the execution of the operation.
-     * @param context           Android context for the component calling the method.
-     * @param listener          Listener to be notified about the execution of the operation.
-     * @param listenerHandler   Handler associated to the thread where the methods of the listener objects must be called.
-     * @return                  Thread were the remote operation is executed.
-     */
-    public final Thread execute(Account account, Context context, OnRemoteOperationListener listener, Handler listenerHandler, Activity callerActivity) {
-        if (account == null)
-            throw new IllegalArgumentException("Trying to execute a remote operation with a NULL Account");
-        if (context == null)
-            throw new IllegalArgumentException("Trying to execute a remote operation with a NULL Context");
-        mAccount = account;
-        mContext = context.getApplicationContext();
-        mCallerActivity = callerActivity;
-        mClient = null;     // the client instance will be created from mAccount and mContext in the runnerThread to create below
-        
-        mListener = listener;
-        
-        mListenerHandler = listenerHandler;
-        
-        Thread runnerThread = new Thread(this);
-        runnerThread.start();
-        return runnerThread;
-    }
-
-    
-       /**
-        * Asynchronously executes the remote operation
-        * 
-        * @param client                        Client object to reach an ownCloud server during the execution of the operation.
-        * @param listener                      Listener to be notified about the execution of the operation.
-        * @param listenerHandler       Handler associated to the thread where the methods of the listener objects must be called.
-        * @return                                      Thread were the remote operation is executed.
-        */
-       public final Thread execute(WebdavClient client, OnRemoteOperationListener listener, Handler listenerHandler) {
-               if (client == null) {
-                       throw new IllegalArgumentException("Trying to execute a remote operation with a NULL WebdavClient");
-               }
-               mClient = client;
-               
-               if (listener == null) {
-                       throw new IllegalArgumentException("Trying to execute a remote operation asynchronously without a listener to notiy the result");
-               }
-               mListener = listener;
-               
-               if (listenerHandler == null) {
-                       throw new IllegalArgumentException("Trying to execute a remote operation asynchronously without a handler to the listener's thread");
-               }
-               mListenerHandler = listenerHandler;
-               
-               Thread runnerThread = new Thread(this);
-               runnerThread.start();
-               return runnerThread;
-       }
-       
-    /**
-     * Synchronously retries the remote operation using the same WebdavClient in the last call to {@link RemoteOperation#execute(WebdavClient)}
-     * 
-     * @param listener          Listener to be notified about the execution of the operation.
-     * @param listenerHandler   Handler associated to the thread where the methods of the listener objects must be called.
-     * @return                  Thread were the remote operation is executed.
-     */
-    public final RemoteOperationResult retry() {
-        return execute(mClient);
-    }
-    
-    /**
-     * Asynchronously retries the remote operation using the same WebdavClient in the last call to {@link RemoteOperation#execute(WebdavClient, OnRemoteOperationListener, Handler)}
-     * 
-     * @param listener          Listener to be notified about the execution of the operation.
-     * @param listenerHandler   Handler associated to the thread where the methods of the listener objects must be called.
-     * @return                  Thread were the remote operation is executed.
-     */
-    public final Thread retry(OnRemoteOperationListener listener, Handler listenerHandler) {
-        return execute(mClient, listener, listenerHandler);
-    }
-       
-       
-       /**
-        * Asynchronous execution of the operation 
-        * started by {@link RemoteOperation#execute(WebdavClient, OnRemoteOperationListener, Handler)}, 
-        * and result posting.
-        * 
-        * TODO refactor && clean the code; now it's a mess
-        */
-    @Override
-    public final void run() {
-        RemoteOperationResult result = null;
-        boolean repeat = false;
-        do {
-            try{
-                if (mClient == null) {
-                    if (mAccount != null && mContext != null) {
-                        if (mCallerActivity != null) {
-                            mClient = OwnCloudClientFactory.createOwnCloudClient(mAccount, mContext, mCallerActivity);
-                        } else {
-                            mClient = OwnCloudClientFactory.createOwnCloudClient(mAccount, mContext);
-                        }
-                    } else {
-                        throw new IllegalStateException("Trying to run a remote operation asynchronously with no client instance or account");
-                    }
-                }
-            
-            } catch (IOException e) {
-                Log.e(TAG, "Error while trying to access to " + mAccount.name, new AccountsException("I/O exception while trying to authorize the account", e));
-                result = new RemoteOperationResult(e);
-            
-            } catch (AccountsException e) {
-                Log.e(TAG, "Error while trying to access to " + mAccount.name, e);
-                result = new RemoteOperationResult(e);
-            }
-       
-            if (result == null)
-                result = run(mClient);
-        
-            repeat = false;
-            if (mCallerActivity != null && mAccount != null && mContext != null && !result.isSuccess() &&
-//                    (result.getCode() == ResultCode.UNAUTHORIZED || (result.isTemporalRedirection() && result.isIdPRedirection()))) {
-                    (result.getCode() == ResultCode.UNAUTHORIZED || result.isIdPRedirection())) {
-                /// possible fail due to lack of authorization in an operation performed in foreground
-                Credentials cred = mClient.getCredentials();
-                String ssoSessionCookie = mClient.getSsoSessionCookie();
-                if (cred != null || ssoSessionCookie != null) {
-                    /// confirmed : unauthorized operation
-                    AccountManager am = AccountManager.get(mContext);
-                    boolean bearerAuthorization = (cred != null && cred instanceof BearerCredentials);
-                    boolean samlBasedSsoAuthorization = (cred == null && ssoSessionCookie != null);
-                    if (bearerAuthorization) {
-                        am.invalidateAuthToken(mAccount.type, ((BearerCredentials)cred).getAccessToken());
-                    } else if (samlBasedSsoAuthorization ) {
-                        am.invalidateAuthToken(mAccount.type, ssoSessionCookie);
-                    } else {
-                        am.clearPassword(mAccount);
-                    }
-                    mClient = null;
-                    repeat = true;  // when repeated, the creation of a new OwnCloudClient after erasing the saved credentials will trigger the login activity
-                    result = null;
-                }
-            }
-        } while (repeat);
-        
-        final RemoteOperationResult resultToSend = result;
-        if (mListenerHandler != null && mListener != null) {
-               mListenerHandler.post(new Runnable() {
-                @Override
-                public void run() {
-                    mListener.onRemoteOperationFinish(RemoteOperation.this, resultToSend);
-                }
-            });
-        }
-    }
-
-
-    /**
-     * Returns the current client instance to access the remote server.
-     * 
-     * @return      Current client instance to access the remote server.
-     */
-    public final WebdavClient getClient() {
-        return mClient;
-    }
-
-
-}
diff --git a/oc_framework/src/com/owncloud/android/oc_framework/operations/RemoteOperationResult.java b/oc_framework/src/com/owncloud/android/oc_framework/operations/RemoteOperationResult.java
deleted file mode 100644 (file)
index a5f5a39..0000000
+++ /dev/null
@@ -1,356 +0,0 @@
-/* ownCloud Android client application
- *   Copyright (C) 2012 Bartek Przybylski
- *   Copyright (C) 2012-2013 ownCloud Inc.
- *
- *   This program is free software: you can redistribute it and/or modify
- *   it under the terms of the GNU General Public License version 2,
- *   as published by the Free Software Foundation.
- *
- *   This program is distributed in the hope that it will be useful,
- *   but WITHOUT ANY WARRANTY; without even the implied warranty of
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *   GNU General Public License for more details.
- *
- *   You should have received a copy of the GNU General Public License
- *   along with this program.  If not, see <http://www.gnu.org/licenses/>.
- *
- */
-
-package com.owncloud.android.oc_framework.operations;
-
-import java.io.IOException;
-import java.io.Serializable;
-import java.net.MalformedURLException;
-import java.net.SocketException;
-import java.net.SocketTimeoutException;
-import java.net.UnknownHostException;
-import java.util.ArrayList;
-
-import javax.net.ssl.SSLException;
-
-import org.apache.commons.httpclient.ConnectTimeoutException;
-import org.apache.commons.httpclient.Header;
-import org.apache.commons.httpclient.HttpException;
-import org.apache.commons.httpclient.HttpStatus;
-import org.apache.jackrabbit.webdav.DavException;
-import org.json.JSONException;
-
-import com.owncloud.android.oc_framework.accounts.AccountUtils.AccountNotFoundException;
-import com.owncloud.android.oc_framework.network.CertificateCombinedException;
-
-import android.accounts.Account;
-import android.accounts.AccountsException;
-import android.util.Log;
-
-
-/**
- * The result of a remote operation required to an ownCloud server.
- * 
- * Provides a common classification of remote operation results for all the
- * application.
- * 
- * @author David A. Velasco
- */
-public class RemoteOperationResult implements Serializable {
-       
-       /** Generated - should be refreshed every time the class changes!! */
-       private static final long serialVersionUID = -8257349554488668693L;
-    
-    private static final String TAG = "RemoteOperationResult";
-    
-    public enum ResultCode { 
-        OK,
-        OK_SSL,
-        OK_NO_SSL,
-        UNHANDLED_HTTP_CODE,
-        UNAUTHORIZED,        
-        FILE_NOT_FOUND, 
-        INSTANCE_NOT_CONFIGURED, 
-        UNKNOWN_ERROR, 
-        WRONG_CONNECTION,  
-        TIMEOUT, 
-        INCORRECT_ADDRESS, 
-        HOST_NOT_AVAILABLE, 
-        NO_NETWORK_CONNECTION, 
-        SSL_ERROR,
-        SSL_RECOVERABLE_PEER_UNVERIFIED,
-        BAD_OC_VERSION,
-        CANCELLED, 
-        INVALID_LOCAL_FILE_NAME, 
-        INVALID_OVERWRITE,
-        CONFLICT, 
-        OAUTH2_ERROR,
-        SYNC_CONFLICT,
-        LOCAL_STORAGE_FULL, 
-        LOCAL_STORAGE_NOT_MOVED, 
-        LOCAL_STORAGE_NOT_COPIED, 
-        OAUTH2_ERROR_ACCESS_DENIED,
-        QUOTA_EXCEEDED, 
-        ACCOUNT_NOT_FOUND, 
-        ACCOUNT_EXCEPTION, 
-        ACCOUNT_NOT_NEW, 
-        ACCOUNT_NOT_THE_SAME,
-        INVALID_CHARACTER_IN_NAME
-    }
-
-    private boolean mSuccess = false;
-    private int mHttpCode = -1;
-    private Exception mException = null;
-    private ResultCode mCode = ResultCode.UNKNOWN_ERROR;
-    private String mRedirectedLocation;
-
-    private ArrayList<RemoteFile> mFiles;
-    
-    public RemoteOperationResult(ResultCode code) {
-        mCode = code;
-        mSuccess = (code == ResultCode.OK || code == ResultCode.OK_SSL || code == ResultCode.OK_NO_SSL);
-        mFiles = null;
-    }
-
-    private RemoteOperationResult(boolean success, int httpCode) {
-        mSuccess = success;
-        mHttpCode = httpCode;
-
-        if (success) {
-            mCode = ResultCode.OK;
-
-        } else if (httpCode > 0) {
-            switch (httpCode) {
-            case HttpStatus.SC_UNAUTHORIZED:
-                mCode = ResultCode.UNAUTHORIZED;
-                break;
-            case HttpStatus.SC_NOT_FOUND:
-                mCode = ResultCode.FILE_NOT_FOUND;
-                break;
-            case HttpStatus.SC_INTERNAL_SERVER_ERROR:
-                mCode = ResultCode.INSTANCE_NOT_CONFIGURED;
-                break;
-            case HttpStatus.SC_CONFLICT:
-                mCode = ResultCode.CONFLICT;
-                break;
-            case HttpStatus.SC_INSUFFICIENT_STORAGE:
-                mCode = ResultCode.QUOTA_EXCEEDED;
-                break;
-            default:
-                mCode = ResultCode.UNHANDLED_HTTP_CODE;
-                Log.d(TAG, "RemoteOperationResult has processed UNHANDLED_HTTP_CODE: " + httpCode);
-            }
-        }
-    }
-    
-    public RemoteOperationResult(boolean success, int httpCode, Header[] headers) {
-        this(success, httpCode);
-        if (headers != null) {
-            Header current;
-            for (int i=0; i<headers.length; i++) {
-                current = headers[i];
-                if ("Location".equals(current.getName())) {
-                    mRedirectedLocation = current.getValue();
-                    break;
-                }
-            }
-        }
-    }    
-
-    public RemoteOperationResult(Exception e) {
-        mException = e;
-
-        if (e instanceof OperationCancelledException) {
-            mCode = ResultCode.CANCELLED;
-
-        } else if (e instanceof SocketException) {
-            mCode = ResultCode.WRONG_CONNECTION;
-
-        } else if (e instanceof SocketTimeoutException) {
-            mCode = ResultCode.TIMEOUT;
-
-        } else if (e instanceof ConnectTimeoutException) {
-            mCode = ResultCode.TIMEOUT;
-
-        } else if (e instanceof MalformedURLException) {
-            mCode = ResultCode.INCORRECT_ADDRESS;
-
-        } else if (e instanceof UnknownHostException) {
-            mCode = ResultCode.HOST_NOT_AVAILABLE;
-
-        } else if (e instanceof AccountNotFoundException) {
-            mCode = ResultCode.ACCOUNT_NOT_FOUND;
-            
-        } else if (e instanceof AccountsException) {
-            mCode = ResultCode.ACCOUNT_EXCEPTION;
-            
-        } else if (e instanceof SSLException || e instanceof RuntimeException) {
-            CertificateCombinedException se = getCertificateCombinedException(e);
-            if (se != null) {
-                mException = se;
-                if (se.isRecoverable()) {
-                    mCode = ResultCode.SSL_RECOVERABLE_PEER_UNVERIFIED;
-                }
-            } else if (e instanceof RuntimeException) {
-                mCode = ResultCode.HOST_NOT_AVAILABLE;
-
-            } else {
-                mCode = ResultCode.SSL_ERROR;
-            }
-
-        } else {
-            mCode = ResultCode.UNKNOWN_ERROR;
-        }
-
-    }
-
-
-    public void setData(ArrayList<RemoteFile> files){
-       mFiles = files;
-    }
-    
-       public ArrayList<RemoteFile> getData(){
-               return mFiles;
-       }
-    
-    public boolean isSuccess() {
-        return mSuccess;
-    }
-
-    public boolean isCancelled() {
-        return mCode == ResultCode.CANCELLED;
-    }
-
-    public int getHttpCode() {
-        return mHttpCode;
-    }
-
-    public ResultCode getCode() {
-        return mCode;
-    }
-
-    public Exception getException() {
-        return mException;
-    }
-
-    public boolean isSslRecoverableException() {
-        return mCode == ResultCode.SSL_RECOVERABLE_PEER_UNVERIFIED;
-    }
-
-    private CertificateCombinedException getCertificateCombinedException(Exception e) {
-        CertificateCombinedException result = null;
-        if (e instanceof CertificateCombinedException) {
-            return (CertificateCombinedException) e;
-        }
-        Throwable cause = mException.getCause();
-        Throwable previousCause = null;
-        while (cause != null && cause != previousCause && !(cause instanceof CertificateCombinedException)) {
-            previousCause = cause;
-            cause = cause.getCause();
-        }
-        if (cause != null && cause instanceof CertificateCombinedException) {
-            result = (CertificateCombinedException) cause;
-        }
-        return result;
-    }
-
-    public String getLogMessage() {
-
-        if (mException != null) {
-            if (mException instanceof OperationCancelledException) {
-                return "Operation cancelled by the caller";
-
-            } else if (mException instanceof SocketException) {
-                return "Socket exception";
-
-            } else if (mException instanceof SocketTimeoutException) {
-                return "Socket timeout exception";
-
-            } else if (mException instanceof ConnectTimeoutException) {
-                return "Connect timeout exception";
-
-            } else if (mException instanceof MalformedURLException) {
-                return "Malformed URL exception";
-
-            } else if (mException instanceof UnknownHostException) {
-                return "Unknown host exception";
-
-            } else if (mException instanceof CertificateCombinedException) {
-                if (((CertificateCombinedException) mException).isRecoverable())
-                    return "SSL recoverable exception";
-                else
-                    return "SSL exception";
-
-            } else if (mException instanceof SSLException) {
-                return "SSL exception";
-
-            } else if (mException instanceof DavException) {
-                return "Unexpected WebDAV exception";
-
-            } else if (mException instanceof HttpException) {
-                return "HTTP violation";
-
-            } else if (mException instanceof IOException) {
-                return "Unrecovered transport exception";
-
-            } else if (mException instanceof AccountNotFoundException) {
-                Account failedAccount = ((AccountNotFoundException)mException).getFailedAccount();
-                return mException.getMessage() + " (" + (failedAccount != null ? failedAccount.name : "NULL") + ")";
-                
-            } else if (mException instanceof AccountsException) {
-                return "Exception while using account";
-                
-            } else if (mException instanceof JSONException) {
-               return "JSON exception";
-               
-            } else {
-                return "Unexpected exception";
-            }
-        }
-
-        if (mCode == ResultCode.INSTANCE_NOT_CONFIGURED) {
-            return "The ownCloud server is not configured!";
-
-        } else if (mCode == ResultCode.NO_NETWORK_CONNECTION) {
-            return "No network connection";
-
-        } else if (mCode == ResultCode.BAD_OC_VERSION) {
-            return "No valid ownCloud version was found at the server";
-
-        } else if (mCode == ResultCode.LOCAL_STORAGE_FULL) {
-            return "Local storage full";
-
-        } else if (mCode == ResultCode.LOCAL_STORAGE_NOT_MOVED) {
-            return "Error while moving file to final directory";
-
-        } else if (mCode == ResultCode.ACCOUNT_NOT_NEW) {
-            return "Account already existing when creating a new one";
-
-        } else if (mCode == ResultCode.ACCOUNT_NOT_THE_SAME) {
-            return "Authenticated with a different account than the one updating";
-        } else if (mCode == ResultCode.INVALID_CHARACTER_IN_NAME) {
-                return "The file name contains an forbidden character";
-        }
-
-        return "Operation finished with HTTP status code " + mHttpCode + " (" + (isSuccess() ? "success" : "fail") + ")";
-
-    }
-
-    public boolean isServerFail() {
-        return (mHttpCode >= HttpStatus.SC_INTERNAL_SERVER_ERROR);
-    }
-
-    public boolean isException() {
-        return (mException != null);
-    }
-
-    public boolean isTemporalRedirection() {
-        return (mHttpCode == 302 || mHttpCode == 307);
-    }
-
-    public String getRedirectedLocation() {
-        return mRedirectedLocation;
-    }
-    
-    public boolean isIdPRedirection() {
-        return (mRedirectedLocation != null &&
-                (mRedirectedLocation.toUpperCase().contains("SAML") || 
-                mRedirectedLocation.toLowerCase().contains("wayf")));
-    }
-
-}
diff --git a/oc_framework/src/com/owncloud/android/oc_framework/operations/remote/ChunkedUploadRemoteFileOperation.java b/oc_framework/src/com/owncloud/android/oc_framework/operations/remote/ChunkedUploadRemoteFileOperation.java
deleted file mode 100644 (file)
index 4df5fea..0000000
+++ /dev/null
@@ -1,94 +0,0 @@
-/* ownCloud Android client application
- *   Copyright (C) 2012 Bartek Przybylski
- *   Copyright (C) 2012-2013 ownCloud Inc.
- *
- *   This program is free software: you can redistribute it and/or modify
- *   it under the terms of the GNU General Public License version 2,
- *   as published by the Free Software Foundation.
- *
- *   This program is distributed in the hope that it will be useful,
- *   but WITHOUT ANY WARRANTY; without even the implied warranty of
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *   GNU General Public License for more details.
- *
- *   You should have received a copy of the GNU General Public License
- *   along with this program.  If not, see <http://www.gnu.org/licenses/>.
- *
- */
-
-package com.owncloud.android.oc_framework.operations.remote;
-
-import java.io.File;
-import java.io.IOException;
-import java.io.RandomAccessFile;
-import java.nio.channels.FileChannel;
-import java.util.Random;
-
-import org.apache.commons.httpclient.HttpException;
-import org.apache.commons.httpclient.methods.PutMethod;
-
-import com.owncloud.android.oc_framework.network.ProgressiveDataTransferer;
-import com.owncloud.android.oc_framework.network.webdav.ChunkFromFileChannelRequestEntity;
-import com.owncloud.android.oc_framework.network.webdav.WebdavClient;
-import com.owncloud.android.oc_framework.network.webdav.WebdavUtils;
-
-
-import android.util.Log;
-
-
-public class ChunkedUploadRemoteFileOperation extends UploadRemoteFileOperation {
-    
-    public static final long CHUNK_SIZE = 1024000;
-    private static final String OC_CHUNKED_HEADER = "OC-Chunked";
-    private static final String TAG = ChunkedUploadRemoteFileOperation.class.getSimpleName();
-
-    public ChunkedUploadRemoteFileOperation(String storagePath, String remotePath, String mimeType) {
-                super(storagePath, remotePath, mimeType);      
-       }
-    
-    @Override
-    protected int uploadFile(WebdavClient client) throws HttpException, IOException {
-        int status = -1;
-
-        FileChannel channel = null;
-        RandomAccessFile raf = null;
-        try {
-            File file = new File(mStoragePath);
-            raf = new RandomAccessFile(file, "r");
-            channel = raf.getChannel();
-            mEntity = new ChunkFromFileChannelRequestEntity(channel, mMimeType, CHUNK_SIZE, file);
-            //((ProgressiveDataTransferer)mEntity).addDatatransferProgressListeners(getDataTransferListeners());
-            synchronized (mDataTransferListeners) {
-                               ((ProgressiveDataTransferer)mEntity).addDatatransferProgressListeners(mDataTransferListeners);
-                       }
-            
-            long offset = 0;
-            String uriPrefix = client.getBaseUri() + WebdavUtils.encodePath(mRemotePath) + "-chunking-" + Math.abs((new Random()).nextInt(9000)+1000) + "-" ;
-            long chunkCount = (long) Math.ceil((double)file.length() / CHUNK_SIZE);
-            for (int chunkIndex = 0; chunkIndex < chunkCount ; chunkIndex++, offset += CHUNK_SIZE) {
-                if (mPutMethod != null) {
-                    mPutMethod.releaseConnection();    // let the connection available for other methods
-                }
-                mPutMethod = new PutMethod(uriPrefix + chunkCount + "-" + chunkIndex);
-                mPutMethod.addRequestHeader(OC_CHUNKED_HEADER, OC_CHUNKED_HEADER);
-                ((ChunkFromFileChannelRequestEntity)mEntity).setOffset(offset);
-                mPutMethod.setRequestEntity(mEntity);
-                status = client.executeMethod(mPutMethod);
-                client.exhaustResponse(mPutMethod.getResponseBodyAsStream());
-                Log.d(TAG, "Upload of " + mStoragePath + " to " + mRemotePath + ", chunk index " + chunkIndex + ", count " + chunkCount + ", HTTP result status " + status);
-                if (!isSuccess(status))
-                    break;
-            }
-            
-        } finally {
-            if (channel != null)
-                channel.close();
-            if (raf != null)
-                raf.close();
-            if (mPutMethod != null)
-                mPutMethod.releaseConnection();    // let the connection available for other methods
-        }
-        return status;
-    }
-
-}
diff --git a/oc_framework/src/com/owncloud/android/oc_framework/operations/remote/CreateRemoteFolderOperation.java b/oc_framework/src/com/owncloud/android/oc_framework/operations/remote/CreateRemoteFolderOperation.java
deleted file mode 100644 (file)
index 4e756da..0000000
+++ /dev/null
@@ -1,111 +0,0 @@
-/* ownCloud Android client application
- *   Copyright (C) 2012-2013 ownCloud Inc.
- *
- *   This program is free software: you can redistribute it and/or modify
- *   it under the terms of the GNU General Public License version 2,
- *   as published by the Free Software Foundation.
- *
- *   This program is distributed in the hope that it will be useful,
- *   but WITHOUT ANY WARRANTY; without even the implied warranty of
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *   GNU General Public License for more details.
- *
- *   You should have received a copy of the GNU General Public License
- *   along with this program.  If not, see <http://www.gnu.org/licenses/>.
- *
- */
-
-package com.owncloud.android.oc_framework.operations.remote;
-
-import org.apache.commons.httpclient.HttpStatus;
-import org.apache.jackrabbit.webdav.client.methods.MkColMethod;
-
-import android.util.Log;
-
-import com.owncloud.android.oc_framework.network.webdav.WebdavClient;
-import com.owncloud.android.oc_framework.network.webdav.WebdavUtils;
-import com.owncloud.android.oc_framework.operations.RemoteOperation;
-import com.owncloud.android.oc_framework.operations.RemoteOperationResult;
-import com.owncloud.android.oc_framework.operations.RemoteOperationResult.ResultCode;
-import com.owncloud.android.oc_framework.utils.FileUtils;
-
-
-
-/**
- * Remote operation performing the creation of a new folder in the ownCloud server.
- * 
- * @author David A. Velasco 
- * @author masensio
- *
- */
-public class CreateRemoteFolderOperation extends RemoteOperation {
-    
-    private static final String TAG = CreateRemoteFolderOperation.class.getSimpleName();
-
-    private static final int READ_TIMEOUT = 10000;
-    private static final int CONNECTION_TIMEOUT = 5000;
-    
-
-    protected String mRemotePath;
-    protected boolean mCreateFullPath;
-    
-    /**
-     * Constructor
-     * 
-     * @param remotePath            Full path to the new directory to create in the remote server.
-     * @param createFullPath        'True' means that all the ancestor folders should be created if don't exist yet.
-     */
-    public CreateRemoteFolderOperation(String remotePath, boolean createFullPath) {
-        mRemotePath = remotePath;
-        mCreateFullPath = createFullPath;
-    }
-
-    /**
-     * Performs the operation
-     * 
-     * @param   client      Client object to communicate with the remote ownCloud server.
-     */
-    @Override
-    protected RemoteOperationResult run(WebdavClient client) {
-        RemoteOperationResult result = null;
-        MkColMethod mkcol = null;
-        
-        boolean noInvalidChars = FileUtils.isValidPath(mRemotePath);
-        if (noInvalidChars) {
-               try {
-                       mkcol = new MkColMethod(client.getBaseUri() + WebdavUtils.encodePath(mRemotePath));
-                       int status =  client.executeMethod(mkcol, READ_TIMEOUT, CONNECTION_TIMEOUT);
-                       if (!mkcol.succeeded() && mkcol.getStatusCode() == HttpStatus.SC_CONFLICT && mCreateFullPath) {
-                               result = createParentFolder(FileUtils.getParentPath(mRemotePath), client);
-                               status = client.executeMethod(mkcol, READ_TIMEOUT, CONNECTION_TIMEOUT);    // second (and last) try
-                       }
-
-                       result = new RemoteOperationResult(mkcol.succeeded(), status, mkcol.getResponseHeaders());
-                       Log.d(TAG, "Create directory " + mRemotePath + ": " + result.getLogMessage());
-                       client.exhaustResponse(mkcol.getResponseBodyAsStream());
-
-               } catch (Exception e) {
-                       result = new RemoteOperationResult(e);
-                       Log.e(TAG, "Create directory " + mRemotePath + ": " + result.getLogMessage(), e);
-
-               } finally {
-                       if (mkcol != null)
-                               mkcol.releaseConnection();
-               }
-        } else {
-               result = new RemoteOperationResult(ResultCode.INVALID_CHARACTER_IN_NAME);
-        }
-        
-        return result;
-    }
-
-    
-    private RemoteOperationResult createParentFolder(String parentPath, WebdavClient client) {
-        RemoteOperation operation = new CreateRemoteFolderOperation(parentPath,
-                                                                mCreateFullPath);
-        return operation.execute(client);
-    }
-    
-   
-
-}
diff --git a/oc_framework/src/com/owncloud/android/oc_framework/operations/remote/DownloadRemoteFileOperation.java b/oc_framework/src/com/owncloud/android/oc_framework/operations/remote/DownloadRemoteFileOperation.java
deleted file mode 100644 (file)
index e3e7ee0..0000000
+++ /dev/null
@@ -1,169 +0,0 @@
-/* ownCloud Android client application
- *   Copyright (C) 2012-2013 ownCloud Inc.
- *
- *   This program is free software: you can redistribute it and/or modify
- *   it under the terms of the GNU General Public License version 2,
- *   as published by the Free Software Foundation.
- *
- *   This program is distributed in the hope that it will be useful,
- *   but WITHOUT ANY WARRANTY; without even the implied warranty of
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *   GNU General Public License for more details.
- *
- *   You should have received a copy of the GNU General Public License
- *   along with this program.  If not, see <http://www.gnu.org/licenses/>.
- *
- */
-
-package com.owncloud.android.oc_framework.operations.remote;
-
-import java.io.BufferedInputStream;
-import java.io.File;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.util.Date;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.Set;
-import java.util.concurrent.atomic.AtomicBoolean;
-
-import org.apache.commons.httpclient.Header;
-import org.apache.commons.httpclient.HttpException;
-import org.apache.commons.httpclient.methods.GetMethod;
-import org.apache.http.HttpStatus;
-
-import android.util.Log;
-
-import com.owncloud.android.oc_framework.network.webdav.OnDatatransferProgressListener;
-import com.owncloud.android.oc_framework.network.webdav.WebdavClient;
-import com.owncloud.android.oc_framework.network.webdav.WebdavUtils;
-import com.owncloud.android.oc_framework.operations.OperationCancelledException;
-import com.owncloud.android.oc_framework.operations.RemoteFile;
-import com.owncloud.android.oc_framework.operations.RemoteOperation;
-import com.owncloud.android.oc_framework.operations.RemoteOperationResult;
-
-/**
- * Remote operation performing the download of a remote file in the ownCloud server.
- * 
- * @author David A. Velasco
- * @author masensio
- */
-
-public class DownloadRemoteFileOperation extends RemoteOperation {
-       
-       private static final String TAG = DownloadRemoteFileOperation.class.getSimpleName();
-    
-       private Set<OnDatatransferProgressListener> mDataTransferListeners = new HashSet<OnDatatransferProgressListener>();
-    private final AtomicBoolean mCancellationRequested = new AtomicBoolean(false);
-    private long mModificationTimestamp = 0;
-    private GetMethod mGet;
-    
-    private RemoteFile mRemoteFile;
-    private String mTemporalFolder;
-       
-       public DownloadRemoteFileOperation(RemoteFile remoteFile, String temporalFolder) {
-               mRemoteFile = remoteFile;
-               mTemporalFolder = temporalFolder;
-       }
-
-       @Override
-       protected RemoteOperationResult run(WebdavClient client) {
-               RemoteOperationResult result = null;
-        
-        /// download will be performed to a temporal file, then moved to the final location
-        File tmpFile = new File(getTmpPath());
-        
-        /// perform the download
-        try {
-               tmpFile.getParentFile().mkdirs();
-               int status = downloadFile(client, tmpFile);
-               result = new RemoteOperationResult(isSuccess(status), status, (mGet != null ? mGet.getResponseHeaders() : null));
-               Log.i(TAG, "Download of " + mRemoteFile.getRemotePath() + " to " + getTmpPath() + ": " + result.getLogMessage());
-
-        } catch (Exception e) {
-            result = new RemoteOperationResult(e);
-            Log.e(TAG, "Download of " + mRemoteFile.getRemotePath() + " to " + getTmpPath() + ": " + result.getLogMessage(), e);
-        }
-        
-        return result;
-       }
-
-       
-    protected int downloadFile(WebdavClient client, File targetFile) throws HttpException, IOException, OperationCancelledException {
-        int status = -1;
-        boolean savedFile = false;
-        mGet = new GetMethod(client.getBaseUri() + WebdavUtils.encodePath(mRemoteFile.getRemotePath()));
-        Iterator<OnDatatransferProgressListener> it = null;
-        
-        FileOutputStream fos = null;
-        try {
-            status = client.executeMethod(mGet);
-            if (isSuccess(status)) {
-                targetFile.createNewFile();
-                BufferedInputStream bis = new BufferedInputStream(mGet.getResponseBodyAsStream());
-                fos = new FileOutputStream(targetFile);
-                long transferred = 0;
-
-                byte[] bytes = new byte[4096];
-                int readResult = 0;
-                while ((readResult = bis.read(bytes)) != -1) {
-                    synchronized(mCancellationRequested) {
-                        if (mCancellationRequested.get()) {
-                            mGet.abort();
-                            throw new OperationCancelledException();
-                        }
-                    }
-                    fos.write(bytes, 0, readResult);
-                    transferred += readResult;
-                    synchronized (mDataTransferListeners) {
-                        it = mDataTransferListeners.iterator();
-                        while (it.hasNext()) {
-                            it.next().onTransferProgress(readResult, transferred, mRemoteFile.getLength(), targetFile.getName());
-                        }
-                    }
-                }
-                savedFile = true;
-                Header modificationTime = mGet.getResponseHeader("Last-Modified");
-                if (modificationTime != null) {
-                    Date d = WebdavUtils.parseResponseDate((String) modificationTime.getValue());
-                    mModificationTimestamp = (d != null) ? d.getTime() : 0;
-                }
-                
-            } else {
-                client.exhaustResponse(mGet.getResponseBodyAsStream());
-            }
-                
-        } finally {
-            if (fos != null) fos.close();
-            if (!savedFile && targetFile.exists()) {
-                targetFile.delete();
-            }
-            mGet.releaseConnection();    // let the connection available for other methods
-        }
-        return status;
-    }
-    
-    private boolean isSuccess(int status) {
-        return (status == HttpStatus.SC_OK);
-    }
-    
-    private String getTmpPath() {
-        return mTemporalFolder + mRemoteFile.getRemotePath();
-    }
-    
-    public void addDatatransferProgressListener (OnDatatransferProgressListener listener) {
-        synchronized (mDataTransferListeners) {
-            mDataTransferListeners.add(listener);
-        }
-    }
-    
-    public void removeDatatransferProgressListener(OnDatatransferProgressListener listener) {
-        synchronized (mDataTransferListeners) {
-            mDataTransferListeners.remove(listener);
-        }
-    }
-    
-    public void cancel() {
-        mCancellationRequested.set(true);   // atomic set; there is no need of synchronizing it
-    }
-}
diff --git a/oc_framework/src/com/owncloud/android/oc_framework/operations/remote/ExistenceCheckRemoteOperation.java b/oc_framework/src/com/owncloud/android/oc_framework/operations/remote/ExistenceCheckRemoteOperation.java
deleted file mode 100644 (file)
index 88e6e81..0000000
+++ /dev/null
@@ -1,97 +0,0 @@
-/* ownCloud Android client application
- *   Copyright (C) 2012 ownCloud Inc.
- *
- *   This program is free software: you can redistribute it and/or modify
- *   it under the terms of the GNU General Public License version 2,
- *   as published by the Free Software Foundation.
- *
- *   This program is distributed in the hope that it will be useful,
- *   but WITHOUT ANY WARRANTY; without even the implied warranty of
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *   GNU General Public License for more details.
- *
- *   You should have received a copy of the GNU General Public License
- *   along with this program.  If not, see <http://www.gnu.org/licenses/>.
- *
- */
-
-package com.owncloud.android.oc_framework.operations.remote;
-
-import org.apache.commons.httpclient.HttpStatus;
-import org.apache.commons.httpclient.methods.HeadMethod;
-
-import com.owncloud.android.oc_framework.network.webdav.WebdavClient;
-import com.owncloud.android.oc_framework.operations.RemoteOperation;
-import com.owncloud.android.oc_framework.operations.RemoteOperationResult;
-import com.owncloud.android.oc_framework.network.webdav.WebdavUtils;
-
-import android.content.Context;
-import android.net.ConnectivityManager;
-import android.util.Log;
-
-/**
- * Operation to check the existence or absence of a path in a remote server.
- * 
- * @author David A. Velasco
- */
-public class ExistenceCheckRemoteOperation extends RemoteOperation {
-    
-    /** Maximum time to wait for a response from the server in MILLISECONDs.  */
-    public static final int TIMEOUT = 10000;
-    
-    private static final String TAG = ExistenceCheckRemoteOperation.class.getSimpleName();
-    
-    private String mPath;
-    private Context mContext;
-    private boolean mSuccessIfAbsent;
-
-    
-    /**
-     * 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 context           Android application context.
-     * @param successIfAbsent   When 'true', the operation finishes in success if the path does NOT exist in the remote server (HTTP 404).
-     */
-    public ExistenceCheckRemoteOperation(String path, Context context, boolean successIfAbsent) {
-        mPath = (path != null) ? path : "";
-        mContext = context;
-        mSuccessIfAbsent = successIfAbsent;
-    }
-    
-
-       @Override
-       protected RemoteOperationResult run(WebdavClient client) {
-        if (!isOnline()) {
-            return new RemoteOperationResult(RemoteOperationResult.ResultCode.NO_NETWORK_CONNECTION);
-        }
-        RemoteOperationResult result = null;
-        HeadMethod head = null;
-        try {
-            head = new HeadMethod(client.getBaseUri() + WebdavUtils.encodePath(mPath));
-            int status = client.executeMethod(head, TIMEOUT, TIMEOUT);
-            client.exhaustResponse(head.getResponseBodyAsStream());
-            boolean success = (status == HttpStatus.SC_OK && !mSuccessIfAbsent) || (status == HttpStatus.SC_NOT_FOUND && mSuccessIfAbsent);
-            result = new RemoteOperationResult(success, status, head.getResponseHeaders());
-            Log.d(TAG, "Existence check for " + client.getBaseUri() + WebdavUtils.encodePath(mPath) + " targeting for " + (mSuccessIfAbsent ? " absence " : " existence ") + "finished with HTTP status " + status + (!success?"(FAIL)":""));
-            
-        } catch (Exception e) {
-            result = new RemoteOperationResult(e);
-            Log.e(TAG, "Existence check for " + client.getBaseUri() + WebdavUtils.encodePath(mPath) + " targeting for " + (mSuccessIfAbsent ? " absence " : " existence ") + ": " + result.getLogMessage(), result.getException());
-            
-        } finally {
-            if (head != null)
-                head.releaseConnection();
-        }
-        return result;
-       }
-
-    private boolean isOnline() {
-        ConnectivityManager cm = (ConnectivityManager) mContext
-                .getSystemService(Context.CONNECTIVITY_SERVICE);
-        return cm != null && cm.getActiveNetworkInfo() != null
-                && cm.getActiveNetworkInfo().isConnectedOrConnecting();
-    }
-
-
-}
diff --git a/oc_framework/src/com/owncloud/android/oc_framework/operations/remote/GetUserNameRemoteOperation.java b/oc_framework/src/com/owncloud/android/oc_framework/operations/remote/GetUserNameRemoteOperation.java
deleted file mode 100644 (file)
index 717fae2..0000000
+++ /dev/null
@@ -1,127 +0,0 @@
-
-/* ownCloud Android client application
- *   Copyright (C) 2012-2013 ownCloud Inc.
- *
- *   This program is free software: you can redistribute it and/or modify
- *   it under the terms of the GNU General Public License version 2,
- *   as published by the Free Software Foundation.
- *
- *   This program is distributed in the hope that it will be useful,
- *   but WITHOUT ANY WARRANTY; without even the implied warranty of
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *   GNU General Public License for more details.
- *
- *   You should have received a copy of the GNU General Public License
- *   along with this program.  If not, see <http://www.gnu.org/licenses/>.
- *
- */
-package com.owncloud.android.oc_framework.operations.remote;
-
-import java.io.IOException;
-
-import org.apache.commons.httpclient.HttpException;
-import org.apache.commons.httpclient.methods.GetMethod;
-import org.apache.http.HttpStatus;
-import org.json.JSONException;
-import org.json.JSONObject;
-
-import android.util.Log;
-
-import com.owncloud.android.oc_framework.network.webdav.WebdavClient;
-import com.owncloud.android.oc_framework.operations.RemoteOperation;
-import com.owncloud.android.oc_framework.operations.RemoteOperationResult;
-
-
-/**
- * @author masensio
- *
- * Get the UserName for a SAML connection, from a JSON with the format:
- *             id
- *             display-name
- *             email
- */
-
-public class GetUserNameRemoteOperation extends RemoteOperation {
-       
-       private static final String TAG = GetUserNameRemoteOperation.class.getSimpleName();
-
-       // HEADER
-       private static final String HEADER_OCS_API = "OCS-APIREQUEST";
-       private static final String HEADER_OCS_API_VALUE = "true";
-
-       // OCS Route
-       private static final String OCS_ROUTE ="/index.php/ocs/cloud/user?format=json"; 
-
-       // JSON Node names
-       private static final String NODE_OCS = "ocs";
-       private static final String NODE_DATA = "data";
-       private static final String NODE_ID = "id";
-       private static final String NODE_DISPLAY_NAME= "display-name";
-       private static final String NODE_EMAIL= "email";
-
-       private String mUserName;
-
-       public String getUserName() {
-               return mUserName;
-       }
-
-       
-       public GetUserNameRemoteOperation() {
-       }
-
-       @Override
-       protected RemoteOperationResult run(WebdavClient client) {
-        RemoteOperationResult result = null;
-        int status = -1;
-        
-        // Get Method
-        GetMethod get = new GetMethod(client.getBaseUri() + OCS_ROUTE);
-        Log.d(TAG, "URL ------> " + client.getBaseUri() + OCS_ROUTE);
-        // Add the Header
-        get.addRequestHeader(HEADER_OCS_API, HEADER_OCS_API_VALUE);
-        
-        //Get the user
-        try {
-                       status = client.executeMethod(get);
-                       if(isSuccess(status)) {
-                                Log.d(TAG, "Obtain RESPONSE");
-                                String response = get.getResponseBodyAsString();
-                                
-                                Log.d(TAG, "GET RESPONSE.................... " + response);
-
-                                // Parse the response
-                                JSONObject respJSON = new JSONObject(response);
-                                JSONObject respOCS = respJSON.getJSONObject(NODE_OCS);
-                                JSONObject respData = respOCS.getJSONObject(NODE_DATA);
-                                String id = respData.getString(NODE_ID);
-                                String displayName = respData.getString(NODE_DISPLAY_NAME);
-                                String email = respData.getString(NODE_EMAIL);
-                                
-                                // Result
-                                result = new RemoteOperationResult(isSuccess(status), status, (get != null ? get.getResponseHeaders() : null));
-                                mUserName =  displayName;
-                                
-                                Log.d(TAG, "Response: " + id + " - " + displayName + " - " + email);
-                                
-                       }
-               } catch (HttpException e) {
-                       result = new RemoteOperationResult(e);
-                       e.printStackTrace();
-               } catch (IOException e) {
-                       result = new RemoteOperationResult(e);
-                       e.printStackTrace();
-               } catch (JSONException e) {
-                       result = new RemoteOperationResult(e);
-                       e.printStackTrace();
-               } finally {
-                       get.releaseConnection();
-               }
-        
-               return result;
-       }
-
-    private boolean isSuccess(int status) {
-        return (status == HttpStatus.SC_OK);
-    }
-    
-}
diff --git a/oc_framework/src/com/owncloud/android/oc_framework/operations/remote/ReadRemoteFileOperation.java b/oc_framework/src/com/owncloud/android/oc_framework/operations/remote/ReadRemoteFileOperation.java
deleted file mode 100644 (file)
index 6cdacad..0000000
+++ /dev/null
@@ -1,108 +0,0 @@
-/* ownCloud Android client application
- *   Copyright (C) 2012-2013 ownCloud Inc.
- *
- *   This program is free software: you can redistribute it and/or modify
- *   it under the terms of the GNU General Public License version 2,
- *   as published by the Free Software Foundation.
- *
- *   This program is distributed in the hope that it will be useful,
- *   but WITHOUT ANY WARRANTY; without even the implied warranty of
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *   GNU General Public License for more details.
- *
- *   You should have received a copy of the GNU General Public License
- *   along with this program.  If not, see <http://www.gnu.org/licenses/>.
- *
- */
-package com.owncloud.android.oc_framework.operations.remote;
-
-import java.util.ArrayList;
-
-import org.apache.http.HttpStatus;
-import org.apache.jackrabbit.webdav.DavConstants;
-import org.apache.jackrabbit.webdav.MultiStatus;
-import org.apache.jackrabbit.webdav.client.methods.PropFindMethod;
-
-import android.util.Log;
-
-import com.owncloud.android.oc_framework.network.webdav.WebdavClient;
-import com.owncloud.android.oc_framework.network.webdav.WebdavEntry;
-import com.owncloud.android.oc_framework.network.webdav.WebdavUtils;
-import com.owncloud.android.oc_framework.operations.RemoteFile;
-import com.owncloud.android.oc_framework.operations.RemoteOperation;
-import com.owncloud.android.oc_framework.operations.RemoteOperationResult;
-
-
-/**
- * Remote operation performing the read a file from the ownCloud server.
- * 
- * @author David A. Velasco
- * @author masensio
- */
-
-public class ReadRemoteFileOperation extends RemoteOperation {
-
-    private static final String TAG = ReadRemoteFileOperation.class.getSimpleName();
-    private static final int SYNC_READ_TIMEOUT = 10000;
-    private static final int SYNC_CONNECTION_TIMEOUT = 5000;
-    
-    private String mRemotePath;
-    
-       
-    /**
-     * Constructor
-     * 
-     * @param remotePath               Remote path of the file. 
-     */
-    public ReadRemoteFileOperation(String remotePath) {
-       mRemotePath = remotePath;
-    }
-
-    /**
-     * Performs the read operation.
-     * 
-     * @param client           Client object to communicate with the remote ownCloud server.
-     */
-    @Override
-    protected RemoteOperationResult run(WebdavClient client) {
-       PropFindMethod propfind = null;
-       RemoteOperationResult result = null;
-
-       /// take the duty of check the server for the current state of the file there
-       try {
-               propfind = new PropFindMethod(client.getBaseUri() + WebdavUtils.encodePath(mRemotePath),
-                               DavConstants.PROPFIND_ALL_PROP,
-                               DavConstants.DEPTH_0);
-               int status;
-               status = client.executeMethod(propfind, SYNC_READ_TIMEOUT, SYNC_CONNECTION_TIMEOUT);
-
-               boolean isMultiStatus = status == HttpStatus.SC_MULTI_STATUS;
-               if (isMultiStatus) {
-                       // Parse response
-                       MultiStatus resp = propfind.getResponseBodyAsMultiStatus();
-                               WebdavEntry we = new WebdavEntry(resp.getResponses()[0], client.getBaseUri().getPath());
-                               RemoteFile remoteFile = new RemoteFile(we);
-                               ArrayList<RemoteFile> files = new ArrayList<RemoteFile>();
-                               files.add(remoteFile);
-
-                       // Result of the operation
-                       result = new RemoteOperationResult(true, status, propfind.getResponseHeaders());
-                       result.setData(files);
-                       
-               } else {
-                       client.exhaustResponse(propfind.getResponseBodyAsStream());
-                       result = new RemoteOperationResult(false, status, propfind.getResponseHeaders());
-               }
-
-       } catch (Exception e) {
-               result = new RemoteOperationResult(e);
-               e.printStackTrace();
-               Log.e(TAG, "Synchronizing  file " + mRemotePath + ": " + result.getLogMessage(), result.getException());
-       } finally {
-               if (propfind != null)
-                       propfind.releaseConnection();
-       }
-       return result;
-    }
-
-}
diff --git a/oc_framework/src/com/owncloud/android/oc_framework/operations/remote/ReadRemoteFolderOperation.java b/oc_framework/src/com/owncloud/android/oc_framework/operations/remote/ReadRemoteFolderOperation.java
deleted file mode 100644 (file)
index b0a8bd5..0000000
+++ /dev/null
@@ -1,162 +0,0 @@
-/* ownCloud Android client application
- *   Copyright (C) 2012-2013 ownCloud Inc.
- *
- *   This program is free software: you can redistribute it and/or modify
- *   it under the terms of the GNU General Public License version 2,
- *   as published by the Free Software Foundation.
- *
- *   This program is distributed in the hope that it will be useful,
- *   but WITHOUT ANY WARRANTY; without even the implied warranty of
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *   GNU General Public License for more details.
- *
- *   You should have received a copy of the GNU General Public License
- *   along with this program.  If not, see <http://www.gnu.org/licenses/>.
- *
- */
-
-package com.owncloud.android.oc_framework.operations.remote;
-
-import java.util.ArrayList;
-
-import org.apache.http.HttpStatus;
-import org.apache.jackrabbit.webdav.DavConstants;
-import org.apache.jackrabbit.webdav.MultiStatus;
-import org.apache.jackrabbit.webdav.client.methods.PropFindMethod;
-
-import android.util.Log;
-
-import com.owncloud.android.oc_framework.network.webdav.WebdavClient;
-import com.owncloud.android.oc_framework.network.webdav.WebdavEntry;
-import com.owncloud.android.oc_framework.network.webdav.WebdavUtils;
-import com.owncloud.android.oc_framework.operations.RemoteFile;
-import com.owncloud.android.oc_framework.operations.RemoteOperation;
-import com.owncloud.android.oc_framework.operations.RemoteOperationResult;
-
-/**
- * Remote operation performing the read of remote file or folder in the ownCloud server.
- * 
- * @author David A. Velasco
- * @author masensio
- */
-
-public class ReadRemoteFolderOperation extends RemoteOperation {
-
-       private static final String TAG = ReadRemoteFolderOperation.class.getSimpleName();
-
-       private String mRemotePath;
-       private ArrayList<RemoteFile> mFolderAndFiles;
-       
-       /**
-     * Constructor
-     * 
-     * @param remotePath               Remote path of the file. 
-     */
-       public ReadRemoteFolderOperation(String remotePath) {
-               mRemotePath = remotePath;
-       }
-
-       /**
-     * Performs the read operation.
-     * 
-     * @param   client      Client object to communicate with the remote ownCloud server.
-     */
-       @Override
-       protected RemoteOperationResult run(WebdavClient client) {
-               RemoteOperationResult result = null;
-        PropFindMethod query = null;
-        
-        try {
-            // remote request 
-            query = new PropFindMethod(client.getBaseUri() + WebdavUtils.encodePath(mRemotePath),
-                    DavConstants.PROPFIND_ALL_PROP,
-                    DavConstants.DEPTH_1);
-            int status = client.executeMethod(query);
-
-            // check and process response
-            if (isMultiStatus(status)) {
-               // get data from remote folder 
-               MultiStatus dataInServer = query.getResponseBodyAsMultiStatus();
-               readData(dataInServer, client);
-               
-               // Result of the operation
-               result = new RemoteOperationResult(true, status, query.getResponseHeaders());
-               // Add data to the result
-               if (result.isSuccess()) {
-                       result.setData(mFolderAndFiles);
-               }
-            } else {
-                // synchronization failed
-                client.exhaustResponse(query.getResponseBodyAsStream());
-                result = new RemoteOperationResult(false, status, query.getResponseHeaders());
-            }
-
-        } catch (Exception e) {
-            result = new RemoteOperationResult(e);
-            
-
-        } finally {
-            if (query != null)
-                query.releaseConnection();  // let the connection available for other methods
-            if (result.isSuccess()) {
-                Log.i(TAG, "Synchronized "  + mRemotePath + ": " + result.getLogMessage());
-            } else {
-                if (result.isException()) {
-                    Log.e(TAG, "Synchronized " + mRemotePath  + ": " + result.getLogMessage(), result.getException());
-                } else {
-                    Log.e(TAG, "Synchronized " + mRemotePath + ": " + result.getLogMessage());
-                }
-            }
-            
-        }
-        return result;
-       }
-
-    public boolean isMultiStatus(int status) {
-        return (status == HttpStatus.SC_MULTI_STATUS); 
-    }
-
-    /**
-     *  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 
-     *                          folder and its direct children.
-     *  @param client           Client instance to the remote server where the data were 
-     *                          retrieved.  
-     *  @return                
-     */
-    private void readData(MultiStatus dataInServer, WebdavClient client) {     
-        mFolderAndFiles = new ArrayList<RemoteFile>();
-        
-        // parse data from remote folder 
-        WebdavEntry we = new WebdavEntry(dataInServer.getResponses()[0], client.getBaseUri().getPath());
-        mFolderAndFiles.add(fillOCFile(we));
-        
-        // loop to update every child
-        RemoteFile remoteFile = null;
-        for (int i = 1; i < dataInServer.getResponses().length; ++i) {
-            /// new OCFile instance with the data from the server
-            we = new WebdavEntry(dataInServer.getResponses()[i], client.getBaseUri().getPath());                        
-            remoteFile = fillOCFile(we);
-            mFolderAndFiles.add(remoteFile);
-        }
-        
-    }
-    
-    /**
-     * Creates and populates a new {@link RemoteFile} object with the data read from the server.
-     * 
-     * @param we        WebDAV entry read from the server for a WebDAV resource (remote file or folder).
-     * @return          New OCFile instance representing the remote resource described by we.
-     */
-    private RemoteFile fillOCFile(WebdavEntry we) {
-        RemoteFile file = new RemoteFile(we.decodedPath());
-        file.setCreationTimestamp(we.createTimestamp());
-        file.setLength(we.contentLength());
-        file.setMimeType(we.contentType());
-        file.setModifiedTimestamp(we.modifiedTimestamp());
-        file.setEtag(we.etag());
-        return file;
-    }
-}
diff --git a/oc_framework/src/com/owncloud/android/oc_framework/operations/remote/RemoveRemoteFileOperation.java b/oc_framework/src/com/owncloud/android/oc_framework/operations/remote/RemoveRemoteFileOperation.java
deleted file mode 100644 (file)
index f083acb..0000000
+++ /dev/null
@@ -1,83 +0,0 @@
-/* ownCloud Android client application
- *   Copyright (C) 2012-2013 ownCloud Inc.
- *
- *   This program is free software: you can redistribute it and/or modify
- *   it under the terms of the GNU General Public License version 2,
- *   as published by the Free Software Foundation.
- *
- *   This program is distributed in the hope that it will be useful,
- *   but WITHOUT ANY WARRANTY; without even the implied warranty of
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *   GNU General Public License for more details.
- *
- *   You should have received a copy of the GNU General Public License
- *   along with this program.  If not, see <http://www.gnu.org/licenses/>.
- *
- */
-
-package com.owncloud.android.oc_framework.operations.remote;
-
-import org.apache.commons.httpclient.HttpStatus;
-import org.apache.jackrabbit.webdav.client.methods.DeleteMethod;
-
-import android.util.Log;
-
-import com.owncloud.android.oc_framework.network.webdav.WebdavClient;
-import com.owncloud.android.oc_framework.network.webdav.WebdavUtils;
-import com.owncloud.android.oc_framework.operations.RemoteOperation;
-import com.owncloud.android.oc_framework.operations.RemoteOperationResult;
-
-/**
- * Remote operation performing the removal of a remote file or folder in the ownCloud server.
- * 
- * @author David A. Velasco
- * @author masensio
- */
-public class RemoveRemoteFileOperation extends RemoteOperation {
-    private static final String TAG = RemoveRemoteFileOperation.class.getSimpleName();
-
-    private static final int REMOVE_READ_TIMEOUT = 10000;
-    private static final int REMOVE_CONNECTION_TIMEOUT = 5000;
-
-       private String mRemotePath;
-
-    /**
-     * Constructor
-     * 
-     * @param remotePath       RemotePath of the remote file or folder to remove from the server
-     */
-       public RemoveRemoteFileOperation(String remotePath) {
-               mRemotePath = remotePath;
-       }
-
-       /**
-        * Performs the rename operation.
-        * 
-        * @param client        Client object to communicate with the remote ownCloud server.
-        */
-       @Override
-       protected RemoteOperationResult run(WebdavClient client) {
-               RemoteOperationResult result = null;
-        DeleteMethod delete = null;
-        
-        try {
-               delete = new DeleteMethod(client.getBaseUri() + WebdavUtils.encodePath(mRemotePath));
-               int status = client.executeMethod(delete, REMOVE_READ_TIMEOUT, REMOVE_CONNECTION_TIMEOUT);
-               
-               delete.getResponseBodyAsString();   // exhaust the response, although not interesting
-               result = new RemoteOperationResult((delete.succeeded() || status == HttpStatus.SC_NOT_FOUND), status, delete.getResponseHeaders());
-               Log.i(TAG, "Remove " + mRemotePath + ": " + result.getLogMessage());
-
-        } catch (Exception e) {
-               result = new RemoteOperationResult(e);
-               Log.e(TAG, "Remove " + mRemotePath + ": " + result.getLogMessage(), e);
-
-        } finally {
-               if (delete != null)
-                       delete.releaseConnection();
-        }
-        
-               return result;
-       }
-
-}
diff --git a/oc_framework/src/com/owncloud/android/oc_framework/operations/remote/RenameRemoteFileOperation.java b/oc_framework/src/com/owncloud/android/oc_framework/operations/remote/RenameRemoteFileOperation.java
deleted file mode 100644 (file)
index b1714ae..0000000
+++ /dev/null
@@ -1,146 +0,0 @@
-/* ownCloud Android client application
- *   Copyright (C) 2012-2013 ownCloud Inc.
- *
- *   This program is free software: you can redistribute it and/or modify
- *   it under the terms of the GNU General Public License version 2,
- *   as published by the Free Software Foundation.
- *
- *   This program is distributed in the hope that it will be useful,
- *   but WITHOUT ANY WARRANTY; without even the implied warranty of
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *   GNU General Public License for more details.
- *
- *   You should have received a copy of the GNU General Public License
- *   along with this program.  If not, see <http://www.gnu.org/licenses/>.
- *
- */
-
-package com.owncloud.android.oc_framework.operations.remote;
-
-import java.io.File;
-
-import org.apache.jackrabbit.webdav.client.methods.DavMethodBase;
-
-import android.util.Log;
-
-import com.owncloud.android.oc_framework.network.webdav.WebdavClient;
-import com.owncloud.android.oc_framework.network.webdav.WebdavUtils;
-import com.owncloud.android.oc_framework.operations.RemoteOperation;
-import com.owncloud.android.oc_framework.operations.RemoteOperationResult;
-import com.owncloud.android.oc_framework.operations.RemoteOperationResult.ResultCode;
-import com.owncloud.android.oc_framework.utils.FileUtils;
-
-
-/**
- * Remote operation performing the rename of a remote file or folder in the ownCloud server.
- * 
- * @author David A. Velasco
- * @author masensio
- */
-public class RenameRemoteFileOperation extends RemoteOperation {
-
-       private static final String TAG = RenameRemoteFileOperation.class.getSimpleName();
-
-       private static final int RENAME_READ_TIMEOUT = 10000;
-       private static final int RENAME_CONNECTION_TIMEOUT = 5000;
-
-    private String mOldName;
-    private String mOldRemotePath;
-    private String mNewName;
-    private String mNewRemotePath;
-    
-    
-    /**
-     * Constructor
-     * 
-     * @param oldName                  Old name of the file.
-     * @param oldRemotePath            Old remote path of the file. 
-     * @param newName                  New name to set as the name of file.
-     * @param isFolder                 'true' for folder and 'false' for files
-     */
-       public RenameRemoteFileOperation(String oldName, String oldRemotePath, String newName, boolean isFolder) {
-               mOldName = oldName;
-               mOldRemotePath = oldRemotePath;
-               mNewName = newName;
-               
-        String parent = (new File(mOldRemotePath)).getParent();
-        parent = (parent.endsWith(FileUtils.PATH_SEPARATOR)) ? parent : parent + FileUtils.PATH_SEPARATOR; 
-        mNewRemotePath =  parent + mNewName;
-        if (isFolder) {
-            mNewRemotePath += FileUtils.PATH_SEPARATOR;
-        }
-       }
-
-        /**
-     * Performs the rename operation.
-     * 
-     * @param   client      Client object to communicate with the remote ownCloud server.
-     */
-       @Override
-       protected RemoteOperationResult run(WebdavClient client) {
-               RemoteOperationResult result = null;
-               
-               LocalMoveMethod move = null;
-        
-        boolean noInvalidChars = FileUtils.isValidPath(mNewRemotePath);
-        
-        if (noInvalidChars) {
-        try {
-               
-            if (mNewName.equals(mOldName)) {
-                return new RemoteOperationResult(ResultCode.OK);
-            }
-        
-            
-            // check if a file with the new name already exists
-            if (client.existsFile(mNewRemotePath)) {
-               return new RemoteOperationResult(ResultCode.INVALID_OVERWRITE);
-            }
-            
-            move = new LocalMoveMethod( client.getBaseUri() + WebdavUtils.encodePath(mOldRemotePath),
-                       client.getBaseUri() + WebdavUtils.encodePath(mNewRemotePath));
-            int status = client.executeMethod(move, RENAME_READ_TIMEOUT, RENAME_CONNECTION_TIMEOUT);
-            
-            move.getResponseBodyAsString(); // exhaust response, although not interesting
-            result = new RemoteOperationResult(move.succeeded(), status, move.getResponseHeaders());
-            Log.i(TAG, "Rename " + mOldRemotePath + " to " + mNewRemotePath + ": " + result.getLogMessage());
-            
-        } catch (Exception e) {
-            result = new RemoteOperationResult(e);
-            Log.e(TAG, "Rename " + mOldRemotePath + " to " + ((mNewRemotePath==null) ? mNewName : mNewRemotePath) + ": " + result.getLogMessage(), e);
-            
-        } finally {
-            if (move != null)
-                move.releaseConnection();
-        }
-        } else {
-               result = new RemoteOperationResult(ResultCode.INVALID_CHARACTER_IN_NAME);
-        }
-               
-        return result;
-       }
-       
-       /**
-        * Move operation
-        * 
-        */
-    private class LocalMoveMethod extends DavMethodBase {
-
-        public LocalMoveMethod(String uri, String dest) {
-            super(uri);
-            addRequestHeader(new org.apache.commons.httpclient.Header("Destination", dest));
-        }
-
-        @Override
-        public String getName() {
-            return "MOVE";
-        }
-
-        @Override
-        protected boolean isSuccess(int status) {
-            return status == 201 || status == 204;
-        }
-            
-    }
-
-}
diff --git a/oc_framework/src/com/owncloud/android/oc_framework/operations/remote/UploadRemoteFileOperation.java b/oc_framework/src/com/owncloud/android/oc_framework/operations/remote/UploadRemoteFileOperation.java
deleted file mode 100644 (file)
index 91e21b4..0000000
+++ /dev/null
@@ -1,147 +0,0 @@
-/* ownCloud Android client application
- *   Copyright (C) 2012-2013 ownCloud Inc.
- *
- *   This program is free software: you can redistribute it and/or modify
- *   it under the terms of the GNU General Public License version 2,
- *   as published by the Free Software Foundation.
- *
- *   This program is distributed in the hope that it will be useful,
- *   but WITHOUT ANY WARRANTY; without even the implied warranty of
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *   GNU General Public License for more details.
- *
- *   You should have received a copy of the GNU General Public License
- *   along with this program.  If not, see <http://www.gnu.org/licenses/>.
- *
- */
-
-package com.owncloud.android.oc_framework.operations.remote;
-
-import java.io.File;
-import java.io.IOException;
-import java.util.HashSet;
-import java.util.Set;
-import java.util.concurrent.atomic.AtomicBoolean;
-
-import org.apache.commons.httpclient.HttpException;
-import org.apache.commons.httpclient.methods.PutMethod;
-import org.apache.commons.httpclient.methods.RequestEntity;
-import org.apache.http.HttpStatus;
-
-import com.owncloud.android.oc_framework.network.ProgressiveDataTransferer;
-import com.owncloud.android.oc_framework.network.webdav.FileRequestEntity;
-import com.owncloud.android.oc_framework.network.webdav.OnDatatransferProgressListener;
-import com.owncloud.android.oc_framework.network.webdav.WebdavClient;
-import com.owncloud.android.oc_framework.network.webdav.WebdavUtils;
-import com.owncloud.android.oc_framework.operations.OperationCancelledException;
-import com.owncloud.android.oc_framework.operations.RemoteOperation;
-import com.owncloud.android.oc_framework.operations.RemoteOperationResult;
-
-/**
- * Remote operation performing the upload of a remote file to the ownCloud server.
- * 
- * @author David A. Velasco
- * @author masensio
- */
-
-public class UploadRemoteFileOperation extends RemoteOperation {
-
-
-       protected String mStoragePath;
-       protected String mRemotePath;
-       protected String mMimeType;
-       protected PutMethod mPutMethod = null;
-       
-       private final AtomicBoolean mCancellationRequested = new AtomicBoolean(false);
-       protected Set<OnDatatransferProgressListener> mDataTransferListeners = new HashSet<OnDatatransferProgressListener>();
-
-       protected RequestEntity mEntity = null;
-
-       public UploadRemoteFileOperation(String storagePath, String remotePath, String mimeType) {
-               mStoragePath = storagePath;
-               mRemotePath = remotePath;
-               mMimeType = mimeType;   
-       }
-
-       @Override
-       protected RemoteOperationResult run(WebdavClient client) {
-               RemoteOperationResult result = null;
-
-               try {
-                       // / perform the upload
-                       synchronized (mCancellationRequested) {
-                               if (mCancellationRequested.get()) {
-                                       throw new OperationCancelledException();
-                               } else {
-                                       mPutMethod = new PutMethod(client.getBaseUri() + WebdavUtils.encodePath(mRemotePath));
-                               }
-                       }
-
-                       int status = uploadFile(client);
-
-                       result  = new RemoteOperationResult(isSuccess(status), status, (mPutMethod != null ? mPutMethod.getResponseHeaders() : null));
-
-               } catch (Exception e) {
-                       // TODO something cleaner with cancellations
-                       if (mCancellationRequested.get()) {
-                               result = new RemoteOperationResult(new OperationCancelledException());
-                       } else {
-                               result = new RemoteOperationResult(e);
-                       }
-               }
-               return result;
-       }
-
-       public boolean isSuccess(int status) {
-               return ((status == HttpStatus.SC_OK || status == HttpStatus.SC_CREATED || status == HttpStatus.SC_NO_CONTENT));
-       }
-
-       protected int uploadFile(WebdavClient client) throws HttpException, IOException, OperationCancelledException {
-               int status = -1;
-               try {
-                       File f = new File(mStoragePath);
-                       mEntity  = new FileRequestEntity(f, mMimeType);
-                       synchronized (mDataTransferListeners) {
-                               ((ProgressiveDataTransferer)mEntity).addDatatransferProgressListeners(mDataTransferListeners);
-                       }
-                       mPutMethod.setRequestEntity(mEntity);
-                       status = client.executeMethod(mPutMethod);
-                       client.exhaustResponse(mPutMethod.getResponseBodyAsStream());
-
-               } finally {
-                       mPutMethod.releaseConnection(); // let the connection available for other methods
-               }
-               return status;
-       }
-       
-    public Set<OnDatatransferProgressListener> getDataTransferListeners() {
-        return mDataTransferListeners;
-    }
-    
-    public void addDatatransferProgressListener (OnDatatransferProgressListener listener) {
-        synchronized (mDataTransferListeners) {
-            mDataTransferListeners.add(listener);
-        }
-        if (mEntity != null) {
-            ((ProgressiveDataTransferer)mEntity).addDatatransferProgressListener(listener);
-        }
-    }
-    
-    public void removeDatatransferProgressListener(OnDatatransferProgressListener listener) {
-        synchronized (mDataTransferListeners) {
-            mDataTransferListeners.remove(listener);
-        }
-        if (mEntity != null) {
-            ((ProgressiveDataTransferer)mEntity).removeDatatransferProgressListener(listener);
-        }
-    }
-    
-    public void cancel() {
-        synchronized (mCancellationRequested) {
-            mCancellationRequested.set(true);
-            if (mPutMethod != null)
-                mPutMethod.abort();
-        }
-    }
-
-}
diff --git a/oc_framework/src/com/owncloud/android/oc_framework/utils/FileUtils.java b/oc_framework/src/com/owncloud/android/oc_framework/utils/FileUtils.java
deleted file mode 100644 (file)
index 192c267..0000000
+++ /dev/null
@@ -1,71 +0,0 @@
-/* ownCloud Android client application
- *   Copyright (C) 2012-2013 ownCloud Inc.
- *
- *   This program is free software: you can redistribute it and/or modify
- *   it under the terms of the GNU General Public License version 2,
- *   as published by the Free Software Foundation.
- *
- *   This program is distributed in the hope that it will be useful,
- *   but WITHOUT ANY WARRANTY; without even the implied warranty of
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *   GNU General Public License for more details.
- *
- *   You should have received a copy of the GNU General Public License
- *   along with this program.  If not, see <http://www.gnu.org/licenses/>.
- *
- */
-
-package com.owncloud.android.oc_framework.utils;
-
-import java.io.File;
-
-import android.util.Log;
-
-public class FileUtils {
-
-       public static final String PATH_SEPARATOR = "/";
-
-
-       public static String getParentPath(String remotePath) {
-               String parentPath = new File(remotePath).getParent();
-               parentPath = parentPath.endsWith(PATH_SEPARATOR) ? parentPath : parentPath + PATH_SEPARATOR;
-               return parentPath;
-       }
-       
-       /**
-        * Validate the fileName to detect if contains any forbidden character: / , \ , < , > , : , " , | , ? , *
-        * @param fileName
-        * @return
-        */
-       public static boolean isValidName(String fileName) {
-               boolean result = true;
-               
-               Log.d("FileUtils", "fileName =======" + fileName);
-               if (fileName.contains(PATH_SEPARATOR) ||
-                               fileName.contains("\\") || fileName.contains("<") || fileName.contains(">") ||
-                               fileName.contains(":") || fileName.contains("\"") || fileName.contains("|") || 
-                               fileName.contains("?") || fileName.contains("*")) {
-                       result = false;
-               }
-               return result;
-       }
-       
-       /**
-        * Validate the path to detect if contains any forbidden character: \ , < , > , : , " , | , ? , *
-        * @param path
-        * @return
-        */
-       public static boolean isValidPath(String path) {
-               boolean result = true;
-               
-               Log.d("FileUtils", "path ....... " + path);
-               if (path.contains("\\") || path.contains("<") || path.contains(">") ||
-                               path.contains(":") || path.contains("\"") || path.contains("|") || 
-                               path.contains("?") || path.contains("*")) {
-                       result = false;
-               }
-               return result;
-       }
-
-       
-}
diff --git a/oc_framework/src/com/owncloud/android/oc_framework/utils/OwnCloudVersion.java b/oc_framework/src/com/owncloud/android/oc_framework/utils/OwnCloudVersion.java
deleted file mode 100644 (file)
index 5a9df4d..0000000
+++ /dev/null
@@ -1,85 +0,0 @@
-/* ownCloud Android client application
- *   Copyright (C) 2012  Bartek Przybylski
- *   Copyright (C) 2012-2013 ownCloud Inc.
- *
- *   This program is free software: you can redistribute it and/or modify
- *   it under the terms of the GNU General Public License version 2,
- *   as published by the Free Software Foundation.
- *
- *   This program is distributed in the hope that it will be useful,
- *   but WITHOUT ANY WARRANTY; without even the implied warranty of
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *   GNU General Public License for more details.
- *
- *   You should have received a copy of the GNU General Public License
- *   along with this program.  If not, see <http://www.gnu.org/licenses/>.
- *
- */
-
-package com.owncloud.android.oc_framework.utils;
-
-public class OwnCloudVersion implements Comparable<OwnCloudVersion> {
-    public static final OwnCloudVersion owncloud_v1 = new OwnCloudVersion(
-            0x010000);
-    public static final OwnCloudVersion owncloud_v2 = new OwnCloudVersion(
-            0x020000);
-    public static final OwnCloudVersion owncloud_v3 = new OwnCloudVersion(
-            0x030000);
-    public static final OwnCloudVersion owncloud_v4 = new OwnCloudVersion(
-            0x040000);
-    public static final OwnCloudVersion owncloud_v4_5 = new OwnCloudVersion(
-            0x040500);
-
-    // format is in version
-    // 0xAABBCC
-    // for version AA.BB.CC
-    // ie version 2.0.3 will be stored as 0x030003
-    private int mVersion;
-    private boolean mIsValid;
-
-    public OwnCloudVersion(int version) {
-        mVersion = version;
-        mIsValid = true;
-    }
-
-    public OwnCloudVersion(String version) {
-        mVersion = 0;
-        mIsValid = false;
-        parseVersionString(version);
-    }
-
-    public String toString() {
-        return ((mVersion >> 16) % 256) + "." + ((mVersion >> 8) % 256) + "."
-                + ((mVersion) % 256);
-    }
-
-    public boolean isVersionValid() {
-        return mIsValid;
-    }
-
-    @Override
-    public int compareTo(OwnCloudVersion another) {
-        return another.mVersion == mVersion ? 0
-                : another.mVersion < mVersion ? 1 : -1;
-    }
-
-    private void parseVersionString(String version) {
-        try {
-            String[] nums = version.split("\\.");
-            if (nums.length > 0) {
-                mVersion += Integer.parseInt(nums[0]);
-            }
-            mVersion = mVersion << 8;
-            if (nums.length > 1) {
-                mVersion += Integer.parseInt(nums[1]);
-            }
-            mVersion = mVersion << 8;
-            if (nums.length > 2) {
-                mVersion += Integer.parseInt(nums[2]);
-            }
-            mIsValid = true;
-        } catch (Exception e) {
-            mIsValid = false;
-        }
-    }
-}
index 46e9269..4bc25ba 100644 (file)
@@ -1,8 +1,8 @@
 <?xml version="1.0" encoding="utf-8"?>
 <manifest xmlns:android="http://schemas.android.com/apk/res/android"
     package="com.owncloud.android.workaround.accounts"
-    android:versionCode="0100011"
-    android:versionName="1.0.11" >
+    android:versionCode="0100013"
+    android:versionName="1.0.13" >
 
     <uses-sdk
         android:minSdkVersion="16"
diff --git a/owncloud-android-library b/owncloud-android-library
new file mode 160000 (submodule)
index 0000000..30acd48
--- /dev/null
@@ -0,0 +1 @@
+Subproject commit 30acd4875dda3fd0bec83daaad522f3d5a02ead6
diff --git a/pom.xml b/pom.xml
index 5e7c1ea..15bd0b6 100644 (file)
--- a/pom.xml
+++ b/pom.xml
@@ -13,7 +13,7 @@
         <owncloud.version>1.5.1-SNAPSHOT</owncloud.version>
         <java-version>1.6</java-version>
         <!-- Given by maven-android-sdk-deployer -->
-        <google.android-version>4.4_r1</google.android-version>
+        <google.android-version>4.4.2_r2</google.android-version>
         <!-- Usually the latest Android API -->
         <google.android-api>19</google.android-api>
         <actionbarsherlock-version>4.2.0</actionbarsherlock-version>
             <type>apklib</type>
         </dependency>
 
-        <!-- MUST BE INSTALLED FIRST: cd oc_framework; mvn install -->
+        <!-- MUST BE INSTALLED FIRST: cd owncloud-android-library; mvn install -->
         <dependency>
          <groupId>com.owncloud.android</groupId>
-         <artifactId>oc_framework</artifactId>
+         <artifactId>owncloud-android-library</artifactId>
          <version>${owncloud.version}</version>
       </dependency>
 
index dbd0f5e..28edd99 100644 (file)
@@ -10,4 +10,4 @@
 # Project target.
 target=android-19
 android.library.reference.1=actionbarsherlock/library
-android.library.reference.2=oc_framework
+android.library.reference.2=owncloud-android-library
diff --git a/res/drawable-hdpi/copy_link.png b/res/drawable-hdpi/copy_link.png
new file mode 100644 (file)
index 0000000..35df55f
Binary files /dev/null and b/res/drawable-hdpi/copy_link.png differ
diff --git a/res/drawable-hdpi/sharedlink.png b/res/drawable-hdpi/sharedlink.png
new file mode 100644 (file)
index 0000000..222172a
Binary files /dev/null and b/res/drawable-hdpi/sharedlink.png differ
diff --git a/res/drawable-ldpi/copy_link.png b/res/drawable-ldpi/copy_link.png
new file mode 100644 (file)
index 0000000..b3caf52
Binary files /dev/null and b/res/drawable-ldpi/copy_link.png differ
diff --git a/res/drawable-mdpi/copy_link.png b/res/drawable-mdpi/copy_link.png
new file mode 100644 (file)
index 0000000..4e2af28
Binary files /dev/null and b/res/drawable-mdpi/copy_link.png differ
diff --git a/res/drawable-mdpi/sharedlink.png b/res/drawable-mdpi/sharedlink.png
new file mode 100644 (file)
index 0000000..8300eac
Binary files /dev/null and b/res/drawable-mdpi/sharedlink.png differ
diff --git a/res/drawable-xhdpi/copy_link.png b/res/drawable-xhdpi/copy_link.png
new file mode 100644 (file)
index 0000000..c69eb05
Binary files /dev/null and b/res/drawable-xhdpi/copy_link.png differ
diff --git a/res/drawable-xhdpi/icon.png b/res/drawable-xhdpi/icon.png
new file mode 100644 (file)
index 0000000..041efc6
Binary files /dev/null and b/res/drawable-xhdpi/icon.png differ
diff --git a/res/drawable-xhdpi/sharedlink.png b/res/drawable-xhdpi/sharedlink.png
new file mode 100644 (file)
index 0000000..3879663
Binary files /dev/null and b/res/drawable-xhdpi/sharedlink.png differ
diff --git a/res/layout-v11/activity_row.xml b/res/layout-v11/activity_row.xml
new file mode 100644 (file)
index 0000000..95c7dfc
--- /dev/null
@@ -0,0 +1,59 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+  ownCloud Android client application
+
+  Copyright (C) 2012-2014 ownCloud Inc.
+
+  This program is free software: you can redistribute it and/or modify
+  it under the terms of the GNU General Public License version 2,
+  as published by the Free Software Foundation.
+
+  This program is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+  GNU General Public License for more details.
+
+  You should have received a copy of the GNU General Public License
+  along with this program.  If not, see <http://www.gnu.org/licenses/>.
+-->
+
+<LinearLayout  xmlns:android="http://schemas.android.com/apk/res/android"
+                       android:id="@+id/list_item"
+                               android:layout_width="match_parent"
+                               android:layout_height="48dp"
+                               android:paddingStart="16dip"
+                               android:paddingEnd="16dip"
+                               android:paddingRight="16dip"
+                               android:paddingLeft="16dip"
+                               android:minWidth="196dip"
+                               android:background="?android:attr/activatedBackgroundIndicator"
+                       android:orientation="vertical" >
+
+       <LinearLayout
+               android:layout_width="wrap_content"
+               android:layout_height="match_parent"
+               android:duplicateParentState="true" >
+
+               <ImageView
+                       android:id="@+id/icon"
+                       android:layout_width="40dip"
+                       android:layout_height="40dip"
+                       android:layout_gravity="center_vertical"
+                       android:layout_marginEnd="8dip"
+                       android:layout_marginRight="8dip"
+                       android:duplicateParentState="true" />
+
+        <TextView
+            android:id="@+id/title"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:layout_gravity="center_vertical"
+            android:textAppearance="?android:attr/textAppearanceLargePopupMenu"
+            android:duplicateParentState="true"
+            android:singleLine="true"
+            android:ellipsize="marquee"
+            android:fadingEdge="horizontal" />
+
+    </LinearLayout>
+
+</LinearLayout>
\ No newline at end of file
diff --git a/res/layout/activity_row.xml b/res/layout/activity_row.xml
new file mode 100644 (file)
index 0000000..b917600
--- /dev/null
@@ -0,0 +1,55 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+  ownCloud Android client application
+
+  Copyright (C) 2012-2014 ownCloud Inc.
+
+  This program is free software: you can redistribute it and/or modify
+  it under the terms of the GNU General Public License version 2,
+  as published by the Free Software Foundation.
+
+  This program is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+  GNU General Public License for more details.
+
+  You should have received a copy of the GNU General Public License
+  along with this program.  If not, see <http://www.gnu.org/licenses/>.
+-->
+
+<LinearLayout  xmlns:android="http://schemas.android.com/apk/res/android"
+                       android:id="@+id/list_item"
+                               android:layout_width="match_parent"
+                               android:layout_height="48dp"
+                               android:paddingRight="16dip"
+                               android:paddingLeft="16dip"
+                               android:minWidth="196dip"
+                       android:orientation="vertical" >
+
+       <LinearLayout
+               android:layout_width="wrap_content"
+               android:layout_height="match_parent"
+               android:duplicateParentState="true" >
+
+               <ImageView
+                       android:id="@+id/icon"
+                       android:layout_width="40dip"
+                       android:layout_height="40dip"
+                       android:layout_gravity="center_vertical"
+                       android:layout_marginRight="8dip"
+                       android:duplicateParentState="true" />
+
+        <TextView
+            android:id="@+id/title"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:layout_gravity="center_vertical"
+            android:textAppearance="?android:attr/textAppearanceLarge"
+            android:duplicateParentState="true"
+            android:singleLine="true"
+            android:ellipsize="marquee"
+            android:fadingEdge="horizontal" />
+
+    </LinearLayout>
+
+</LinearLayout>
\ No newline at end of file
index ea73832..abe0e7f 100644 (file)
             android:src="@drawable/ic_favorite" />\r
         \r
     </FrameLayout>\r
-\r\r\r\r
+\r
     <LinearLayout\r
         android:layout_width="0dp"\r
         android:layout_height="match_parent"\r
         android:layout_weight="1"\r
         android:gravity="center_vertical"\r
         android:orientation="vertical" >\r
-\r\r
+\r
         <TextView\r
             android:id="@+id/Filename"\r
             android:layout_width="wrap_content"\r
         </LinearLayout>\r
 \r
     </LinearLayout>\r
-\r\r\r\r
+\r
+    <ImageView\r
+        android:id="@+id/shareIcon"\r
+        android:layout_width="wrap_content"\r
+        android:layout_height="wrap_content"\r
+        android:layout_gravity="center_vertical"\r
+        android:layout_marginLeft="4dp"\r
+        android:layout_marginRight="4dp"\r
+        android:src="@drawable/sharedlink" />\r
+\r
     <ImageView\r
         android:id="@+id/custom_checkbox"\r
         android:layout_width="wrap_content"\r
diff --git a/res/layout/ssl_untrusted_cert_layout.xml b/res/layout/ssl_untrusted_cert_layout.xml
new file mode 100644 (file)
index 0000000..6a30c2e
--- /dev/null
@@ -0,0 +1,460 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- 
+    ownCloud Android client application
+
+    Copyright (C) 2012-2013 ownCloud Inc.
+
+    This program is free software: you can redistribute it and/or modify
+    it under the terms of the GNU General Public License version 2,
+    as published by the Free Software Foundation.
+  
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+    GNU General Public License for more details.
+
+    You should have received a copy of the GNU General Public License
+    along with this program.  If not, see <http://www.gnu.org/licenses/>.
+-->
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    android:id="@+id/root"
+    android:layout_width="wrap_content"
+    android:layout_height="wrap_content"
+    android:gravity="center"
+    android:orientation="vertical" >
+
+       <TextView
+               android:id="@+id/header"
+               android:layout_width="wrap_content"
+               android:layout_height="wrap_content"
+               android:layout_weight="0"
+               android:text="@string/ssl_validator_header"
+               android:padding="5dp"
+               android:textAppearance="?android:attr/textAppearanceMedium"
+                />
+    
+       <TextView
+               android:id="@+id/reason_cert_not_trusted"
+               android:layout_width="wrap_content"
+               android:layout_height="wrap_content"
+               android:layout_weight="0"
+               android:layout_gravity="left"
+               android:paddingLeft="20dp"
+               android:text="@string/ssl_validator_reason_cert_not_trusted"
+               android:textAppearance="?android:attr/textAppearanceSmall"
+                />
+               
+       
+       <TextView
+               android:id="@+id/reason_cert_expired"
+               android:layout_width="wrap_content"
+               android:layout_height="wrap_content"
+               android:layout_gravity="left"
+               android:paddingLeft="20dp"
+               android:text="@string/ssl_validator_reason_cert_expired"
+               android:textAppearance="?android:attr/textAppearanceSmall"
+                />
+       
+       <TextView
+               android:id="@+id/reason_cert_not_yet_valid"
+               android:layout_width="wrap_content"
+               android:layout_height="wrap_content"
+               android:layout_gravity="left"
+               android:paddingLeft="20dp"
+               android:text="@string/ssl_validator_reason_cert_not_yet_valid"
+               android:textAppearance="?android:attr/textAppearanceSmall"
+                />
+               
+       <TextView
+               android:id="@+id/reason_hostname_not_verified"
+               android:layout_width="wrap_content"
+               android:layout_height="wrap_content"
+               android:layout_gravity="left"
+               android:paddingLeft="20dp"
+               android:text="@string/ssl_validator_reason_hostname_not_verified"
+               android:textAppearance="?android:attr/textAppearanceSmall"
+                />
+       
+       <TextView
+               android:id="@+id/reason_no_info_about_error"
+               android:layout_width="wrap_content"
+               android:layout_height="wrap_content"
+               android:layout_gravity="left"
+               android:paddingLeft="20dp"
+               android:text="@string/ssl_validator_no_info_about_error"
+               android:textAppearance="?android:attr/textAppearanceSmall"
+                />
+       
+    <ScrollView 
+        android:id="@+id/details_scroll"
+        android:visibility="gone" 
+       android:padding="20dp"
+        android:layout_width="match_parent"
+        android:layout_height="0dp"
+        android:layout_weight="1"
+        >
+        
+               <LinearLayout 
+               android:id="@+id/details_view"
+               android:layout_width="wrap_content"
+               android:layout_height="wrap_content"
+               android:gravity="left"
+               android:orientation="vertical" >
+                       
+                   <TextView
+                       android:id="@+id/null_cert"
+                       android:layout_width="wrap_content"
+                       android:layout_height="wrap_content"
+                       android:layout_gravity="left"
+                       android:paddingLeft="20dp"
+                       android:text="@string/ssl_validator_null_cert"
+                       android:textAppearance="?android:attr/textAppearanceSmall" />
+
+                               <TextView
+                               android:id="@+id/label_subject"
+                               android:layout_width="wrap_content"
+                               android:layout_height="wrap_content"
+                                       android:paddingBottom="5dp"
+                               android:text="@string/ssl_validator_label_subject"
+                               android:textAppearance="?android:attr/textAppearanceMedium"
+                       />
+                               
+                               <TextView
+                                   android:id="@+id/label_subject_CN"
+                                   android:layout_width="wrap_content"
+                                   android:layout_height="wrap_content"
+                                   android:text="@string/ssl_validator_label_CN"
+                                   android:textAppearance="?android:attr/textAppearanceSmall"
+                               />
+                           
+                               <TextView
+                                   android:id="@+id/value_subject_CN"
+                                   android:layout_width="wrap_content"
+                                   android:layout_height="wrap_content"
+                                   android:paddingBottom="5dp"
+                                   android:text=""
+                                   android:textAppearance="?android:attr/textAppearanceSmall"
+                               />
+                               
+                               <TextView
+                                   android:id="@+id/label_subject_O"
+                                   android:layout_width="wrap_content"
+                                   android:layout_height="wrap_content"
+                                   android:text="@string/ssl_validator_label_O"
+                                   android:textAppearance="?android:attr/textAppearanceSmall"
+                               />
+                           
+                               <TextView
+                                   android:id="@+id/value_subject_O"
+                                   android:layout_width="wrap_content"
+                                   android:layout_height="wrap_content"
+                                   android:paddingBottom="5dp"
+                                   android:text=""
+                                   android:textAppearance="?android:attr/textAppearanceSmall"
+                               />
+                               
+                               <TextView
+                                   android:id="@+id/label_subject_OU"
+                                   android:layout_width="wrap_content"
+                                   android:layout_height="wrap_content"
+                                   android:text="@string/ssl_validator_label_OU"
+                                   android:textAppearance="?android:attr/textAppearanceSmall"
+                               />
+                           
+                               <TextView
+                                   android:id="@+id/value_subject_OU"
+                                   android:layout_width="wrap_content"
+                                   android:layout_height="wrap_content"
+                                   android:paddingBottom="5dp"
+                                   android:text=""
+                                   android:textAppearance="?android:attr/textAppearanceSmall"
+                               />
+                               
+                               <TextView
+                                   android:id="@+id/label_subject_ST"
+                                   android:layout_width="wrap_content"
+                                   android:layout_height="wrap_content"
+                                   android:text="@string/ssl_validator_label_ST"
+                                   android:textAppearance="?android:attr/textAppearanceSmall"
+                               />
+                           
+                               <TextView
+                                   android:id="@+id/value_subject_ST"
+                                   android:layout_width="wrap_content"
+                                   android:layout_height="wrap_content"
+                                   android:paddingBottom="5dp"
+                                   android:text=""
+                                   android:textAppearance="?android:attr/textAppearanceSmall"
+                               />
+
+                               <TextView
+                                   android:id="@+id/label_subject_C"
+                                   android:layout_width="wrap_content"
+                                   android:layout_height="wrap_content"
+                                   android:text="@string/ssl_validator_label_C"
+                                   android:textAppearance="?android:attr/textAppearanceSmall"
+                               />
+                               
+                               <TextView
+                                   android:id="@+id/value_subject_C"
+                                   android:layout_width="wrap_content"
+                                   android:layout_height="wrap_content"
+                                   android:paddingBottom="5dp"
+                                   android:text=""
+                                   android:textAppearance="?android:attr/textAppearanceSmall"
+                               />
+                               
+                               <TextView
+                                   android:id="@+id/label_subject_L"
+                                   android:layout_width="wrap_content"
+                                   android:layout_height="wrap_content"
+                                   android:text="@string/ssl_validator_label_L"
+                                   android:textAppearance="?android:attr/textAppearanceSmall"
+                               />
+                           
+                               <TextView
+                                   android:id="@+id/value_subject_L"
+                                   android:layout_width="wrap_content"
+                                   android:layout_height="wrap_content"
+                                   android:paddingBottom="5dp"
+                                   android:text=""
+                                   android:textAppearance="?android:attr/textAppearanceSmall"
+                               />
+                           
+
+                               <TextView
+                               android:id="@+id/label_issuer"
+                               android:layout_width="wrap_content"
+                               android:layout_height="wrap_content"
+                                       android:paddingBottom="5dp"
+                               android:text="@string/ssl_validator_label_issuer"
+                               android:textAppearance="?android:attr/textAppearanceMedium"
+                       />
+                               
+                               <TextView
+                                   android:id="@+id/label_issuer_CN"
+                                   android:layout_width="wrap_content"
+                                   android:layout_height="wrap_content"
+                                   android:text="@string/ssl_validator_label_CN"
+                                   android:textAppearance="?android:attr/textAppearanceSmall"
+                               />
+                           
+                               <TextView
+                                   android:id="@+id/value_issuer_CN"
+                                   android:layout_width="wrap_content"
+                                   android:layout_height="wrap_content"
+                                   android:paddingBottom="5dp"
+                                   android:text=""
+                                   android:textAppearance="?android:attr/textAppearanceSmall"
+                               />
+                               
+                               <TextView
+                                   android:id="@+id/label_issuer_O"
+                                   android:layout_width="wrap_content"
+                                   android:layout_height="wrap_content"
+                                   android:text="@string/ssl_validator_label_O"
+                                   android:textAppearance="?android:attr/textAppearanceSmall"
+                               />
+                           
+                               <TextView
+                                   android:id="@+id/value_issuer_O"
+                                   android:layout_width="wrap_content"
+                                   android:layout_height="wrap_content"
+                                   android:paddingBottom="5dp"
+                                   android:text=""
+                                   android:textAppearance="?android:attr/textAppearanceSmall"
+                               />
+                               
+                               <TextView
+                                   android:id="@+id/label_issuer_OU"
+                                   android:layout_width="wrap_content"
+                                   android:layout_height="wrap_content"
+                                   android:text="@string/ssl_validator_label_OU"
+                                   android:textAppearance="?android:attr/textAppearanceSmall"
+                               />
+                           
+                               <TextView
+                                   android:id="@+id/value_issuer_OU"
+                                   android:layout_width="wrap_content"
+                                   android:layout_height="wrap_content"
+                                   android:paddingBottom="5dp"
+                                   android:text=""
+                                   android:textAppearance="?android:attr/textAppearanceSmall"
+                               />
+                               
+                               <TextView
+                                   android:id="@+id/label_issuer_ST"
+                                   android:layout_width="wrap_content"
+                                   android:layout_height="wrap_content"
+                                   android:text="@string/ssl_validator_label_ST"
+                                   android:textAppearance="?android:attr/textAppearanceSmall"
+                               />
+                           
+                               <TextView
+                                   android:id="@+id/value_issuer_ST"
+                                   android:layout_width="wrap_content"
+                                   android:layout_height="wrap_content"
+                                   android:paddingBottom="5dp"
+                                   android:text=""
+                                   android:textAppearance="?android:attr/textAppearanceSmall"
+                               />
+
+                               <TextView
+                                   android:id="@+id/label_issuer_C"
+                                   android:layout_width="wrap_content"
+                                   android:layout_height="wrap_content"
+                                   android:text="@string/ssl_validator_label_C"
+                                   android:textAppearance="?android:attr/textAppearanceSmall"
+                               />
+                               
+                               <TextView
+                                   android:id="@+id/value_issuer_C"
+                                   android:layout_width="wrap_content"
+                                   android:layout_height="wrap_content"
+                                   android:paddingBottom="5dp"
+                                   android:text=""
+                                   android:textAppearance="?android:attr/textAppearanceSmall"
+                               />
+                               
+                               <TextView
+                                   android:id="@+id/label_issuer_L"
+                                   android:layout_width="wrap_content"
+                                   android:layout_height="wrap_content"
+                                   android:text="@string/ssl_validator_label_L"
+                                   android:textAppearance="?android:attr/textAppearanceSmall"
+                               />
+                           
+                               <TextView
+                                   android:id="@+id/value_issuer_L"
+                                   android:layout_width="wrap_content"
+                                   android:layout_height="wrap_content"
+                                   android:paddingBottom="5dp"
+                                   android:text=""
+                                   android:textAppearance="?android:attr/textAppearanceSmall"
+                               />
+                           
+                               <TextView
+                               android:id="@+id/label_validity"
+                               android:layout_width="wrap_content"
+                               android:layout_height="wrap_content"
+                                       android:paddingBottom="5dp"
+                               android:text="@string/ssl_validator_label_validity"
+                               android:textAppearance="?android:attr/textAppearanceMedium"
+                       />
+                               
+                               <TextView
+                                   android:id="@+id/label_validity_from"
+                                   android:layout_width="wrap_content"
+                                   android:layout_height="wrap_content"
+                                   android:text="@string/ssl_validator_label_validity_from"
+                                   android:textAppearance="?android:attr/textAppearanceSmall"
+                               />
+                           
+                               <TextView
+                                   android:id="@+id/value_validity_from"
+                                   android:layout_width="wrap_content"
+                                   android:layout_height="wrap_content"
+                                   android:paddingBottom="5dp"
+                                   android:text=""
+                                   android:textAppearance="?android:attr/textAppearanceSmall"
+                               />
+                               
+                               <TextView
+                                   android:id="@+id/label_validity_to"
+                                   android:layout_width="wrap_content"
+                                   android:layout_height="wrap_content"
+                                   android:text="@string/ssl_validator_label_validity_to"
+                                   android:textAppearance="?android:attr/textAppearanceSmall"
+                               />
+                           
+                               <TextView
+                                   android:id="@+id/value_validity_to"
+                                   android:layout_width="wrap_content"
+                                   android:layout_height="wrap_content"
+                                   android:paddingBottom="5dp"
+                                   android:text=""
+                                   android:textAppearance="?android:attr/textAppearanceSmall"
+                               />
+                               
+
+                               <TextView
+                               android:id="@+id/label_signature"
+                               android:layout_width="wrap_content"
+                               android:layout_height="wrap_content"
+                                       android:paddingBottom="5dp"
+                               android:text="@string/ssl_validator_label_signature"
+                               android:textAppearance="?android:attr/textAppearanceMedium"
+                       />
+                               
+                               <TextView
+                               android:id="@+id/label_signature_algorithm"
+                               android:layout_width="wrap_content"
+                               android:layout_height="wrap_content"
+                               android:text="@string/ssl_validator_label_signature_algorithm"
+                               android:textAppearance="?android:attr/textAppearanceSmall"
+                       />
+                               
+                               <TextView
+                               android:id="@+id/value_signature_algorithm"
+                               android:layout_width="wrap_content"
+                               android:layout_height="wrap_content"
+                                       android:paddingBottom="5dp"
+                               android:text=""
+                               android:textAppearance="?android:attr/textAppearanceSmall"
+                       />
+                                                                                                                                                                                               
+                                                               
+                               <TextView
+                               android:id="@+id/value_signature"
+                               android:layout_width="wrap_content"
+                               android:layout_height="wrap_content"
+                                       android:paddingBottom="5dp"
+                               android:text=""
+                               android:textAppearance="?android:attr/textAppearanceSmall"
+                       />
+                               
+               </LinearLayout>
+               
+    </ScrollView>
+       
+       <TextView
+        android:id="@+id/question"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+               android:layout_weight="0"
+               android:padding="5dp"
+        android:text="@string/ssl_validator_question"
+        android:textAppearance="?android:attr/textAppearanceMedium"
+        >
+    </TextView>
+
+       <LinearLayout
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+               android:layout_weight="0"
+        android:gravity="center" >
+
+        <Button
+            android:id="@+id/cancel"
+            android:layout_width="0dp"
+            android:layout_height="wrap_content"
+            android:layout_weight="1"
+            android:text="@string/common_cancel" />
+
+        <Button
+            android:id="@+id/details_btn"
+            android:layout_width="0dp"
+            android:layout_height="wrap_content"
+            android:layout_weight="1"
+            android:text="@string/ssl_validator_btn_details_see" />
+
+        <Button
+            android:id="@+id/ok"
+            android:layout_width="0dp"
+            android:layout_height="wrap_content"
+            android:layout_weight="1"
+            android:text="@string/common_ok" />
+
+    </LinearLayout>
+
+</LinearLayout>
index 9da017b..27204a2 100644 (file)
@@ -79,7 +79,7 @@
         android:layout_width="wrap_content"
         android:layout_height="180dp">
         
-               <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+               <LinearLayout
                android:id="@+id/details_view"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
index 788a0e2..ccfb04b 100644 (file)
     android:layout_height="wrap_content"
     >
     
-    <com.owncloud.android.ui.dialog.SsoWebView
+    <!--  com.owncloud.android.ui.dialog.SsoWebView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
         android:id="@+id/sso_webview"
         android:focusable="true"
         android:focusableInTouchMode="true"
         android:clickable="true"
-        />
+        /-->
 
 </RelativeLayout>
index 1aa2823..986ce3e 100644 (file)
@@ -19,7 +19,9 @@
 -->
 <menu  xmlns:android="http://schemas.android.com/apk/res/android">
     
-       <item   android:id="@+id/action_open_file_with"                 android:title="@string/actionbar_open_with"                     android:icon="@android:drawable/ic_menu_edit"                                   android:orderInCategory="1" />
+       <item   android:id="@+id/action_share_file"                             android:title="@string/action_share_file"                       android:icon="@android:drawable/ic_menu_share"                                  android:orderInCategory="1" />
+       <item   android:id="@+id/action_unshare_file"               android:title="@string/action_unshare_file"                 android:icon="@android:drawable/ic_menu_share"                                  android:orderInCategory="1" />
+    <item      android:id="@+id/action_open_file_with"                 android:title="@string/actionbar_open_with"                     android:icon="@android:drawable/ic_menu_edit"                                   android:orderInCategory="1" /> 
        <item   android:id="@+id/action_download_file"                  android:title="@string/filedetails_download"            android:icon="@drawable/ic_action_download"                                             android:orderInCategory="1" />
     <item      android:id="@+id/action_sync_file"                              android:title="@string/filedetails_sync_file"           android:icon="@drawable/ic_action_refresh"                                              android:orderInCategory="1" />
        <item   android:id="@+id/action_cancel_download"                android:title="@string/common_cancel_download"          android:icon="@android:drawable/ic_menu_close_clear_cancel"             android:orderInCategory="1" />
@@ -27,5 +29,6 @@
        <item   android:id="@+id/action_rename_file"                    android:title="@string/common_rename"                           android:icon="@android:drawable/ic_menu_set_as"                                 android:orderInCategory="1" />
     <item      android:id="@+id/action_remove_file"                    android:title="@string/common_remove"                           android:icon="@android:drawable/ic_menu_delete"                                 android:orderInCategory="1" />
     <item      android:id="@+id/action_see_details"                    android:title="@string/actionbar_see_details"           android:icon="@android:drawable/ic_menu_info_details"                   android:orderInCategory="1" />
+    <item      android:id="@+id/action_send_file"                              android:title="@string/actionbar_send_file"                     android:icon="@android:drawable/ic_menu_info_details"                   android:orderInCategory="1" />
     
 </menu>
index 499d68a..64bada0 100644 (file)
@@ -2,24 +2,44 @@
 <resources>
   <string name="about_android">%1$s تطبيق أندرويد</string>
   <string name="about_version">الإصدار %1$s</string>
+  <string name="actionbar_sync">تحديث الحساب</string>
   <string name="actionbar_upload">رفع</string>
   <string name="actionbar_upload_from_apps">محتويات من تطبيقات أخرى</string>
   <string name="actionbar_upload_files">الملفات</string>
+  <string name="actionbar_open_with">فتح باستخدام</string>
   <string name="actionbar_mkdir">إنشاء دليل</string>
-  <string name="actionbar_settings">تعدÙ\8aÙ\84ات</string>
+  <string name="actionbar_settings">إعدادات</string>
   <string name="actionbar_see_details">تفاصيل</string>
+  <string name="actionbar_send_file">أرسل</string>
   <string name="prefs_category_general">عام</string>
   <string name="prefs_category_more">المزيد</string>
   <string name="prefs_accounts">حسابات</string>
+  <string name="prefs_manage_accounts">ادارة الحسابات</string>
+  <string name="prefs_pincode">كلمه السر للتطبيق</string>
+  <string name="prefs_pincode_summary">حمايه العميل</string>
+  <string name="prefs_instant_upload">تفعيل الرفع الفوري</string>
+  <string name="prefs_instant_upload_summary">رفع الصور الماخوذة عن طريق الكاميرا تلقائياً</string>
+  <string name="prefs_log_title">تفعيل الدخول</string>
+  <string name="prefs_log_summary">يستخدم هذا لتسجيل المشاكل</string>
+  <string name="prefs_log_title_history">تاريخ الدخول</string>
+  <string name="prefs_log_summary_history">هذا يعرض السجلات المسجلة</string>
+  <string name="prefs_log_delete_history_button">حذف التاريخ</string>
   <string name="prefs_help">المساعدة</string>
+  <string name="prefs_recommend">توصية الى صديق</string>
+  <string name="prefs_feedback">ملاحظات</string>
   <string name="prefs_imprint">الدمغة.</string>
+  <string name="recommend_subject">جرب %1$s على جهازك الذكي</string>
+  <string name="recommend_text">انا احب ان ادعوك ان تستخدم %1$s على جهازك الذكي\nيمكنك التحميل من هنا : %2$s</string>
+  <string name="auth_check_server">تحقق من الخادم</string>
+  <string name="auth_host_url">عنوان الخادم https://…</string>
   <string name="auth_username">إسم المستخدم</string>
-  <string name="auth_password">Ù\83Ù\84Ù\85ات السر</string>
+  <string name="auth_password">Ù\83Ù\84Ù\85Ø© السر</string>
   <string name="auth_register">جديد لـ %1$s ؟</string>
   <string name="sync_string_files">الملفات</string>
   <string name="setup_btn_connect">اتصال</string>
   <string name="uploader_btn_upload_text">إرفع</string>
-  <string name="uploader_wrn_no_account_title">لم يتم العثور أي حساب</string>
+  <string name="uploader_top_message">اختر مجلد الرفع:</string>
+  <string name="uploader_wrn_no_account_title">لم يتم العثور على أي حساب</string>
   <string name="uploader_wrn_no_account_text">لا يوجد جسابات للـ %1$s في جهازك. يرجى إعداد حساب أولاَ.</string>
   <string name="uploader_wrn_no_account_setup_btn_text">إعداد</string>
   <string name="uploader_wrn_no_account_quit_btn_text">خروج</string>
   <string name="uploader_wrn_no_content_text">لم يتم استلام أي محتويات.</string>
   <string name="uploader_error_forbidden_content">%1$s  غير مسموح له بالوصول للمحتوى المشترك</string>
   <string name="uploader_info_uploading">يتم الرفع</string>
+  <string name="file_list_empty">لا يوجد ملفات في هذا المجلد.\nيمكن انشاء ملف جديد عن طريق خيارات قائمة \"رفع\". </string>
   <string name="filedetails_select_file">اضغظ على الملف ليتم عرض خيارات أكثر</string>
-  <string name="filedetails_size">الحجم</string>
-  <string name="filedetails_type">النوع</string>
-  <string name="filedetails_modified">عُدل</string>
+  <string name="filedetails_size">الحجم:</string>
+  <string name="filedetails_type">النوع:</string>
+  <string name="filedetails_created">انشئ:</string>
+  <string name="filedetails_modified">عُدل:</string>
   <string name="filedetails_download">انزال</string>
   <string name="filedetails_sync_file">تحديث ملف</string>
   <string name="filedetails_renamed_in_upload_msg">تم تغيير اسم الملف إلى  %1$s أثناء الرفع</string>
+  <string name="action_share_file">شارك الرابط</string>
+  <string name="action_unshare_file">الغاء مشاركة الرابط</string>
   <string name="common_yes">نعم</string>
   <string name="common_no">لا</string>
   <string name="common_ok">تم</string>
   <string name="common_cancel_download">إلغاء تحميل</string>
   <string name="common_cancel_upload">إلغاء رفع الملفات</string>
   <string name="common_cancel">الغاء</string>
+  <string name="common_save_exit">احفظ &amp; خروج</string>
   <string name="common_error">خطأ</string>
   <string name="common_loading">تحميل ...</string>
   <string name="common_error_unknown">حدث خطأ غير معروف. </string>
@@ -48,8 +73,8 @@
   <string name="delete_account">حذف الحساب</string>
   <string name="create_account">حساب جديد</string>
   <string name="upload_chooser_title">رفع من</string>
-  <string name="uploader_info_dirname">اسÙ\85 Ø§Ù\84Ù\85سار</string>
-  <string name="uploader_upload_in_progress_ticker">يتم الرفع</string>
+  <string name="uploader_info_dirname">اسÙ\85 Ø§Ù\84Ù\85جÙ\84د</string>
+  <string name="uploader_upload_in_progress_ticker">يتم الرفع ...</string>
   <string name="uploader_upload_in_progress_content">%1$d%% رفع %2$s</string>
   <string name="uploader_upload_succeeded_ticker">تم الرفع بنجاح</string>
   <string name="uploader_upload_succeeded_content_single">تم رفع %1$s  بنجاح </string>
   <string name="uploader_upload_failed_content_single">رفع %1$s قد لا يكون كاملاً</string>
   <string name="downloader_download_in_progress_ticker">يتم التحميل</string>
   <string name="downloader_download_in_progress_content">%1$d%% تنزيل  %2$s</string>
+  <string name="downloader_download_succeeded_ticker">تم التحميل بنجاح</string>
   <string name="downloader_download_succeeded_content">تم تحميل %1$s  بنجاح </string>
   <string name="downloader_download_failed_ticker">فشل التحميل</string>
   <string name="downloader_download_failed_content"> تحميل %1$s قد لا يكون كاملاَ</string>
   <string name="downloader_not_downloaded_yet">لم يتم تحميلها بعد</string>
   <string name="common_choose_account">اختر حساب</string>
+  <string name="sync_fail_ticker">فشل في المزامنة</string>
   <string name="sync_fail_content">تعذر إكمال التزامن لـ %1$s  </string>
   <string name="sync_fail_content_unauthorized">كلمة السر غير صالحة لـ %1$s</string>
+  <string name="sync_conflicts_in_favourites_ticker">يوجد تعارض</string>
   <string name="sync_fail_in_favourites_content"> جهات الاتصال لـ %1$d لا يمكن مزامنتها ( %2$d تعارض) </string>
+  <string name="sync_current_folder_was_removed">لا يوجد مجلد %1$s بعد الان</string>
   <string name="foreign_files_move">نقل الكل</string>
   <string name="foreign_files_success">تم نقل جميع الملفات</string>
   <string name="foreign_files_fail">بعض الملفات لا يمكن نقلها</string>
+  <string name="foreign_files_local_text">محلي:%1$s</string>
   <string name="upload_query_move_foreign_files">لا يوجد مساحة كافية لنسخ الملفات المحددة لمجلد  %1$s . هل ترغب بنقلهم للمجلد بدلاَ من ذلك؟</string>
   <string name="pincode_enter_pin_code">فضلا, ادخل كلمة السر</string>
+  <string name="pincode_configure_your_pin">فضلا, ادخل كلمة السر</string>
+  <string name="pincode_configure_your_pin_explanation">سيتم طلب PIN في كل مرة يتم فيها تشغيل التطبيق</string>
+  <string name="pincode_reenter_your_pincode">فضلا, ادخل كلمة السر مره اخري</string>
+  <string name="pincode_remove_your_pincode">ازاله كلمة السر</string>
+  <string name="pincode_mismatch">كلمات السر غير متطابقه</string>
+  <string name="pincode_wrong">كلمه السر غير صحيحه</string>
+  <string name="pincode_removed">تم ازاله كلمه السر</string>
+  <string name="pincode_stored">تم تسجيل كلمه السر</string>
   <string name="media_notif_ticker">%1$s مشغل الموسيقى</string>
   <string name="media_state_playing">%1$s  (عرض)</string>
   <string name="media_state_loading">%1$s (تحميل)</string>
   <string name="media_event_done">تم الانتهاء من تشغيل %1$s </string>
+  <string name="media_err_nothing_to_play">لا يوجد ملف وسائط</string>
+  <string name="media_err_no_account">لم يتم تقديم اي حساب</string>
+  <string name="media_err_not_in_owncloud">الملف ليس في حساب فعال</string>
+  <string name="media_err_unsupported">ترميز غير مدعوم</string>
+  <string name="media_err_io">لا يمكن قراءة ملف الوسائط</string>
+  <string name="media_err_malformed">لم يتم فك ترميز ملف الوسائط بشكل صحيح</string>
+  <string name="media_err_timeout">انتهت المهلة أثناء محاولة العرض</string>
+  <string name="media_err_unknown">لا يمكن عرض ملف الوسائط مع عارض الوسائط المستعمل</string>
+  <string name="media_err_security_ex">خطا امني اثناء محاولة عرض %1$s</string>
+  <string name="media_err_io_ex">خطا في المدخلات اثناء محاولة عرض %1$s</string>
+  <string name="media_err_unexpected">خطا غير متوقع اثناء محاولة عرض %1$s</string>
+  <string name="auth_trying_to_login">محاولة الدخول ...</string>
   <string name="auth_no_net_conn_title">لا يتوفر اتصال</string>
   <string name="auth_nossl_plain_ok_title">الاتصال الآمن غير متاح</string>
   <string name="auth_connection_established">يتم إنشاء الاتصال</string>
-  <string name="auth_unknown_error_title">حدث خطأ غير معروف</string>
+  <string name="auth_testing_connection">اختبار الاتصال ...</string>
+  <string name="auth_not_configured_title">اعدادات الخاد تالفة </string>
+  <string name="auth_account_not_new">الحساب لنفس المستخدم والخادم موجود مسبقا على الجهاز </string>
+  <string name="auth_account_not_the_same">المستخدم المدخل لا يتوافق مع المستخدم الموجود في الحساب </string>
+  <string name="auth_unknown_error_title">حدث خطأ غير معروف!</string>
+  <string name="auth_unknown_host_title">فشل في العثور على المضيف</string>
+  <string name="auth_incorrect_path_title">تعذر إيجاد جهة الاتصال للسيرفر.</string>
+  <string name="auth_timeout_title">الخادم اخذ الكثير من الوقت للرد</string>
+  <string name="auth_incorrect_address_title">رابط تالف</string>
+  <string name="auth_ssl_general_error_title">فشل في انشاء SSL</string>
+  <string name="auth_bad_oc_version_title">لم يتم التعرف على اصدار الخادم</string>
   <string name="auth_wrong_connection_title">لا يمكن إنشاء اتصال</string>
   <string name="auth_secure_connection">تم إنشاء اتصال آمن</string>
+  <string name="auth_unauthorized">خطا في الاسم او كلمة المرور</string>
+  <string name="auth_oauth_error">فشل في التحقق</string>
+  <string name="auth_oauth_error_access_denied">تم رفض الوصول من قبل الخادم المرخص</string>
+  <string name="auth_wtf_reenter_URL">حالة غير متوقعة: الرجاء, ادخال عنوان الخادم مرة اخرى</string>
+  <string name="auth_expired_oauth_token_toast">مدة التحقق انتهت , يرجى اعادة التحقق </string>
+  <string name="auth_expired_basic_auth_toast">يرجى ادخال كلمة المرور الحالية</string>
+  <string name="auth_expired_saml_sso_token_toast">مدة الجلسة انتهت , يرجى اعادة الاتصال</string>
+  <string name="auth_connecting_auth_server">يتم الاتصال بالخادم للتحقق</string>
+  <string name="auth_unsupported_auth_method">الخادم لا يدعم طريقة التحقق هذه</string>
+  <string name="auth_unsupported_multiaccount">%1$s لا يدعم الحسابات المتعددة </string>
+  <string name="fd_keep_in_sync">اجعل الملف محدث</string>
   <string name="common_rename">إعادة تسميه</string>
   <string name="common_remove">الغى</string>
   <string name="confirmation_remove_alert">هل تود حقاَ إزالة %1$s ؟ </string>
   <string name="confirmation_remove_folder_alert">هل ترغب في إزالة %1$s و جهات الاتصال التابعة له؟ </string>
+  <string name="confirmation_remove_local">محلي فقط</string>
   <string name="confirmation_remove_folder_local">المحتويات المحلية فقط</string>
   <string name="confirmation_remove_remote">حذف من الخادم</string>
+  <string name="confirmation_remove_remote_and_local">شبكي و محلي</string>
   <string name="remove_success_msg">يتم الحذف بنجاح</string>
   <string name="remove_fail_msg">لقد فشل الحذف</string>
   <string name="rename_dialog_title">أدخل اسما جديدا</string>
+  <string name="rename_local_fail_msg">لايمكن اعادة تسمية النسخ المحلي  ,حاول باسم آخر </string>
+  <string name="rename_server_fail_msg">اعادة التسمية لم تكتمل</string>
+  <string name="sync_file_nothing_to_do_msg">محتويات الملفات متزامنة سابقا</string>
+  <string name="create_dir_fail_msg">لم يتمكن من انشاء المجلد</string>
+  <string name="filename_forbidden_characters">رموز ممنوعة: / \\ &lt; &gt; : \" | ? *</string>
   <string name="wait_a_moment">فضلاً, انتظر</string>
+  <string name="filedisplay_unexpected_bad_get_content">خطا غير متوقع : الرجاء اختيار الملف من برنامج آخر</string>
   <string name="filedisplay_no_file_selected">لم يتم اختيار أي ملف</string>
+  <string name="activity_chooser_title">ارسل الرابط الى ...</string>
+  <string name="oauth_check_onoff">تسجيل الدخول باستخدام oAuth2</string>
+  <string name="oauth_login_connection">الاتصال مع خادم oAuth2</string>
+  <string name="ssl_validator_header">تعذر التحقق من هوية الموقع</string>
+  <string name="ssl_validator_reason_cert_not_trusted">شهادة الخادم غير موثوقة</string>
+  <string name="ssl_validator_reason_cert_expired">شهادة الخادم منتهية</string>
+  <string name="ssl_validator_reason_cert_not_yet_valid">تاريخ صلاحية شهادة الخادم في المستقبل</string>
+  <string name="ssl_validator_reason_hostname_not_verified">هذه الوصله غير متطابقه مع السيرفر فى  شهاده الحمايه </string>
+  <string name="ssl_validator_question">هل تريد ان تثق في هذه الشهادة على اي حال ؟</string>
+  <string name="ssl_validator_not_saved">لم يتمكن من حفظ الشهادة </string>
   <string name="ssl_validator_btn_details_see">تفاصيل</string>
   <string name="ssl_validator_btn_details_hide">إخفاء</string>
+  <string name="ssl_validator_label_subject">أصدرت ل:</string>
   <string name="ssl_validator_label_CN">الاسم الشائع:</string>
   <string name="ssl_validator_label_O">منظمة:</string>
   <string name="ssl_validator_label_OU">الوحدة التنظيمية:</string>
   <string name="ssl_validator_label_C">البلد:</string>
+  <string name="ssl_validator_label_ST">حالة:</string>
   <string name="ssl_validator_label_L">المكان:</string>
   <string name="ssl_validator_label_validity_from">من:</string>
   <string name="ssl_validator_label_validity_to">إلى:</string>
   <string name="ssl_validator_label_signature">التوقيع:</string>
   <string name="ssl_validator_label_signature_algorithm">الخوارزمية:</string>
+  <string name="placeholder_filetype">صورة PNG</string>
   <string name="placeholder_filesize">389 KB</string>
   <string name="placeholder_media_time">12:23:45</string>
+  <string name="instant_upload_on_wifi">رفع الصور من خلال الواي فاي فقط</string>
+  <string name="conflict_title">تعارض في التحديث </string>
+  <string name="conflict_dont_upload">عدم الرفع</string>
   <string name="preview_image_description">معاينة الصورة</string>
   <string name="preview_image_error_unknown_format">هذه الصورة لا يمكن أن تظهر</string>
+  <string name="error__upload__local_file_not_copied">%1$s لم يتمكن من النسخ الى %2$s في المجلد المحلي</string>
+  <string name="actionbar_failed_instant_upload">فشل في محاولة الرفع الفوري</string>
+  <string name="failed_upload_headline_text">فشل في الرفع الفوري</string>
+  <string name="failed_upload_headline_hint">ملخص لكل الاخطاء في عملية الرفع الفوري</string>
   <string name="failed_upload_all_cb">تحديد الكل</string>
+  <string name="failed_upload_headline_retryall_btn">اعادة كل المختارات</string>
+  <string name="failed_upload_headline_delete_all_btn">حذف كل المختارات من قائمة انتظار الرفع</string>
+  <string name="failed_upload_retry_text">اعادة المحاولة لرفع الصورة:</string>
+  <string name="failed_upload_load_more_images">تحميل المزيد من الصور</string>
+  <string name="failed_upload_failure_text">رسالة خطا:</string>
+  <string name="failed_upload_quota_exceeded_text">الرجاء التاكد من اعدادات الخادم, من الممكن انك تعديت الحد في quota</string>
+  <string name="share_link_no_support_share_api">عذرا , المشاركة غير مفعلة في الخادم. الرجاء التواصل مع المدير</string>
+  <string name="share_link_file_no_exist">لم يتمكن من مشاركة الملف او المجلد. يرجى التاكد من وجوده </string>
+  <string name="share_link_file_error">حدث خطأ ما أثناء محاولة مشاركة هذا الملف أو المجلد</string>
+  <string name="unshare_link_file_no_exist">غير قادر على إلغاء مشاركة هذا الملف أو المجلد.لا وجود له</string>
+  <string name="unshare_link_file_error">حدث خطأ ما أثناء محاولة إلغاء مشاركة هذا الملف أو المجلد</string>
+  <string name="activity_chooser_send_file_title">أرسل</string>
 </resources>
index 335b1b4..c9254b1 100644 (file)
@@ -5,6 +5,7 @@
   <string name="actionbar_upload_files">Файлове</string>
   <string name="actionbar_mkdir">Нова директория</string>
   <string name="actionbar_settings">Настройки</string>
+  <string name="actionbar_send_file">Изпрати</string>
   <string name="prefs_category_general">Общи</string>
   <string name="prefs_category_more">Още</string>
   <string name="prefs_accounts">Профили</string>
@@ -74,4 +75,5 @@
   <string name="wait_a_moment">Изчакайте малко</string>
   <string name="filedisplay_no_file_selected">Не е избран файл</string>
   <string name="ssl_validator_header">Самоличността на сайта не може да бъде проверена</string>
+  <string name="activity_chooser_send_file_title">Изпрати</string>
 </resources>
index 2454ad3..05c1c29 100644 (file)
@@ -4,6 +4,7 @@
   <string name="actionbar_upload_files">ফাইল</string>
   <string name="actionbar_mkdir">ডিরেক্টরি তৈরী কর</string>
   <string name="actionbar_settings">নিয়ামকসমূহ</string>
+  <string name="actionbar_send_file">পাঠাও</string>
   <string name="prefs_category_general">সাধারণ</string>
   <string name="prefs_category_more">বেশী</string>
   <string name="prefs_accounts">একাউন্ট</string>
@@ -34,4 +35,5 @@
   <string name="common_choose_account">একাউন্ট নির্বাচন</string>
   <string name="common_rename">পূনঃনামকরণ</string>
   <string name="common_remove">অপসারণ</string>
+  <string name="activity_chooser_send_file_title">পাঠাও</string>
 </resources>
index ebdee27..85c4acc 100644 (file)
@@ -10,6 +10,7 @@
   <string name="actionbar_mkdir">Crea una carpeta</string>
   <string name="actionbar_settings">Configuració</string>
   <string name="actionbar_see_details">Detalls</string>
+  <string name="actionbar_send_file">Envia</string>
   <string name="prefs_category_general">General</string>
   <string name="prefs_category_more">Més</string>
   <string name="prefs_accounts">Comptes</string>
@@ -55,6 +56,8 @@
   <string name="filedetails_download">Baixa</string>
   <string name="filedetails_sync_file">Actualitza el fitxer</string>
   <string name="filedetails_renamed_in_upload_msg">L\'arxiu s\'ha canviat de nom a %1$s durant la càrrega</string>
+  <string name="action_share_file">Enllaç de compartició</string>
+  <string name="action_unshare_file">Deixa de compartir l\'enllaç</string>
   <string name="common_yes">Sí</string>
   <string name="common_no">No</string>
   <string name="common_ok">D\'acord</string>
@@ -94,7 +97,7 @@
   <string name="sync_fail_in_favourites_content">El contingut de %1$d arxius no es va poder sincronitzar (%2$d conflictes)</string>
   <string name="sync_foreign_files_forgotten_ticker">S\'han oblidat alguns fitxers locals</string>
   <string name="sync_foreign_files_forgotten_content">%1$d fitxers no s\'han pogut copiar dins de %2$s carpetes</string>
-  <string name="sync_foreign_files_forgotten_explanation">Des de la versió 1.3.16, els fitxers pujats des d\'aquest dispositiu es copien a la carpeta local %1$s per prevenir pèrdues de dades quan es sincronitza un únic fitxer amb diversos comptes.\n\nDegut a aquest canvi, tots els fitxers pujats en versions anteriors d\'aquesta aplicació es copiaven a la carpeta %2$s. Malgrat tot, un error impedia aquesta operació durant la sinconització del compte. Podeu deixar els fitxer(s) tal i com estan i eliminar l\'enllaç a %3$2, o moure els fitxer(s) a la carpeta %1$s i retenir l\'enllaç a %4$s.\n\nA baix hi ha els fitxers local(s) i els fitxer(s) remots a %5$s als que estaven enllaçats.</string>
+  <string name="sync_foreign_files_forgotten_explanation">Des de la versió 1.3.16, els fitxers pujats des d\'aquest dispositiu es copien a la carpeta local %1$s per prevenir pèrdues de dades quan es sincronitza un únic fitxer amb diversos comptes.\n\nDegut a aquest canvi, tots els fitxers pujats en versions anteriors d\'aquesta aplicació es copiaven a la carpeta %2$s. Malgrat tot, un error impedia aquesta operació durant la sinconització del compte. Podeu deixar els fitxer(s) tal i com estan i eliminar l\'enllaç a %3$s, o moure els fitxer(s) a la carpeta %1$s i retenir l\'enllaç a %4$s.\n\nA baix hi ha els fitxers local(s) i els fitxer(s) remots a %5$s als que estaven enllaçats.</string>
   <string name="sync_current_folder_was_removed">La carpeta %1$s ja no existeix</string>
   <string name="foreign_files_move">Mou-los tots</string>
   <string name="foreign_files_success">S\'han mogut tots els fitxers</string>
   <string name="wait_a_moment">Espereu</string>
   <string name="filedisplay_unexpected_bad_get_content">S\'ha produït un problema inesperat; proveu una altra aplicació per seleccionar el fitxer</string>
   <string name="filedisplay_no_file_selected">No heu seleccionat cap fitxer</string>
+  <string name="activity_chooser_title">Envia l\'enllaç a...</string>
   <string name="oauth_check_onoff">Accés amb oAuth2</string>
   <string name="oauth_login_connection">Connectant amb el servidor oAuth2...</string>
   <string name="ssl_validator_header">No s\'ha pogut verificar la identitat del lloc web</string>
   <string name="failed_upload_retry_do_nothing_text">no facis res, no estàs en lína per la pujada instantània</string>
   <string name="failed_upload_failure_text">Missatge d\'Error:</string>
   <string name="failed_upload_quota_exceeded_text">Comproveu la configuració del servidor, potser heu excedit la quota.</string>
+  <string name="share_link_no_support_share_api">La compartició no es troba disponible al vostre servidor. Contacteu amb l\'administrador.</string>
+  <string name="share_link_file_no_exist">No es pot compartir aquest fitxer o carpeta. Assegureu-vos que existeix</string>
+  <string name="share_link_file_error">S\'ha produït un error en intentar compartir aquest fitxer o carpeta</string>
+  <string name="unshare_link_file_no_exist">No es pot deixar de compartir aquest fitxer o carpeta. No existeix.</string>
+  <string name="unshare_link_file_error">S\'ha produït un error en intentar deixar de compartir aquest fitxer o carpeta</string>
+  <string name="activity_chooser_send_file_title">Envia</string>
+  <string name="copy_link">Copia l\'enllaç</string>
+  <string name="clipboard_text_copied">S\'ha copiat al porta-retalls</string>
 </resources>
index 9af81e4..787f3f3 100644 (file)
@@ -10,6 +10,7 @@
   <string name="actionbar_mkdir">Vytvořit adresář</string>
   <string name="actionbar_settings">Nastavení</string>
   <string name="actionbar_see_details">Podrobnosti</string>
+  <string name="actionbar_send_file">Odeslat</string>
   <string name="prefs_category_general">Obecné</string>
   <string name="prefs_category_more">Více</string>
   <string name="prefs_accounts">Účty</string>
@@ -55,6 +56,8 @@
   <string name="filedetails_download">Stáhnout</string>
   <string name="filedetails_sync_file">Obnovit soubor</string>
   <string name="filedetails_renamed_in_upload_msg">Soubor byl v průběhu odesílání přejmenován na %1$s</string>
+  <string name="action_share_file">Sdílet odkaz</string>
+  <string name="action_unshare_file">Zrušit sdílení odkazu</string>
   <string name="common_yes">Ano</string>
   <string name="common_no">Ne</string>
   <string name="common_ok">OK</string>
@@ -94,7 +97,7 @@
   <string name="sync_fail_in_favourites_content">Obsah %1$d souborů nemohl být synchronizován (počet konfliktů: %2$d)</string>
   <string name="sync_foreign_files_forgotten_ticker">Některé místní soubory byly zapomenuty</string>
   <string name="sync_foreign_files_forgotten_content">%1$d souborů z adresáře %2$s nelze zkopírovat do</string>
-  <string name="sync_foreign_files_forgotten_explanation">Od verze 1.3.16 jsou soubory odeslané z tohoto zařízení, pro ochranu proti ztrátě dat při synchronizaci z více účtů, nahrány do místní složky %1$s.\n\nVšechny soubory odeslané předchozími verzemi byly kvůli této změně přesunuty do složky %2$s. Bohužel chyba zabránila dokončení této operace při synchronizaci účtu. Můžete nyní ponechat soubory ve stávajícím stavu a smazat odkaz na %3$s nebo přesunout soubory do adresáře %1$s a zachovat odkazy na %4$s.\n\nNásleduje seznam místních souborů a jejich odkazů na vzdálené soubory v %5$s.</string>
+  <string name="sync_foreign_files_forgotten_explanation">Od verze 1.3.16 jsou soubory nahrané z tohoto zařízení kopírovány do místní %1$s složky, aby se zabránilo ztrátě dat při synchronizaci jednoho souboru s více účty.\n\nVšechny soubory nahrané předchozími verzemi aplikace byly z tohoto důvodu překopírovány do složky %2$s. Přesto se objevila chyba zabraňující dokončení této operace v průběhu synchronizace účtu. Buď můžete soubor(y) ponechat jak jsou a odebrat odkaz do složky %3$s nebo přesunout soubor(y) do složky %1$s a zachovat odkaz na %4$s.\n\nNíže je seznam místních a vzdálených souborů ve složce %5$s, do které byly odkázány.</string>
   <string name="sync_current_folder_was_removed">Složka %1$s již neexistuje</string>
   <string name="foreign_files_move">Přesunout vše</string>
   <string name="foreign_files_success">Všechny soubory byly přesunuty</string>
   <string name="wait_a_moment">Počkejte chvíli</string>
   <string name="filedisplay_unexpected_bad_get_content">Neočekávaný problém - zkuste zvolit soubor jinou aplikací</string>
   <string name="filedisplay_no_file_selected">Žádný soubor nebyl vybrán</string>
+  <string name="activity_chooser_title">Odeslat odkaz ...</string>
   <string name="oauth_check_onoff">Přihlásit se s oAuth2</string>
   <string name="oauth_login_connection">Připojuji se k oAuth2 serveru...</string>
   <string name="ssl_validator_header">Identitu stránky nelze ověřit</string>
   <string name="failed_upload_retry_do_nothing_text">nic nedělat nejste připojeni pro okamžité odeslání</string>
   <string name="failed_upload_failure_text">Chybová zpráva:</string>
   <string name="failed_upload_quota_exceeded_text">Zkontrolujte prosím nastavení vašeho serveru, možná jste překročili kvótu.</string>
+  <string name="share_link_no_support_share_api">Je nám líto, ale sdílení není na vašem serveru povoleno. Kontaktujte vašeho administrátora.</string>
+  <string name="share_link_file_no_exist">Nepodařilo se sdílet tento soubor či složku. Ujistěte se, že existuje.</string>
+  <string name="share_link_file_error">Při pokusu o sdílení tohoto souboru či složky nastala chyba</string>
+  <string name="unshare_link_file_no_exist">Nepodařilo se zrušit sdílení tohoto souboru nebo složky, protože neexistuje.</string>
+  <string name="unshare_link_file_error">Při pokusu o zrušení sdílení tohoto souboru či složky nastala chyba</string>
+  <string name="activity_chooser_send_file_title">Odeslat</string>
+  <string name="copy_link">Zkopírovat odkaz</string>
+  <string name="clipboard_text_copied">Zkopírováno do schránky</string>
 </resources>
index de4ffef..93e8775 100644 (file)
@@ -5,6 +5,7 @@
   <string name="actionbar_upload_files">Ffeiliau</string>
   <string name="actionbar_mkdir">Creu cyfeiriadur</string>
   <string name="actionbar_settings">Gosodiadau</string>
+  <string name="actionbar_send_file">Anfon</string>
   <string name="prefs_category_general">Cyffredinol</string>
   <string name="prefs_accounts">Cyfrifon</string>
   <string name="prefs_manage_accounts">Rheoli Cyfrifon</string>
   <string name="conflict_overwrite">Trosysgrifio</string>
   <string name="conflict_dont_upload">Peidio llwytho i fyny</string>
   <string name="error__upload__local_file_not_copied">Methwyd copïo %1$s i blygell lleol %2$s</string>
+  <string name="activity_chooser_send_file_title">Anfon</string>
 </resources>
index 14d3ed0..7fae754 100644 (file)
@@ -10,6 +10,7 @@
   <string name="actionbar_mkdir">Opret mappe</string>
   <string name="actionbar_settings">Indstillinger</string>
   <string name="actionbar_see_details">Detaljer</string>
+  <string name="actionbar_send_file">Send</string>
   <string name="prefs_category_general">Generel</string>
   <string name="prefs_category_more">Mere</string>
   <string name="prefs_accounts">Konti</string>
@@ -55,6 +56,8 @@
   <string name="filedetails_download">Hent</string>
   <string name="filedetails_sync_file">Opdater fil</string>
   <string name="filedetails_renamed_in_upload_msg">Filen blev omdøbt til %1$s under upload</string>
+  <string name="action_share_file">Del link</string>
+  <string name="action_unshare_file">Ophæv deling</string>
   <string name="common_yes">Ja</string>
   <string name="common_no">Nej</string>
   <string name="common_ok">OK</string>
@@ -94,7 +97,6 @@
   <string name="sync_fail_in_favourites_content">Indholdet af %1$d filer ikke kunne synkroniseres (%2$d konflikter)</string>
   <string name="sync_foreign_files_forgotten_ticker">Visse lokale filer blev glemt</string>
   <string name="sync_foreign_files_forgotten_content">%1$d filer ud af %2$s mappe kunne ikke kopieres ind i</string>
-  <string name="sync_foreign_files_forgotten_explanation">Fra version 1.3.16 bliver filer uploadet fra denne enhed kopieret til mappen %1$s for at forhindre datatab når en enkelt fil synkroniseres med flere konti.\n\nPå grund af denne ændring blev alle filer uploadet i tidligere versioner af denne app kopieret til mappen %2$s. Imidlertid forhindrede en fejl færdiggørelsen af denne operation under konto-synkronisering. Du kan enten lade filerne være som de er og fjerne linket til %3$s eller flytte filerne til mappen %1$s og beholde linket til %4$s.\n\nHerunder er en liste med de lokale filer og de eksterne filer i %5$s, som de var knyttet til.</string>
   <string name="sync_current_folder_was_removed">Mappen %1$s eksistere ikke længere</string>
   <string name="foreign_files_move">Flyt alle</string>
   <string name="foreign_files_success">Alle filer blev flyttet</string>
   <string name="media_err_unsupported">Ikke-understøttet medie codec</string>
   <string name="media_err_io">Mediefilen kunne ikke læses</string>
   <string name="media_err_malformed">Mediefilen er ikke korrekt kodet</string>
+  <string name="media_err_timeout">Tiden udløb under forsøg på at afspille</string>
   <string name="media_err_invalid_progressive_playback">Mediefilen kan ikke streames</string>
   <string name="media_err_unknown">Mediefil kan ikke afspilles med tilgængelige medieafspiller</string>
   <string name="media_err_security_ex">Sikkerhedsfejl ved forsøg på afspilning af </string>
   <string name="auth_testing_connection">Afprøver forbindelse ...</string>
   <string name="auth_not_configured_title">Misdannet server konfiguration</string>
   <string name="auth_account_not_new">En konto for den samme bruger og server eksisterer allerede på enheden</string>
+  <string name="auth_account_not_the_same">Den indtastede bruger passer ikke til brugeren for denne konto</string>
   <string name="auth_unknown_error_title">Ukendt fejl opstod!</string>
   <string name="auth_unknown_host_title">Kunne ikke finde host</string>
   <string name="auth_incorrect_path_title">Server instans blev ikke fundet</string>
   <string name="wait_a_moment">Vent et øjeblik</string>
   <string name="filedisplay_unexpected_bad_get_content">Uforventet problem; prøv venligst anden applikation til at vælge filen</string>
   <string name="filedisplay_no_file_selected">Ingen fil blev valgt</string>
+  <string name="activity_chooser_title">Send link til ...</string>
   <string name="oauth_check_onoff">Log på med oAuth2</string>
   <string name="oauth_login_connection">Forbinder til oAuth2 server...</string>
   <string name="ssl_validator_header">Sidens identitet kunne ikke verificeres</string>
   <string name="preview_image_description">Billede preview</string>
   <string name="preview_image_error_unknown_format">Dette billede kan ikke vises</string>
   <string name="error__upload__local_file_not_copied">%1$s kunne ikke kopieres til %2$s lokale mappe</string>
+  <string name="actionbar_failed_instant_upload">Fejlede Umiddelbar upload</string>
   <string name="failed_upload_headline_text">Øjeblikkelige uploads mislykkedes</string>
   <string name="failed_upload_headline_hint">Sammenfatning af alle mislykkede øjeblikkelige uploads</string>
   <string name="failed_upload_all_cb">Vælg alle</string>
   <string name="failed_upload_retry_do_nothing_text">gør intet, du er ikke online til øjeblikkelig upload</string>
   <string name="failed_upload_failure_text">Fejlmeddelelse</string>
   <string name="failed_upload_quota_exceeded_text">Tjek din serverkonfiguration, måske er din kvota overskredet.</string>
+  <string name="share_link_no_support_share_api">Beklager, deling er ikke slået til på din server. Kontakt venligst din administrator.</string>
+  <string name="share_link_file_no_exist">Kan ikke dele denne fil eller mappe. Find venligst ud af om den eksisterer</string>
+  <string name="share_link_file_error">Der opstod en fejl ved deling af denne fil eller mappe</string>
+  <string name="unshare_link_file_error">Der opstod en fejl ved stopning af deling af denne mappe.</string>
+  <string name="activity_chooser_send_file_title">Send</string>
+  <string name="copy_link">Kopier link</string>
+  <string name="clipboard_text_copied">Kopieret til udklipsholder</string>
 </resources>
index c757504..4a150b4 100644 (file)
@@ -1,2 +1,8 @@
 <?xml version='1.0' encoding='UTF-8'?>
-<resources/>
+<resources>
+  <string name="actionbar_settings">Einstellungen</string>
+  <string name="prefs_category_general">Allgemein</string>
+  <string name="auth_password">Passwort</string>
+  <string name="filedetails_download">Herunterladen</string>
+  <string name="common_cancel">Abbrechen</string>
+</resources>
index d995da1..28d3fd3 100644 (file)
@@ -10,6 +10,7 @@
   <string name="actionbar_mkdir">Ordner anlegen</string>
   <string name="actionbar_settings">Einstellungen</string>
   <string name="actionbar_see_details">Details</string>
+  <string name="actionbar_send_file">Senden</string>
   <string name="prefs_category_general">Allgemein</string>
   <string name="prefs_category_more">Mehr</string>
   <string name="prefs_accounts">Konten</string>
@@ -90,7 +91,6 @@
   <string name="sync_fail_in_favourites_content">Inhalte von %1$d konnte nicht synchronisiert werden (%2$d Konflikte)</string>
   <string name="sync_foreign_files_forgotten_ticker">Einige lokale Dateien wurden vergessen</string>
   <string name="sync_foreign_files_forgotten_content">%1$d Dateien aus dem Verzeichnis %2$s konnten nicht kopiert werden nach</string>
-  <string name="sync_foreign_files_forgotten_explanation">«Mit Version 1.3.16 werden Dateien die von diesem Gerät aus hochgeladen werden in den lokalen Ordner %1$s kopiert um Datenverlust zu vermeiden, wenn eine einzelne Datei mit mehreren Accounts synchronisiert wird.\n\nInfolge dieser Änderung wurden alle Dateien, die mit vorherigen Versionen dieser App hochgeladen wurden, in den Ordner %2$s verschoben. Jedoch ist während der Account-Synchronisation ein Fehler aufgetreten, der das Abschliessen dieses Vorgangs verhindert. Sie können die Datei(en) entweder wie sie sind belassen und den Link zu %3$s entfernen oder die Datei(en) in den %1$s Ordner verschieben und  den Link zu %4$s beibehalten.\n\nUnten befindet sich eine Liste der lokalen Datei(en) und der mit ihnen verbundenen Remote-Datei(en) in %5$s.</string>
   <string name="foreign_files_move">Verschiebe alle</string>
   <string name="foreign_files_success">Alle Dateien wurden verschoben</string>
   <string name="foreign_files_fail">Einige Dateien konnten nicht verschoben werden</string>
   <string name="failed_upload_retry_do_nothing_text">Nicht durchgeführt - Nicht online für sofortigen Upload</string>
   <string name="failed_upload_failure_text">Fehlermeldung:</string>
   <string name="failed_upload_quota_exceeded_text">Bitte überprüfen Sie Ihre Serverkonfiguration. Vielleicht ist Ihr Nutzungslimit überschritten.</string>
+  <string name="activity_chooser_send_file_title">Senden</string>
+  <string name="clipboard_text_copied">In die Zwischenablage kopiert</string>
 </resources>
index 63a2446..2cbdd78 100644 (file)
@@ -10,6 +10,7 @@
   <string name="actionbar_mkdir">Ordner anlegen</string>
   <string name="actionbar_settings">Einstellungen</string>
   <string name="actionbar_see_details">Details</string>
+  <string name="actionbar_send_file">Senden</string>
   <string name="prefs_category_general">Allgemein</string>
   <string name="prefs_category_more">Mehr</string>
   <string name="prefs_accounts">Konten</string>
@@ -55,6 +56,8 @@
   <string name="filedetails_download">Herunterladen</string>
   <string name="filedetails_sync_file">Datei aktualisieren</string>
   <string name="filedetails_renamed_in_upload_msg">Datei wurde wärend des Uploads zu %1$s umbenannt</string>
+  <string name="action_share_file">Link teilen</string>
+  <string name="action_unshare_file">Link nicht mehr teilen</string>
   <string name="common_yes">Ja</string>
   <string name="common_no">Nein</string>
   <string name="common_ok">OK</string>
@@ -94,7 +97,7 @@
   <string name="sync_fail_in_favourites_content">Inhalte von %1$d konnte nicht synchronisiert werden (%2$d Konflikte)</string>
   <string name="sync_foreign_files_forgotten_ticker">Einige lokale Dateien wurden vergessen</string>
   <string name="sync_foreign_files_forgotten_content">%1$d Dateien aus dem Verzeichnis %2$s konnten nicht kopiert werden nach</string>
-  <string name="sync_foreign_files_forgotten_explanation">\"Mit Version 1.3.16 werden Dateien die von diesem Gerät aus hochgeladen werden in den lokalen Ordner %1$s kopiert um Datenverlust zu vermeiden, wenn eine einzelne Datei mit mehreren Accounts synchronisiert wird.\n\nInfolge dieser Änderung wurden alle Dateien, die mit vorherigen Versionen dieser App hochgeladen wurden, in den Ordner %2$s verschoben. Jedoch ist während der Account-Synchronisation ein Fehler aufgetreten, der das Abschließen dieses Vorgangs verhindert. Sie können die Datei(en) entweder wie sie sind belassen und den Link zu %3$s entfernen oder die Datei(en) in den %1$s Ordner verschieben und  den Link zu %4$s beibehalten.\n\nUnten befindet sich eine Liste der lokalen Datei(en) und der mit ihnen verbundenen Remote-Datei(en) in %5$s.</string>
+  <string name="sync_foreign_files_forgotten_explanation">Mit Version 1.3.16 werden Dateien die von diesem Gerät aus hochgeladen werden in den lokalen Ordner %1$s kopiert um Datenverlust zu vermeiden, wenn eine einzelne Datei mit mehreren Accounts synchronisiert wird.\n\nInfolge dieser Änderung wurden alle Dateien, die mit vorherigen Versionen dieser App hochgeladen wurden, in den Ordner %2$s verschoben. Jedoch ist während der Account-Synchronisation ein Fehler aufgetreten, der das Abschließen dieses Vorgangs verhindert. Sie können die Datei(en) entweder wie sie sind belassen und den Link zu %3$s entfernen oder die Datei(en) in den %1$s Ordner verschieben und  den Link zu %4$s beibehalten.\n\nUnten befindet sich eine Liste der lokalen Datei(en) und der mit ihnen verbundenen Remote-Datei(en) in %5$s.</string>
   <string name="sync_current_folder_was_removed">Das Verzeichnis %1$s existiert nicht mehr</string>
   <string name="foreign_files_move">Verschiebe alle</string>
   <string name="foreign_files_success">Alle Dateien wurden verschoben</string>
   <string name="auth_connecting_auth_server">Verbinde mit dem Authentifizierung-Server…</string>
   <string name="auth_unsupported_auth_method">Der Server unterstützt diese Authentifizierung-Methode nicht</string>
   <string name="auth_unsupported_multiaccount">%1$s unterstützt nicht mehrere Benutzerkonten</string>
+  <string name="auth_fail_get_user_name">Ihr Server gibt keine korrekte Benutzer-ID zurück, bitte nehmen Sie Kontakt zu Ihrem Administrator auf.</string>
   <string name="fd_keep_in_sync">Datei aktuell halten</string>
   <string name="common_rename">Umbenennen</string>
   <string name="common_remove">Löschen</string>
   <string name="wait_a_moment">Bitte warten Sie einen Moment.</string>
   <string name="filedisplay_unexpected_bad_get_content">Ein unerwartetes Problem ist aufgetreten. Bitte versuchen Sie, die Datei in einer anderen App zu öffnen.</string>
   <string name="filedisplay_no_file_selected">Es wurde keine Datei ausgewählt.</string>
+  <string name="activity_chooser_title">Link senden an ...</string>
   <string name="oauth_check_onoff">Anmelden mit oAuth2</string>
   <string name="oauth_login_connection">Verbinde mit dem oAuth2-Server…</string>
   <string name="ssl_validator_header">Die Identität der Website konnte nicht überprüft werden</string>
   <string name="failed_upload_retry_do_nothing_text">Nicht durchgeführt - Nicht online für sofortigen Upload</string>
   <string name="failed_upload_failure_text">Fehlermeldung:</string>
   <string name="failed_upload_quota_exceeded_text">Bitte überprüfen Sie Ihre Serverkonfiguration. Vielleicht ist Ihr Nutzungslimit überschritten.</string>
+  <string name="share_link_no_support_share_api">Entschuldigung, Freigaben sind auf Ihrem Server nicht aktiviert. Bitte kontaktieren Sie Ihren Administrator.</string>
+  <string name="share_link_file_no_exist">Die Freigabe der Datei oder des Ordners ist nicht möglich. Bitte stellen Sie sicher, dass diese existiert.</string>
+  <string name="share_link_file_error">Es ist ein Fehler beim Freigeben der Datei oder des Ordners aufgetreten.</string>
+  <string name="unshare_link_file_no_exist">Das Entfernen der Freigabe für die Datei oder den Ordner ist nicht möglich. Diese existieren nicht.</string>
+  <string name="unshare_link_file_error">Es ist ein Fehler beim Entfernen der Freigabe für diese Datei oder den Ordner aufgetreten.</string>
+  <string name="activity_chooser_send_file_title">Senden</string>
+  <string name="copy_link">Link kopieren</string>
+  <string name="clipboard_text_copied">In die Zwischenablage kopiert</string>
 </resources>
index 588837a..e50ad68 100644 (file)
@@ -10,6 +10,7 @@
   <string name="actionbar_mkdir">Ordner anlegen</string>
   <string name="actionbar_settings">Einstellungen</string>
   <string name="actionbar_see_details">Details</string>
+  <string name="actionbar_send_file">Senden</string>
   <string name="prefs_category_general">Allgemein</string>
   <string name="prefs_category_more">Mehr</string>
   <string name="prefs_accounts">Konten</string>
@@ -55,6 +56,8 @@
   <string name="filedetails_download">Herunterladen</string>
   <string name="filedetails_sync_file">Datei aktualisieren</string>
   <string name="filedetails_renamed_in_upload_msg">Datei wurde wärend des Uploads zu %1$s umbenannt</string>
+  <string name="action_share_file">Link Teilen</string>
+  <string name="action_unshare_file">Link nicht mehr freigeben</string>
   <string name="common_yes">Ja</string>
   <string name="common_no">Nein</string>
   <string name="common_ok">OK</string>
@@ -94,7 +97,7 @@
   <string name="sync_fail_in_favourites_content">Inhalte von %1$d konnte nicht synchronisiert werden (%2$d Konflikte)</string>
   <string name="sync_foreign_files_forgotten_ticker">Einige lokale Dateien wurden vergessen</string>
   <string name="sync_foreign_files_forgotten_content">%1$d Dateien aus dem Verzeichnis %2$s konnten nicht kopiert werden nach</string>
-  <string name="sync_foreign_files_forgotten_explanation">\"Mit Version 1.3.16 werden Dateien die von diesem Gerät aus hochgeladen werden in den lokalen Ordner %1$s kopiert, um Datenverlust zu vermeiden, wenn eine einzelne Datei mit mehreren Accounts synchronisiert wird.\n\nInfolge dieser Änderung wurden alle Dateien, die mit vorherigen Versionen dieser App hochgeladen wurden, in den Ordner %2$s verschoben. Jedoch ist während der Account-Synchronisation ein Fehler aufgetreten, der das Abschließen dieses Vorgangs verhindert. Du kannst die Datei(en) entweder wie sie sind belassen und den Link zu %3$s entfernen, oder die Datei(en) in den %1$s Ordner verschieben, und  den Link zu %4$s beibehalten.\n\nUnten befindet sich eine Liste der lokalen Datei(en) und der mit ihnen verbundenen Remote-Datei(en) in %5$s.</string>
+  <string name="sync_foreign_files_forgotten_explanation">Mit Version 1.3.16 werden Dateien die von diesem Gerät aus hochgeladen werden in den lokalen Ordner %1$s kopiert um Datenverlust zu vermeiden, wenn eine einzelne Datei mit mehreren Accounts synchronisiert wird.\n\nInfolge dieser Änderung wurden alle Dateien, die mit vorherigen Versionen dieser App hochgeladen wurden, in den Ordner %2$s verschoben. Jedoch ist während der Account-Synchronisation ein Fehler aufgetreten, der das Abschließen dieses Vorgangs verhindert. Du kannst die Datei(en) entweder wie sie sind belassen und den Link zu %3$s entfernen oder die Datei(en) in den %1$s Ordner verschieben und  den Link zu %4$s beibehalten.\n\nUnten befindet sich eine Liste der lokalen Datei(en) und der mit ihnen verbundenen Remote-Datei(en) in %5$s.</string>
   <string name="sync_current_folder_was_removed">Das Verzeichnis %1$s existiert nicht mehr</string>
   <string name="foreign_files_move">Verschiebe alle</string>
   <string name="foreign_files_success">Alle Dateien wurden verschoben</string>
   <string name="auth_connecting_auth_server">Verbinde mit dem Authentifizierung-Server…</string>
   <string name="auth_unsupported_auth_method">Der Server unterstützt diese Authentifizierung-Methode nicht</string>
   <string name="auth_unsupported_multiaccount">%1$s unterstützt nicht mehrere Benutzerkonten</string>
+  <string name="auth_fail_get_user_name">Dein Server gibt keine korrekte Benutzer-ID zurück, bitte nimm Kontakt zu Deinem Administrator auf.</string>
   <string name="fd_keep_in_sync">Datei aktuell halten</string>
   <string name="common_rename">Umbenennen</string>
   <string name="common_remove">Löschen</string>
   <string name="wait_a_moment">Bitte warte einen Moment.</string>
   <string name="filedisplay_unexpected_bad_get_content">Ein unerwartetes Problem ist aufgetreten. Bitte versuche, die Datei in einer anderen App zu öffnen</string>
   <string name="filedisplay_no_file_selected">Es wurde keine Datei ausgewählt.</string>
+  <string name="activity_chooser_title">Link senden an ...</string>
   <string name="oauth_check_onoff">Anmelden mit oAuth2</string>
   <string name="oauth_login_connection">Verbinde mit dem oAuth2-Server.</string>
   <string name="ssl_validator_header">Die Identität der Website konnte nicht überprüft werden</string>
   <string name="failed_upload_retry_do_nothing_text">Nicht durchgeführt - Nicht online für sofortigen Upload</string>
   <string name="failed_upload_failure_text">Fehlermeldung:</string>
   <string name="failed_upload_quota_exceeded_text">Bitte überprüfe Deine Servereinstellungen. Eventuell ist Dein Nutzungslimit überschritten.</string>
+  <string name="share_link_no_support_share_api">Entschuldigung, Freigaben sind auf Deinem Server nicht aktiviert. Bitte kontaktiere Deinen Administrator.</string>
+  <string name="share_link_file_no_exist">Die Freigabe der Datei oder des Ordners ist nicht möglich. Bitte stelle sicher, dass diese existiert.</string>
+  <string name="share_link_file_error">Es ist ein Fehler beim Freigeben der Datei oder des Ordners aufgetreten.</string>
+  <string name="unshare_link_file_no_exist">Das Entfernen der Freigabe für die Datei oder den Ordner ist nicht möglich. Diese existieren nicht.</string>
+  <string name="unshare_link_file_error">Es ist ein Fehler beim Entfernen der Freigabe für diese Datei oder den Ordner aufgetreten.</string>
+  <string name="activity_chooser_send_file_title">Senden</string>
+  <string name="copy_link">Link kopieren</string>
+  <string name="clipboard_text_copied">In die Zwischenablage kopiert</string>
 </resources>
index 7f5fb58..99fc830 100644 (file)
@@ -10,6 +10,7 @@
   <string name="actionbar_mkdir">Δημιουργία καταλόγου</string>
   <string name="actionbar_settings">Ρυθμίσεις</string>
   <string name="actionbar_see_details">Λεπτομέρειες</string>
+  <string name="actionbar_send_file">Αποστολή</string>
   <string name="prefs_category_general">Γενικά</string>
   <string name="prefs_category_more">Περισσότερα</string>
   <string name="prefs_accounts">Λογαριασμοί</string>
@@ -55,6 +56,8 @@
   <string name="filedetails_download">Λήψη</string>
   <string name="filedetails_sync_file">Ανανέωση αρχείου</string>
   <string name="filedetails_renamed_in_upload_msg">Το αρχείο μετονομάστηκε σε %1$s κατά την μεταφόρτωση</string>
+  <string name="action_share_file">Διαμοιρασμός συνδέσμου</string>
+  <string name="action_unshare_file">Ακύρωση διαμοιρασμού συνδέσμου</string>
   <string name="common_yes">Ναι</string>
   <string name="common_no">Όχι</string>
   <string name="common_ok">ΟΚ</string>
@@ -94,7 +97,6 @@
   <string name="sync_fail_in_favourites_content">Τα περιεχόμενα των %1$d αρχείων δεν μπόρεσαν να συγχρονιστούν (%2$d διενέξεις)</string>
   <string name="sync_foreign_files_forgotten_ticker">Ορισμένα τοπικά αρχεία ξεχάστηκαν</string>
   <string name="sync_foreign_files_forgotten_content">%1$d αρχεια απο τον %2$s χωρο αποθηκευσης δεν μπορουν να αντιγραφθουν σε</string>
-  <string name="sync_foreign_files_forgotten_explanation">Από την έκδοση 1.3.16 και μετά, αρχεία που μεταφορτώνονται από αυτήν τη συσκευή αντιγράφονται στον τοπικό φάκελο %1$s για να αποτραπεί η απώλεια δεδομένων όταν ένα αρχείο είναι συγχρονισμένο με πολλαπλούς λογαριασμούς.\nΛόγω αυτής της αλλαγής, όλα τα αρχεία που μεταφορτώθηκαν με προηγούμενες εκδόσεις αυτής της εφαρμογής αντιγράφηκαν στο φάκελο %2$s. Ωστόσο, ένα σφάλμα εμπόδισε την ολοκλήρωση αυτής της επιχείρησης κατά το συγχρονισμό του λογαριασμού. Μπορείτε είτε να αφήσετε τα αρχεία όπως είναι και να καταργήσετε τη σύνδεση με%3$s ή να μετακινήσετε τα αρχεία στον κατάλογο %1$s και να διατηρήσετε τη σύνδεση με %4$s.\n\nΑπαριθμημένα πιο κάτω είναι το(α) τοπικό(ά) αρχείο(α) και το(α) απομακρυσμένο(α) αρχείο(α) στο %5$s με το(α) οποίο(α) συνδέονταν.</string>
   <string name="sync_current_folder_was_removed">Ο φάκελος %1$s δεν υπάρχει πια</string>
   <string name="foreign_files_move">Μετακινηση ολων</string>
   <string name="foreign_files_success">Ολα τα αρχεια μετακινηθηκαν</string>
   <string name="wait_a_moment">Παρακαλούμε περιμένετε</string>
   <string name="filedisplay_unexpected_bad_get_content">Απροσδόκητο σφάλμα, δοκιμάστε με άλλη εφαρμογή</string>
   <string name="filedisplay_no_file_selected">Δεν επιλέχθηκαν αρχεία </string>
+  <string name="activity_chooser_title">Αποστολή συνδέσμου σε ...</string>
   <string name="oauth_check_onoff">Σύνδεση με oAuth2</string>
   <string name="oauth_login_connection">Σύνδεση με το διακομιστή oAuth2 σε εξέλιξη...</string>
   <string name="ssl_validator_header">Η ταυτότητα της σελίδας δεν μπορεί να εγκριθεί</string>
   <string name="failed_upload_load_more_images">Φόρτωση περισσότερων εικόνων</string>
   <string name="failed_upload_failure_text">Μήνυμα Αποτυχίας:</string>
   <string name="failed_upload_quota_exceeded_text">Παρακαλώ ελέγξτε τις ρυθμίσεις του διακομιστή σας, ίσως έχετε υπερβεί τη διαθέσιμη μερίδα σας.</string>
+  <string name="share_link_no_support_share_api">Λυπάμαι, ο διαμοιρασμός δεν είναι ενεργοποιημένος στο διακομιστή σας. Παρακαλώ επικοινωνήστε με το διαχειριστή σας.</string>
+  <string name="share_link_file_no_exist">Αδυναμία διαμοιρασμού αυτού του αρχείου ή φακέλου. Παρακαλώ βεβαιωθείτε ότι υπάρχει</string>
+  <string name="share_link_file_error">Ένα σφάλμα προέκυψε κατά την προσπάθεια διαμοιρασμού αυτού του αρχείου ή φακέλου</string>
+  <string name="unshare_link_file_no_exist">Ήταν αδύνατη η ακύρωση διαμοιρασμού αυτού του αρχείου ή φακέλου. Δεν υπάρχει.</string>
+  <string name="unshare_link_file_error">Ένα σφάλμα προέκυψε κατά τη διάρκεια ακύρωσης διαμοιρασμού αυτού του αρχείου ή φακέλου</string>
+  <string name="activity_chooser_send_file_title">Αποστολή</string>
+  <string name="clipboard_text_copied">Αντιγραφθηκε στο clipboard</string>
 </resources>
index 0562dd7..720220d 100644 (file)
@@ -10,6 +10,7 @@
   <string name="actionbar_mkdir">Create directory</string>
   <string name="actionbar_settings">Settings</string>
   <string name="actionbar_see_details">Details</string>
+  <string name="actionbar_send_file">Send</string>
   <string name="prefs_category_general">General</string>
   <string name="prefs_category_more">More</string>
   <string name="prefs_accounts">Accounts</string>
@@ -55,6 +56,8 @@
   <string name="filedetails_download">Download</string>
   <string name="filedetails_sync_file">Refresh file</string>
   <string name="filedetails_renamed_in_upload_msg">File was renamed to %1$s during upload</string>
+  <string name="action_share_file">Share link</string>
+  <string name="action_unshare_file">Unshare link</string>
   <string name="common_yes">Yes</string>
   <string name="common_no">No</string>
   <string name="common_ok">OK</string>
@@ -94,7 +97,7 @@
   <string name="sync_fail_in_favourites_content">Contents of %1$d files could not be synced (%2$d conflicts)</string>
   <string name="sync_foreign_files_forgotten_ticker">Some local files were forgotten</string>
   <string name="sync_foreign_files_forgotten_content">%1$d files out of the %2$s directory could not be copied into</string>
-  <string name="sync_foreign_files_forgotten_explanation">As of version 1.3.16, files uploaded from this device are copied into the local %1$s folder to prevent data loss when a single file is synced with multiple accounts.\n\nDue to this change, all files uploaded in previous versions of this app were copied into the %2$s folder. However, an error prevented the completion of this operation during account synchronisation. You may either leave the file(s) as is and remove the link to %3$s, or move the file(s) into the %1$s directory and retain the link to %4$s.\n\nListed below are the local file(s), and the the remote file(s) in %5$s they were linked to.</string>
+  <string name="sync_foreign_files_forgotten_explanation">As of version 1.3.16, files uploaded from this device are copied into the local %1$s folder to prevent data loss when a single file is synced with multiple accounts.\n\nDue to this change, all files uploaded in previous versions of this app were copied into the %2$s folder. However, an error prevented the completion of this operation during account synchronisation. You may either leave the file(s) as is and remove the link to %3$s, or move the file(s) into the %1$s directory and retain the link to %4$s.\n\nListed below are the local file(s), and the remote file(s) in %5$s they were linked to.</string>
   <string name="sync_current_folder_was_removed">Folder %1$s does not exist anymore</string>
   <string name="foreign_files_move">Move all</string>
   <string name="foreign_files_success">All files were moved</string>
   <string name="auth_connecting_auth_server">Connecting to authentication server…</string>
   <string name="auth_unsupported_auth_method">The server does not support this authentication method</string>
   <string name="auth_unsupported_multiaccount">%1$s does not support multiple accounts</string>
+  <string name="auth_fail_get_user_name">Your server is not returning a correct user id, please contact an administrator</string>
   <string name="fd_keep_in_sync">Keep file up to date</string>
   <string name="common_rename">Rename</string>
   <string name="common_remove">Remove</string>
   <string name="wait_a_moment">Wait a moment</string>
   <string name="filedisplay_unexpected_bad_get_content">Unexpected problem; please select the file from a different app</string>
   <string name="filedisplay_no_file_selected">No file was selected</string>
+  <string name="activity_chooser_title">Send link to …</string>
   <string name="oauth_check_onoff">Log in with oAuth2</string>
   <string name="oauth_login_connection">Connecting to oAuth2 server…</string>
   <string name="ssl_validator_header">The identity of the site could not be verified</string>
   <string name="failed_upload_retry_do_nothing_text">do nothing you are not online for instant upload</string>
   <string name="failed_upload_failure_text">Failure Message: </string>
   <string name="failed_upload_quota_exceeded_text">Please check your server configuration, perhaps your quota is exceeded.</string>
+  <string name="share_link_no_support_share_api">Sorry, sharing is not enabled on your server. Please contact your administrator.</string>
+  <string name="share_link_file_no_exist">Unable to share this file or folder. Please, make sure it exists</string>
+  <string name="share_link_file_error">An error occurred while trying to share this file or folder</string>
+  <string name="unshare_link_file_no_exist">Unable to unshare this file or folder. It does not exist.</string>
+  <string name="unshare_link_file_error">An error occurred while trying to unshare this file or folder</string>
+  <string name="activity_chooser_send_file_title">Send</string>
+  <string name="copy_link">Copy link</string>
+  <string name="clipboard_text_copied">Copied to clipboard</string>
 </resources>
index c69e2c4..fbee22f 100644 (file)
@@ -6,6 +6,7 @@
   <string name="actionbar_mkdir">Krei dosierujon</string>
   <string name="actionbar_settings">Agordo</string>
   <string name="actionbar_see_details">Detaloj</string>
+  <string name="actionbar_send_file">Sendi</string>
   <string name="prefs_category_general">Ĝeneralo</string>
   <string name="prefs_category_more">Pli</string>
   <string name="prefs_accounts">Kontoj</string>
@@ -35,6 +36,7 @@
   <string name="filedetails_modified">Modifita je:</string>
   <string name="filedetails_download">Elŝuti</string>
   <string name="filedetails_renamed_in_upload_msg">La dosiero alinomiĝis al %1$s dum alŝuto</string>
+  <string name="action_share_file">Konhavigi ligilon</string>
   <string name="common_yes">Jes</string>
   <string name="common_no">Ne</string>
   <string name="common_ok">Akcepti</string>
   <string name="conflict_keep_both">Konservi ambaŭ</string>
   <string name="conflict_overwrite">Anstataŭigi</string>
   <string name="conflict_dont_upload">Ne alŝuti</string>
+  <string name="activity_chooser_send_file_title">Sendi</string>
+  <string name="clipboard_text_copied">Kopiita en la tondejon</string>
 </resources>
index 92e67e3..9e47f2b 100644 (file)
@@ -10,6 +10,7 @@
   <string name="actionbar_mkdir">Crear directorio</string>
   <string name="actionbar_settings">Configuración</string>
   <string name="actionbar_see_details">Detalles</string>
+  <string name="actionbar_send_file">Mandar</string>
   <string name="prefs_category_general">General</string>
   <string name="prefs_category_more">Más</string>
   <string name="prefs_accounts">Cuentas</string>
   <string name="prefs_log_summary_history">Esto muestra los registros grabados</string>
   <string name="prefs_log_delete_history_button">Eliminar Historial</string>
   <string name="prefs_help">Ayuda</string>
+  <string name="prefs_recommend">Recomendar a un amigo</string>
   <string name="prefs_feedback">Sugerencias</string>
   <string name="prefs_imprint">Imprint</string>
+  <string name="recommend_subject">¡Intento %1$s en tu teléfono inteligente!</string>
+  <string name="recommend_text">¡Quisiera invitarte a usar %1$s en tu smartphone!\nDescárgalo aquí: %2$s</string>
   <string name="auth_check_server">Verificar Servidor</string>
+  <string name="auth_host_url">Dirección del servidor https://...</string>
   <string name="auth_username">Nombre de usuario</string>
   <string name="auth_password">Contraseña</string>
   <string name="auth_register">¿Sos nuevo para %1$s?</string>
@@ -51,6 +56,7 @@
   <string name="filedetails_download">Descargar</string>
   <string name="filedetails_sync_file">Actualizar archivo</string>
   <string name="filedetails_renamed_in_upload_msg">El archivo fue renombrado como %1$s durante la subida</string>
+  <string name="action_share_file">Compartir vínculo</string>
   <string name="common_yes">Sí</string>
   <string name="common_no">No</string>
   <string name="common_ok">Aceptar</string>
@@ -90,7 +96,7 @@
   <string name="sync_fail_in_favourites_content">%1$d archivos no pudieron ser sincronizados (%2$d conflictos)</string>
   <string name="sync_foreign_files_forgotten_ticker">Algunos archivos locales fueron olvidados</string>
   <string name="sync_foreign_files_forgotten_content">%1$d archivos del directorio %2$s no pudieron ser copiados en</string>
-  <string name="sync_foreign_files_forgotten_explanation">Desde la versión 1.3.16, los archivos subidos desde este dispositivo se copian a un directorio local %1$s para prevenir la pérdida de datos cuando un único archivo es sincronizado con múltiples cuentas. \n\nDebido a este cambio, todos los archivos subidos en versiones previas de esta aplicación fueron copiados al directorio %2$s. No obstante, debido a un error, esta operación no pudo ser completada durante la sincronización de la cuenta. Podés dejar los archivos así y borrar el enlace a %3$s, o podés mover el/los archivos al directorio %1$s y conservar el enlace a %4$s. \n\nAbajo, encontrás la lista con los enlaces a los archivos locales y remotos en %5$s a los que están enlazados.</string>
+  <string name="sync_current_folder_was_removed">El directorio %1$s ya no existe</string>
   <string name="foreign_files_move">Mover todos</string>
   <string name="foreign_files_success">Todos los archivos fueron movidos</string>
   <string name="foreign_files_fail">Algunos archivos no pudieron ser movidos</string>
   <string name="media_err_unsupported">Codec no soportado</string>
   <string name="media_err_io">El archivo de medios no pudo ser leído </string>
   <string name="media_err_malformed">Archivo no está correctamente codificado</string>
+  <string name="media_err_timeout">Tiempo expirado mientras se intentaba reproducir</string>
   <string name="media_err_invalid_progressive_playback">Archivo de medios no puede ser transmitido</string>
   <string name="media_err_unknown">El archivo de medios no se puede reproducir con el reproductor de medios por defecto </string>
   <string name="media_err_security_ex">Error de seguridad al intentar reproducir %1$s</string>
   <string name="auth_connection_established">Conexión establecida</string>
   <string name="auth_testing_connection">Probando conexión...</string>
   <string name="auth_not_configured_title">Configuración de servidor en formato incorrecto</string>
+  <string name="auth_account_not_new">Una cuenta para el mismo usuario y servidor ya existe en el dispositivo</string>
+  <string name="auth_account_not_the_same">El usuario ingresado no concuerda con el usuario de esta cuenta</string>
   <string name="auth_unknown_error_title">¡Ocurrió un error desconocido!</string>
   <string name="auth_unknown_host_title">No fue posible encontrar la dirección</string>
   <string name="auth_incorrect_path_title">Instancia de servidor no encontrada</string>
   <string name="auth_timeout_title">El servidor tardó demasiado en responder</string>
   <string name="auth_incorrect_address_title">URL no válida</string>
   <string name="auth_ssl_general_error_title">Error al inicializar el SSL</string>
+  <string name="auth_ssl_unverified_server_title">No se ha podido verifica la identidad SSL del servidor</string>
   <string name="auth_bad_oc_version_title">No es posible reconocer la versión del servidor</string>
   <string name="auth_wrong_connection_title">No fue posible establecer la conexión</string>
   <string name="auth_secure_connection">Conexión segura establecida</string>
   <string name="auth_oauth_error">Autorización no satisfactoria</string>
   <string name="auth_oauth_error_access_denied">Acceso denegado por el servidor de autorización</string>
   <string name="auth_wtf_reenter_URL">Estado inesperado; por favor, introducí la URL del servidor de nuevo</string>
+  <string name="auth_expired_oauth_token_toast">Tu autorización ha expirado. Por favor, obtenga una nueva autorización</string>
   <string name="auth_expired_basic_auth_toast">Por favor, ingresá tu contraseña actual</string>
+  <string name="auth_expired_saml_sso_token_toast">Su sesión ha expirado. Por favor, conéctese de nuevo</string>
+  <string name="auth_connecting_auth_server">Conectando al servidor de autenticación...</string>
+  <string name="auth_unsupported_auth_method">El servidor no soporta este método de autenticación</string>
+  <string name="auth_unsupported_multiaccount">%1$s no soporta múltiples cuentas</string>
   <string name="fd_keep_in_sync">Mantener el archivo actualizado</string>
   <string name="common_rename">Renombrar</string>
   <string name="common_remove">Borrar</string>
   <string name="sync_file_fail_msg">No pudo comprobarse el archivo remoto</string>
   <string name="sync_file_nothing_to_do_msg">Ya está sincronizado</string>
   <string name="create_dir_fail_msg">No fue posible crear el directorio</string>
+  <string name="filename_forbidden_characters">Caracteres prohibidos: / \\ &lt; &gt; : \" | ? *</string>
   <string name="wait_a_moment">Esperá un momento</string>
   <string name="filedisplay_unexpected_bad_get_content">Problema inesperado; por favor, intentá con otra aplicación para abrir el archivo</string>
   <string name="filedisplay_no_file_selected">No se seleccionó ningún archivo</string>
+  <string name="oauth_check_onoff">Iniciando sesión con oAuth2</string>
   <string name="oauth_login_connection">Conectando al servidor oAuth2...</string>
   <string name="ssl_validator_header">La identidad del sitio no pudo ser verificada</string>
   <string name="ssl_validator_reason_cert_not_trusted">- El certificado del servidor no es confiable</string>
   <string name="preview_image_description">Previsualización de imagen</string>
   <string name="preview_image_error_unknown_format">No se puede mostrar la imagen</string>
   <string name="error__upload__local_file_not_copied">%1$s no pudo ser copiado al directorio local %2$s</string>
+  <string name="actionbar_failed_instant_upload">Falló InstantUpload</string>
   <string name="failed_upload_headline_text">Error en Cargas instantánea </string>
   <string name="failed_upload_headline_hint">Resumen de todas las cargas instantáneas con error</string>
   <string name="failed_upload_all_cb">Seleccionar todos</string>
   <string name="failed_upload_retry_do_nothing_text">No hacer nada, no estás conectado para subida instantánea</string>
   <string name="failed_upload_failure_text">Mensaje de error:</string>
   <string name="failed_upload_quota_exceeded_text">Por favor, revisá la configuración de servidor, posiblemente tu cuota se haya excedido.</string>
+  <string name="activity_chooser_send_file_title">Mandar</string>
+  <string name="clipboard_text_copied">Copiado al portapapeles</string>
 </resources>
index a328143..a6b3cbb 100644 (file)
   <string name="setup_btn_connect">Conectar</string>
   <string name="uploader_btn_upload_text">Subir</string>
   <string name="uploader_wrn_no_account_title">No se encuentra la cuenta</string>
+  <string name="uploader_info_uploading">Subiendo</string>
+  <string name="filedetails_select_file">Seleccione un archivo para desplegar información adicional.</string>
+  <string name="filedetails_size">Tamaño:</string>
+  <string name="filedetails_type">Tipo:</string>
+  <string name="filedetails_created">Creado:</string>
+  <string name="filedetails_modified">Modificado:</string>
+  <string name="filedetails_download">Descargar</string>
+  <string name="common_yes">Si</string>
+  <string name="common_no">No</string>
+  <string name="common_ok">OK</string>
+  <string name="common_cancel">Cancelar</string>
+  <string name="common_error">Error</string>
+  <string name="uploader_info_dirname">Nombre del directorio</string>
+  <string name="common_choose_account">Elija una cuenta</string>
+  <string name="pincode_enter_pin_code">Por favor, ingreses su PIN de aplicación</string>
+  <string name="pincode_configure_your_pin">Ingrese su PIN de aplicación</string>
+  <string name="pincode_reenter_your_pincode">Por favor, reingrese su PIN de aplicación</string>
 </resources>
index aaaf3fe..d2b6e89 100644 (file)
@@ -10,6 +10,7 @@
   <string name="actionbar_mkdir">Crear directorio</string>
   <string name="actionbar_settings">Ajustes</string>
   <string name="actionbar_see_details">Detalles</string>
+  <string name="actionbar_send_file">Enviar</string>
   <string name="prefs_category_general">General</string>
   <string name="prefs_category_more">Más</string>
   <string name="prefs_accounts">Cuentas</string>
@@ -55,6 +56,7 @@
   <string name="filedetails_download">Descargar</string>
   <string name="filedetails_sync_file">Actualizar archivo</string>
   <string name="filedetails_renamed_in_upload_msg">El archivo fue renombrado como %1$s durante la subida</string>
+  <string name="action_share_file">Enlace compartido</string>
   <string name="common_yes">Sí</string>
   <string name="common_no">No</string>
   <string name="common_ok">Aceptar</string>
@@ -94,7 +96,6 @@
   <string name="sync_fail_in_favourites_content">Los contenidos de %1$d archivos no fueron sincronizados (%2$d conflictos)</string>
   <string name="sync_foreign_files_forgotten_ticker">Algunos archivos locales se han perdido</string>
   <string name="sync_foreign_files_forgotten_content">%1$d archivos de %2$s no han podido ser copiados</string>
-  <string name="sync_foreign_files_forgotten_explanation">Como versión 1.3.16, los archivos subidos desde este dispositivo son copiados a un archivo %1$s local para prevenir perdida de datos cuando un simple archivo es sincronizado con multiples cuentas.\n\nDebido a este cambio, todos los archivos subidos en versiones previas de esta aplicación han sido copiados a la carpeta %2$s. No obtante, un error previno el completado de esta operación durante la sincronización de cuenta. Debería dejar el o los archivos así y eliminar el enlace a %3$s o mover el o los archivos al %1$s directorio y conservar el enlace a %4$s.\n\nListado abajo tiene los enlaces a los archivos locales y archivos remotos en %5$s </string>
   <string name="sync_current_folder_was_removed">La carpeta local %1$s no existe.</string>
   <string name="foreign_files_move">Mover todo</string>
   <string name="foreign_files_success">Todos los archivos fueron movidos</string>
   <string name="failed_upload_retry_do_nothing_text">No hacer nada no está conectado para subida instantánea</string>
   <string name="failed_upload_failure_text">Mensaje de error:</string>
   <string name="failed_upload_quota_exceeded_text">Por favor revise su configuración de servidor, posiblemente su cuota se haya excedido.</string>
+  <string name="activity_chooser_send_file_title">Enviar</string>
+  <string name="clipboard_text_copied">Copiado al portapapeles</string>
 </resources>
index b8e445e..d00400c 100644 (file)
@@ -10,6 +10,7 @@
   <string name="actionbar_mkdir">Crear directorio</string>
   <string name="actionbar_settings">Configuración</string>
   <string name="actionbar_see_details">Detalles</string>
+  <string name="actionbar_send_file">Enviar</string>
   <string name="prefs_category_general">General</string>
   <string name="prefs_category_more">Más</string>
   <string name="prefs_accounts">Cuentas</string>
@@ -55,6 +56,8 @@
   <string name="filedetails_download">Descargar</string>
   <string name="filedetails_sync_file">Actualizar archivo</string>
   <string name="filedetails_renamed_in_upload_msg">El fichero fue renombrado como %1$s durante la subida</string>
+  <string name="action_share_file">Enlace compartido</string>
+  <string name="action_unshare_file">Ya no compartir enlace</string>
   <string name="common_yes">Sí</string>
   <string name="common_no">No</string>
   <string name="common_ok">Aceptar</string>
@@ -69,7 +72,7 @@
   <string name="change_password">Cambiar contraseña</string>
   <string name="delete_account">Eliminar cuenta</string>
   <string name="create_account">Crear cuenta</string>
-  <string name="upload_chooser_title">Subir</string>
+  <string name="upload_chooser_title">Subir desde...</string>
   <string name="uploader_info_dirname">Nombre de directorio</string>
   <string name="uploader_upload_in_progress_ticker">Subiendo...</string>
   <string name="uploader_upload_in_progress_content">%1$d%% Subiendo %2$s</string>
@@ -94,7 +97,7 @@
   <string name="sync_fail_in_favourites_content">Los contenidos de %1$d ficheros no fueron sincronizados (%2$d conflictos)</string>
   <string name="sync_foreign_files_forgotten_ticker">Algunos archivos locales se han perdido</string>
   <string name="sync_foreign_files_forgotten_content">%1$d archivos de %2$s no han podido ser copiados</string>
-  <string name="sync_foreign_files_forgotten_explanation">Como versión 1.3.16, los archivos subidos desde este dispositivo son copiados a un archivo %1$s local para prevenir perdida de datos cuando un simple archivo es sincronizado con multiples cuentas.\n\nDebido a este cambio, todos los archivos subidos en versiones previas de esta aplicación han sido copiados a la carpeta %2$s. No obtante, un error previno el completado de esta operación durante la sincronización de cuenta. Debería dejar el o los archivos así y eliminar el enlace a %3$s o mover el o los archivos al %1$s directorio y conservar el enlace a %4$s.\n\nListado abajo tiene los enlaces a los archivos locales y archivos remotos en %5$s </string>
+  <string name="sync_foreign_files_forgotten_explanation">Como en la versión 1.3.16, los archivos subidos de este dispositivo son copiados a una carpeta local %1$s para evitar la perdida de datos cuando un unico archivo es sincronizado desde multiples cuentas\n\nDebido a este cambio, todos los archivos subidos en versiones previas de esta aplicación han sido copiados a la carpeta %2$s. No obtante, un error evito el completado de esta operación durante la sincronización de cuenta. Debería dejar el o los archivos así y eliminar el enlace a %3$s o mover el o los archivos al %1$s directorio y conservar el enlace a %4$s.\n\n Abajo tiene listado los enlaces a los archivos locales y archivos remotos en %5$s .</string>
   <string name="sync_current_folder_was_removed">La carpeta local %1$s no existe.</string>
   <string name="foreign_files_move">Mover todo</string>
   <string name="foreign_files_success">Todos los archivos fueron movidos</string>
   <string name="auth_connecting_auth_server">Conectando al servidor de autenticación...</string>
   <string name="auth_unsupported_auth_method">El servidor no soporta este método de autenticación</string>
   <string name="auth_unsupported_multiaccount">%1$s no soporta cuentas múltiples</string>
+  <string name="auth_fail_get_user_name">Su servidor no está retornando una identificación de usuario correcta. Contacte a su administrador.</string>
   <string name="fd_keep_in_sync">Mantener el archivo actualizado</string>
   <string name="common_rename">Renombrar</string>
   <string name="common_remove">Borrar</string>
   <string name="wait_a_moment">Espere un momento</string>
   <string name="filedisplay_unexpected_bad_get_content">Problema inesperado; por favor, prueba otra app para seleccionar el archivo</string>
   <string name="filedisplay_no_file_selected">No hay ficheros seleccionados.</string>
+  <string name="activity_chooser_title">Enviar enlace a...</string>
   <string name="oauth_check_onoff">Ingresar con oAuth2</string>
   <string name="oauth_login_connection">Conectando al servidor oAuth2...</string>
   <string name="ssl_validator_header">La identidad del sitio no puede ser verificada</string>
   <string name="instant_upload_path">/SubidasInstantáneas</string>
   <string name="conflict_title">Conflicto en la actualización</string>
   <string name="conflict_message">El archivo remoto %s no está sincronizado con el archivo local. Si continúa, se reemplazará el contenido del archivo en el servidor.</string>
-  <string name="conflict_keep_both">Mantener ambas</string>
+  <string name="conflict_keep_both">Mantener ambos</string>
   <string name="conflict_overwrite">Sobrescribir</string>
   <string name="conflict_dont_upload">No subir</string>
   <string name="preview_image_description">Previsualización de imagen</string>
   <string name="failed_upload_retry_do_nothing_text">No hacer nada no está conectado para subida instantánea</string>
   <string name="failed_upload_failure_text">Mensaje de error:</string>
   <string name="failed_upload_quota_exceeded_text">Por favor revise su configuración de servidor, posiblemente su cuota se haya excedido.</string>
+  <string name="share_link_no_support_share_api">Compartir archivos no está activado en su servidor. Sírvase contactar a su administrador de sistema.</string>
+  <string name="share_link_file_no_exist">No es posible compartir este archivo o carpeta. Asegúrese de que existe.</string>
+  <string name="share_link_file_error">Ocurrió un error al tratar de compartir este archivo o carpeta</string>
+  <string name="unshare_link_file_no_exist">No se puede dejar de compartir este archivo o carpeta. No existe.</string>
+  <string name="unshare_link_file_error">Ocurrió un error al tratar de ya no compartir este archivo o carpeta</string>
+  <string name="activity_chooser_send_file_title">Enviar</string>
+  <string name="copy_link">Copiar enlace</string>
+  <string name="clipboard_text_copied">Copiado al portapapeles</string>
 </resources>
index ea088b7..1387877 100644 (file)
@@ -10,6 +10,7 @@
   <string name="actionbar_mkdir">Loo kaust</string>
   <string name="actionbar_settings">Seaded</string>
   <string name="actionbar_see_details">Üksikasjad</string>
+  <string name="actionbar_send_file">Saada</string>
   <string name="prefs_category_general">Üldine</string>
   <string name="prefs_category_more">Rohkem</string>
   <string name="prefs_accounts">Kontod</string>
@@ -55,6 +56,8 @@
   <string name="filedetails_download">Lae alla</string>
   <string name="filedetails_sync_file">Värskenda faili</string>
   <string name="filedetails_renamed_in_upload_msg">Fail nimetati üleslaadimise käigus ümber %1$ </string>
+  <string name="action_share_file">Jaga linki</string>
+  <string name="action_unshare_file">Tühista lingi jagamine</string>
   <string name="common_yes">Jah</string>
   <string name="common_no">Ei</string>
   <string name="common_ok">OK</string>
@@ -94,7 +97,6 @@
   <string name="sync_fail_in_favourites_content">Faili %1$d sisu ei suudeta sünkroniseerida (konflikt %2$d)</string>
   <string name="sync_foreign_files_forgotten_ticker">Osad kohalikud faili ununesid</string>
   <string name="sync_foreign_files_forgotten_content">%1$d faili %2$s kataloogist ei suudeta kopeerida</string>
-  <string name="sync_foreign_files_forgotten_explanation">Alates versioonist 1.3.16 failid, mis on üles laetud kopeeritakse kohalikku kataloogi %1$s vältimaks andmete kadu, kui ühte faili sünkroniseeritakse mitmelt kontolt.\n\nSelle muudatusega seoses kõik failid, mis on üles laetud rakenduse vanemate versioonidega, kopeeriti kataloogi %2$s. Selle tegevuse peatas viga, mis tekkis konto sünkroniseerimise käigus. Sa saad jätta failid nagu nad on ning eemaldata viide %3$s või tõsta failid %1$s kataloogi ja säilitada viide %4$s.\n\nAllpool on loend kohalikest failidest ning serveris asuvatest failidest %5$s millele nad viitavad.</string>
   <string name="sync_current_folder_was_removed">Kausta %1$s pole enam olemas</string>
   <string name="foreign_files_move">Tõsta kõik ümber</string>
   <string name="foreign_files_success">Kõik failid tõsteti ümber</string>
   <string name="wait_a_moment">Oota hetk</string>
   <string name="filedisplay_unexpected_bad_get_content">Ootamatu tõrge ; palun kasuta faili valimiseks mõnda teist rakendust</string>
   <string name="filedisplay_no_file_selected">Ühtegi faili pole valitud</string>
+  <string name="activity_chooser_title">Saada link</string>
   <string name="oauth_check_onoff">Logi sisse oAuth2-ga</string>
   <string name="oauth_login_connection">oAuth2 serveriga ühendumine...</string>
   <string name="ssl_validator_header">Saidi identiteeti ei suudetud kinnitada</string>
   <string name="failed_upload_retry_do_nothing_text">ära tee midagi, sa pole võrku ühendatud koheseks üleslaadimiseks</string>
   <string name="failed_upload_failure_text">Veateade:</string>
   <string name="failed_upload_quota_exceeded_text">Palun kontrolli oma serveri seadeid, võib-olla on mahulimiit ületatud.</string>
+  <string name="share_link_file_no_exist">Antud faili või kausta ei saa jagada. Tee kindlaks, et see on olemas</string>
+  <string name="share_link_file_error">Faili või kausta jagamisel esines viga</string>
+  <string name="unshare_link_file_no_exist">Antud faili või kausta jagamist pole võimalik tühistada</string>
+  <string name="unshare_link_file_error">Faili või kausta jagamise tühistamisel esines viga</string>
+  <string name="activity_chooser_send_file_title">Saada</string>
+  <string name="clipboard_text_copied">Kopeeritud lõikepuhvrisse</string>
 </resources>
diff --git a/res/values-eu-rES/strings.xml b/res/values-eu-rES/strings.xml
new file mode 100644 (file)
index 0000000..64bd780
--- /dev/null
@@ -0,0 +1,5 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<resources>
+  <string name="filedetails_download">Deskargatu</string>
+  <string name="common_cancel">Ezeztatu</string>
+</resources>
index 2b87090..000b6d5 100644 (file)
@@ -10,6 +10,7 @@
   <string name="actionbar_mkdir">Sortu karpeta</string>
   <string name="actionbar_settings">Ezarpenak</string>
   <string name="actionbar_see_details">Xehetasunak</string>
+  <string name="actionbar_send_file">Bidali</string>
   <string name="prefs_category_general">Orokorra</string>
   <string name="prefs_category_more">Gehiago</string>
   <string name="prefs_accounts">Kontuak</string>
@@ -30,6 +31,7 @@
   <string name="recommend_subject">Probatu %1$s zure telefono adimentsuan!</string>
   <string name="recommend_text">Nik %1$s zure telefono adimentsuan erabitzera gonbidatu nahi zaitut!\nDeskargatu hemen: %2$s</string>
   <string name="auth_check_server">Egiaztatu zerbitzaria</string>
+  <string name="auth_host_url">Zerbitzariaren helbidea https://</string>
   <string name="auth_username">Erabiltzaile izena</string>
   <string name="auth_password">Pasahitza</string>
   <string name="auth_register">Berria %1$s-n?</string>
@@ -54,6 +56,8 @@
   <string name="filedetails_download">Deskargatu</string>
   <string name="filedetails_sync_file">Freskatu fitxaegia</string>
   <string name="filedetails_renamed_in_upload_msg">Fitxategiaren izena %1$sra aldatu da igotzean</string>
+  <string name="action_share_file">Elkarbanatu lotura</string>
+  <string name="action_unshare_file">Lotura partekatzeari utzi</string>
   <string name="common_yes">Bai</string>
   <string name="common_no">Ez</string>
   <string name="common_ok">Ados</string>
   <string name="wait_a_moment">Itxaron momentu bat</string>
   <string name="filedisplay_unexpected_bad_get_content">Ezusteko arazoa; mesedez, saiatu beste app batekin fitxategia hautatzeko</string>
   <string name="filedisplay_no_file_selected">Ez da fitxategirik hautatu</string>
+  <string name="activity_chooser_title">Bidali lotura honi...</string>
   <string name="oauth_check_onoff">Saioa hasi oAuth2-rekin</string>
   <string name="oauth_login_connection">Konektatzen oAuth2 zerbitzarira...</string>
   <string name="ssl_validator_header">Lekuaren identitatea ezin da egiaztatu</string>
   <string name="failed_upload_retry_do_nothing_text">ez egin ezer ez zaude on-line uneko igoerarentzat</string>
   <string name="failed_upload_failure_text">Hutsegite mezua:</string>
   <string name="failed_upload_quota_exceeded_text">Egiaztatu zure konfigurazioa, agian zure kuota muga gainditu  duzu.</string>
+  <string name="share_link_no_support_share_api">Sentitzen dut, partekatzea ez dago zure zerbitzarian gaituta. Mesedez jarri zure administradorearekin harremanetan.</string>
+  <string name="share_link_file_no_exist">Ezin izan da karpeta edo fitxategi hau partekatu. Mesedez, ziurtatu existitzen dela</string>
+  <string name="share_link_file_error">Errore bat egon da fitxategaia edo karpeta partekatzerakoan</string>
+  <string name="unshare_link_file_no_exist">Ezin izan da karpeta edo fitxategi honen partekatzeari utzi. Ez da existitzen.</string>
+  <string name="unshare_link_file_error">Errore bat egon da fitxategaia edo karpeta partekatzeari uzterakoan</string>
+  <string name="activity_chooser_send_file_title">Bidali</string>
+  <string name="copy_link">Lotura kopiatu</string>
+  <string name="clipboard_text_copied">Arbelera kopiatua</string>
 </resources>
index d37ecfe..c6d322a 100644 (file)
@@ -10,6 +10,7 @@
   <string name="actionbar_mkdir">ایجاد پوشه</string>
   <string name="actionbar_settings">تنظیمات</string>
   <string name="actionbar_see_details">جزئیات</string>
+  <string name="actionbar_send_file">ارسال</string>
   <string name="prefs_category_general">عمومی</string>
   <string name="prefs_category_more">بیش‌تر</string>
   <string name="prefs_accounts">حساب‌ها</string>
   <string name="prefs_log_summary_history">این وقایع  ثبت شده را نمایش می دهد.</string>
   <string name="prefs_log_delete_history_button">حذف تاریخچه</string>
   <string name="prefs_help">راه‌نما</string>
+  <string name="prefs_recommend">پیشنهاد دادن به یک دوست</string>
   <string name="prefs_feedback">باز خورد</string>
   <string name="prefs_imprint">مهر زدن</string>
+  <string name="recommend_subject">%1$s را بر روی گوشی هوشمند خود امتحان کنید.</string>
+  <string name="recommend_text">من می‌خواهم شما را به استفاده از %1$s بر روی گوشی هوشمند خود دعوت کنم\nآن را از اینجا دانلود کنید: %2$s</string>
+  <string name="auth_check_server">چک کردن سرور</string>
+  <string name="auth_host_url">آدرس سرور https://…</string>
   <string name="auth_username">نام کاربری</string>
   <string name="auth_password">رمز عبور</string>
+  <string name="auth_register">جدید نسبت به %1$s?</string>
   <string name="sync_string_files">پرونده‌ها</string>
   <string name="setup_btn_connect">اتصال</string>
   <string name="uploader_btn_upload_text">بارگزاری</string>
@@ -49,6 +56,8 @@
   <string name="filedetails_download">بارگیری</string>
   <string name="filedetails_sync_file">بازنمایی فایل</string>
   <string name="filedetails_renamed_in_upload_msg">فایل در هنگام بارگزاری به %1$s تغییر نام یافت</string>
+  <string name="action_share_file">اشتراک گذاشتن لینک</string>
+  <string name="action_unshare_file">لغو اشتراک گذاشتن لینک</string>
   <string name="common_yes">بله</string>
   <string name="common_no">نه</string>
   <string name="common_ok">باشه</string>
   <string name="common_choose_account">حساب کاربری را انتخاب کنید</string>
   <string name="sync_fail_ticker">همگام سازی ناموفق</string>
   <string name="sync_fail_content">همگام سازی %1$s نتوانست به طور کامل انجام شود</string>
+  <string name="sync_fail_content_unauthorized">رمز عبور نامعتبر برای %1$s</string>
   <string name="sync_conflicts_in_favourites_ticker">ناسازگاری ها یافت شدند</string>
   <string name="sync_conflicts_in_favourites_content">%1$d پرونده ها نمیتوانند همگام سازی شوند.</string>
   <string name="sync_fail_in_favourites_ticker">همگام سازی پرونده ها ناموفق بود.</string>
   <string name="sync_fail_in_favourites_content">محتوای %1$d فایل ها نمی توانند همگام باشند(%2$d ناسازگاری)</string>
   <string name="sync_foreign_files_forgotten_ticker">بعضی از فایلهای محلی فراموش شده اند</string>
   <string name="sync_foreign_files_forgotten_content">در اینجا %1$d تعداد فایل از لیست %2$s نمی توانند کپی شوند</string>
+  <string name="sync_current_folder_was_removed">پوشه %1$s دیگر وجود ندارد</string>
   <string name="foreign_files_move">انتقال همه</string>
   <string name="foreign_files_success">همه ی فایل ها جا به جا شدند</string>
   <string name="foreign_files_fail">بعضی از فایل ها نمی توانند انتقال یابند</string>
   <string name="media_err_unsupported">کدک رسانه پشتیبانی نشده است.</string>
   <string name="media_err_io">فایل رسانه نمیتواند خوانده شود.</string>
   <string name="media_err_malformed">فایل رسانه به شکل صحیح رمزگذاری نشده است.</string>
+  <string name="media_err_timeout">در حین تلاش برای پخش کردن، مهلت به پایان رسیده است</string>
   <string name="media_err_invalid_progressive_playback">فایل رسانه نمیتواند جریان داشته باشد.</string>
   <string name="media_err_unknown">فایل رسانه با استفاده از پخش کننده stock media player قابل پخش نیست.</string>
   <string name="media_err_security_ex">خطای امنیتی، تلاش برای پخش %1$s</string>
   <string name="media_rewind_description">دکمه عقبگرد</string>
   <string name="media_play_pause_description">دکمه پخش یا توقف</string>
   <string name="media_forward_description">دکمه رو به جلو سریع</string>
+  <string name="auth_trying_to_login">تلاش برای ورود...</string>
   <string name="auth_no_net_conn_title">هیچ ارتباطی به شبکه موجود نیست</string>
   <string name="auth_nossl_plain_ok_title">اتصال امن در دسترس نیست</string>
   <string name="auth_connection_established">اتصال برقرار شد</string>
   <string name="auth_testing_connection">آزمایش اتصال...</string>
   <string name="auth_not_configured_title">پیکربندی سرور ناقص است</string>
+  <string name="auth_account_not_new">یک اکانت با همین نام کاربری و سرور بر روی این دستگاه موجود می‌باشد.</string>
+  <string name="auth_account_not_the_same">نام کاربری وارد شده با نام کاربری این اکانت مطابقت ندارد</string>
   <string name="auth_unknown_error_title">خطای نامشخص رخ داده است!</string>
   <string name="auth_unknown_host_title">میزبان را نمیتواند پیدا نماید.</string>
   <string name="auth_incorrect_path_title">نمونه ی سرور یافت نشد</string>
   <string name="auth_timeout_title">زمان زیادی برای پاسخ سرور صورت گرفت.</string>
   <string name="auth_incorrect_address_title">آدرس ناقص</string>
   <string name="auth_ssl_general_error_title">مقداردهی SSL ناموفق بود.</string>
+  <string name="auth_ssl_unverified_server_title">نمی‌توان اصالت SSL سرور را احراز نمود</string>
   <string name="auth_bad_oc_version_title">نسخه ی سرور ناشناخته</string>
   <string name="auth_wrong_connection_title">نمیتوان ارتباط برقرار نمود.</string>
   <string name="auth_secure_connection">ایجاد ارتباط ایمن</string>
+  <string name="auth_unauthorized">نام کاربری یا رمز ورود اشتباه است</string>
   <string name="auth_oauth_error">اجازه ناموفق</string>
   <string name="auth_oauth_error_access_denied">دسترسی توسط سرور احراز هویت رد شده است.</string>
   <string name="auth_wtf_reenter_URL">حالت غیرمنتظره؛ لطفا آدرس URL سرور را مجددا وارد نمایید.</string>
+  <string name="auth_expired_oauth_token_toast">احراز هویت شما منقضی شده است. لطفا، مجددا احراز هویت فرمایید.</string>
+  <string name="auth_expired_basic_auth_toast">لطفاً رمز کاربری فعلی را وارد نمایید</string>
+  <string name="auth_connecting_auth_server">اتصال به سرور احراز هویت...</string>
+  <string name="auth_unsupported_auth_method">سرور این نوع احراز هویت را پشتیبانی نمی‌کند</string>
+  <string name="auth_unsupported_multiaccount">%1$s چند اکانته بودن را پشتیبانی نمی‌کند</string>
   <string name="fd_keep_in_sync">فایل را به روز نگه دار</string>
   <string name="common_rename">تغییرنام</string>
   <string name="common_remove">حذف</string>
   <string name="sync_file_fail_msg">پرونده های دور از دسترس نمی توانند بررسی شوند.</string>
   <string name="sync_file_nothing_to_do_msg">محتوای فایل قبلا همگام شده</string>
   <string name="create_dir_fail_msg">فهرست را نمی توان ایجاد کرد</string>
+  <string name="filename_forbidden_characters">کاراکترهای ممنوع: / \\ &lt; &gt; : \" | ? *</string>
   <string name="wait_a_moment">لحظه‌ای صبر کنید</string>
   <string name="filedisplay_unexpected_bad_get_content">مشکل غیر متقربه، لطفا پرونده را از یک برنامه متفاوت انتخاب کنید.</string>
   <string name="filedisplay_no_file_selected">هیچ پرونده‌ای انتخاب نشده است</string>
+  <string name="activity_chooser_title">ارسال لینک به ...</string>
+  <string name="oauth_check_onoff">ورود با oAuth2   </string>
   <string name="oauth_login_connection">اتصال به سرور oAuth2 ...</string>
   <string name="ssl_validator_header">هویت این سایت نمی تواند تایید شود</string>
   <string name="ssl_validator_reason_cert_not_trusted">- گواهی سرور نامعتبر است</string>
   <string name="preview_image_description">پیش نمایش تصویر</string>
   <string name="preview_image_error_unknown_format">این تصویر نمی تواند نمایش داده شود.</string>
   <string name="error__upload__local_file_not_copied">%1$s در لیست محلی %2$s نمی تواند کپی شود</string>
+  <string name="actionbar_failed_instant_upload">آپلود فوری انجام نشد</string>
   <string name="failed_upload_headline_text">آپلود های فوری انجام نشدند.</string>
   <string name="failed_upload_headline_hint">خلاصه ای از تمام ارسال های فور ی ناموفق.</string>
   <string name="failed_upload_all_cb">انتخاب همه</string>
   <string name="failed_upload_retry_do_nothing_text">هیچ کاری انجام ندهید، شما برای آپلود فوری آنلاین نیستید.</string>
   <string name="failed_upload_failure_text">پیغام عدم موفقیت:</string>
   <string name="failed_upload_quota_exceeded_text">لطفا پیکربندی سرورتان را بررسی کنید، شاید سهمیه شما بیش از حد شده باشد.</string>
+  <string name="share_link_no_support_share_api">متاسفیم، اشتراک گذاری بر روی سرور شما فعال نمی‌باشد. لطفاً با مدیر فنی خود تماس بگیرید.</string>
+  <string name="share_link_file_no_exist">به اشتراک گذاری این فایل یا پوشه ممکن نیست. لطفاً از وجود آن اطمینان حاصل نمایید</string>
+  <string name="share_link_file_error">در حین اشتراک گذاری این فایل یا پوشه خطایی رخ داده است</string>
+  <string name="unshare_link_file_no_exist">حذف اشتراک گذاری این فایل یا پوشه ممکن نیست. لطفاً از وجود آن اطمینان حاصل نمایید</string>
+  <string name="unshare_link_file_error">در حین حذف اشتراک گذاری این فایل یا پوشه خطایی رخ داده است</string>
+  <string name="activity_chooser_send_file_title">ارسال</string>
+  <string name="clipboard_text_copied">کپی به کلیپ بورد</string>
 </resources>
index a29c7ce..29076c5 100644 (file)
@@ -10,6 +10,7 @@
   <string name="actionbar_mkdir">Luo kansio</string>
   <string name="actionbar_settings">Asetukset</string>
   <string name="actionbar_see_details">Tiedot</string>
+  <string name="actionbar_send_file">Lähetä</string>
   <string name="prefs_category_general">Yleiset</string>
   <string name="prefs_category_more">Enemmän</string>
   <string name="prefs_accounts">Tilit</string>
@@ -52,6 +53,7 @@
   <string name="filedetails_download">Lataa</string>
   <string name="filedetails_sync_file">Päivitä tiedosto</string>
   <string name="filedetails_renamed_in_upload_msg">Tiedoston nimeksi muutettiin %1$s siirron yhteydessä</string>
+  <string name="action_share_file">Jaa linkki</string>
   <string name="common_yes">Kyllä</string>
   <string name="common_no">Ei</string>
   <string name="common_ok">OK</string>
   <string name="media_state_playing">%1$s (toistetaan)</string>
   <string name="media_state_loading">%1$s (ladataan)</string>
   <string name="media_err_nothing_to_play">Mediatiedostoa ei löytynyt</string>
+  <string name="media_err_no_account">Tiliä ei määritetty</string>
+  <string name="media_err_not_in_owncloud">Tiedosto ei ole kelvollisella tilillä</string>
   <string name="media_err_io">Mediatiedoston luku ei onnistunut</string>
   <string name="media_rewind_description">Taaksepäin kelaus -painike</string>
   <string name="media_play_pause_description">Toisto tai keskeytys -painike</string>
   <string name="wait_a_moment">Odota hetki</string>
   <string name="filedisplay_unexpected_bad_get_content">Odottamaton ongelma; kokeile valita tiedosto toisella sovelluksella</string>
   <string name="filedisplay_no_file_selected">Tiedostoa ei valittu</string>
+  <string name="activity_chooser_title">Lähetä linkki…</string>
   <string name="oauth_check_onoff">Kirjaudu oAuth2:lla</string>
   <string name="oauth_login_connection">Yhdistetään oAuth2-palvelimeen…</string>
   <string name="ssl_validator_header">Sivuston identiteetin vahvistaminen ei onnistunut</string>
   <string name="conflict_keep_both">Säilytä molemmat</string>
   <string name="conflict_overwrite">Korvaa</string>
   <string name="conflict_dont_upload">Älä lähetä</string>
+  <string name="preview_image_description">Kuvan esikatselu</string>
   <string name="preview_image_error_unknown_format">Kuvaa ei voi näyttää</string>
   <string name="failed_upload_all_cb">valitse kaikki</string>
   <string name="failed_upload_headline_retryall_btn">yritä uudelleen kaikkia valittuja</string>
   <string name="failed_upload_load_more_images">Lataa lisää kuvia</string>
   <string name="failed_upload_failure_text">Virheviesti:</string>
+  <string name="share_link_no_support_share_api">Valitettavasti jakamista ei ole otettu käyttöön palvelinasetuksissa. Ota yhteys ylläpitäjään.</string>
+  <string name="share_link_file_no_exist">Valitettavasti tämän tiedoston tai kansion jakaminen ei onnistu. Varmista että se on olemassa</string>
+  <string name="share_link_file_error">Virhe tiedoston tai kansion jakamista yrittäessä</string>
+  <string name="activity_chooser_send_file_title">Lähetä</string>
+  <string name="copy_link">Kopioi linkki</string>
+  <string name="clipboard_text_copied">Kopioitu leikepöydälle</string>
 </resources>
index 6c19d05..d633877 100644 (file)
@@ -3,13 +3,14 @@
   <string name="about_android">%1$s Android App</string>
   <string name="about_version">version %1$s</string>
   <string name="actionbar_sync">Actualiser le compte</string>
-  <string name="actionbar_upload">Charger</string>
+  <string name="actionbar_upload">Téléverser</string>
   <string name="actionbar_upload_from_apps">Contenu d\'une autre application</string>
   <string name="actionbar_upload_files">Fichiers</string>
   <string name="actionbar_open_with">Ouvrir avec</string>
   <string name="actionbar_mkdir">Créer un répertoire</string>
   <string name="actionbar_settings">Paramètres</string>
   <string name="actionbar_see_details">Détails</string>
+  <string name="actionbar_send_file">Envoyer</string>
   <string name="prefs_category_general">Général</string>
   <string name="prefs_category_more">Plus</string>
   <string name="prefs_accounts">Comptes</string>
@@ -55,6 +56,8 @@
   <string name="filedetails_download">Télécharger</string>
   <string name="filedetails_sync_file">Actualiser le fichier</string>
   <string name="filedetails_renamed_in_upload_msg">Le fichier a été renommé en %s pendant le téléversement</string>
+  <string name="action_share_file">Partager le lien</string>
+  <string name="action_unshare_file">Ne plus partager ce lien</string>
   <string name="common_yes">Oui</string>
   <string name="common_no">Non</string>
   <string name="common_ok">OK</string>
@@ -94,7 +97,7 @@
   <string name="sync_fail_in_favourites_content">Le contenu de %1$d fichiers n\'a put être synchronisé (%2$d conflits)</string>
   <string name="sync_foreign_files_forgotten_ticker">Certains fichiers locaux ont été oubliés</string>
   <string name="sync_foreign_files_forgotten_content">%1$d fichiers du dossier %2$s n\'ont pas pu être copiés dans</string>
-  <string name="sync_foreign_files_forgotten_explanation">Depuis la version 1.3.16, les fichiers téléversés depuis cet équipement sont copiés dans le dossier local %1$s pour éviter toute perte de données lorsqu\'un fichier est synchronisé avec plusieurs comptes.\n\nEn raison de ce changement, tous les fichiers téléversés avec une version antérieure de cette application étaient copiés dans le dossier %2$s. Cependant, une erreur empêchait l\'achèvement de cette opération pendant la synchronisation. Vous pouvez soit laisser les fichiers tels quels et supprimer le lien à %3$s, soit déplacer les fichiers dans le dossier %1$s et garder le lien vers %4$s.\n\nCi-dessous la liste des fichiers locaux, et les fichiers distants de %5$s auxquels ils étaient liés.</string>
+  <string name="sync_foreign_files_forgotten_explanation">Depuis la version 1.3.16, les fichiers envoyé depuis ce périphérique sont copiés dans le dossier local %1$s pour éviter une perte de données lorsqu\'un même fichier est synchronisé avec plusieurs comptes.\n\nEn raison de cette modification, tous les fichiers envoyés avec des versions antérieures de cette application ont été copiés dans le dossier %2$s. Cependant une erreur a empêché l\'achèvement de cette opération pendant la synchronisation du compte. Vous pouvez soit laisser les fichiers tels quels et supprimer le lien vers %3$s, soit déplacer les fichiers dans le dossier %1$s et garder le lien vers %4$s.\n\nCi-dessous la liste des fichiers locaux, et les fichiers distants dans %5$s auxquels ils sont liés.</string>
   <string name="sync_current_folder_was_removed">Le dossier %1$s n\'existe plus</string>
   <string name="foreign_files_move">Tout déplacer</string>
   <string name="foreign_files_success">Tous les fichiers ont été déplacés</string>
   <string name="wait_a_moment">Veuillez patienter</string>
   <string name="filedisplay_unexpected_bad_get_content">Problème inattendu ; veuillez essayer une autre app pour la sélection du fichier</string>
   <string name="filedisplay_no_file_selected">Aucun fichier sélectionné</string>
+  <string name="activity_chooser_title">Envoyer un lien à…</string>
   <string name="oauth_check_onoff">Connexion avec aAuth2.</string>
   <string name="oauth_login_connection">Connexion au serveur aAuth2...</string>
   <string name="ssl_validator_header">L\'identité du site ne peut être vérifiée</string>
   <string name="failed_upload_retry_do_nothing_text">Ne rien faire vous n\'êtes pas connecté pour le téléchargement instantané</string>
   <string name="failed_upload_failure_text">Message d\'échec:</string>
   <string name="failed_upload_quota_exceeded_text">Veuillez vérifier la configuration de votre serveur, peut-être que votre quota est dépassé.</string>
+  <string name="share_link_no_support_share_api">Désolé, la fonctionnalité de partage n’est pas activée sur ce serveur. Veuillez contacter votre administrateur.</string>
+  <string name="share_link_file_no_exist">Impossible de partager ce fichier ou répertoire. Vérifiez qu’il est bien présent</string>
+  <string name="share_link_file_error">Une erreur est survenue lors de la tentative de partage de ce fichier ou répertoire</string>
+  <string name="unshare_link_file_no_exist">Impossible d’annuler le partage de ce fichier ou répertoire : il n’existe pas.</string>
+  <string name="unshare_link_file_error">Une erreur est survenue lors de la tentative d’annulation du partage de ce fichier ou répertoire</string>
+  <string name="activity_chooser_send_file_title">Envoyer</string>
+  <string name="copy_link">Copier le lien</string>
+  <string name="clipboard_text_copied">Copié dans le presse-papiers</string>
 </resources>
index e656654..7d1e2a0 100644 (file)
@@ -10,6 +10,7 @@
   <string name="actionbar_mkdir">Crear un directorio</string>
   <string name="actionbar_settings">Preferencias</string>
   <string name="actionbar_see_details">Detalles</string>
+  <string name="actionbar_send_file">Enviar</string>
   <string name="prefs_category_general">Xeral</string>
   <string name="prefs_category_more">Máis</string>
   <string name="prefs_accounts">Contas</string>
@@ -55,6 +56,8 @@
   <string name="filedetails_download">Descargar</string>
   <string name="filedetails_sync_file">Actualizar o ficheiro</string>
   <string name="filedetails_renamed_in_upload_msg">O ficheiro foi renomeado a %1$s durante o envío</string>
+  <string name="action_share_file">Ligazón para compartir</string>
+  <string name="action_unshare_file">Deixar de compartir a ligazón</string>
   <string name="common_yes">Si</string>
   <string name="common_no">Non</string>
   <string name="common_ok">Aceptar</string>
@@ -94,7 +97,7 @@
   <string name="sync_fail_in_favourites_content">Non foi posíbel sincronizar o contido de %1$d ficheiros (%2$d conflitos)</string>
   <string name="sync_foreign_files_forgotten_ticker">Algúns ficheiros locais foron esquecidos</string>
   <string name="sync_foreign_files_forgotten_content">Non é posíbel copiar %1$d ficheiros do directorio %2$s en</string>
-  <string name="sync_foreign_files_forgotten_explanation">Desde a versión 1.3.16, os ficheiros enviados desde este dispositivo cópianse no cartafol local %1$s para evitar a perda de datos cando se sincroniza un ficheiro con varias contas.\n\nPor mor deste cambio, todos os ficheiros enviados nas versións anteriores deste aplicativo cópianse no cartafol %2$s. Porén, un erro impediu a finalización desta operación durante a sincronización da conta. É posíbel deixar o(s) ficheiro(s) como está(n) e retirar a ligazón a %3$s, ou mover o(s) ficheiro(s) ao directorio %1$s e manter a ligazón a %4$s.\n\nA seguir enuméranse o(s) fichero(s) local(is), e o(s) fichero(s) remoto(s) en %5$s co(s) que estaba(n) ligados.</string>
+  <string name="sync_foreign_files_forgotten_explanation">Desde a versión 1.3.16, os ficheiros enviados desde este dispositivo cópianse no cartafol local %1$s para evitar a perda de datos cando se sincroniza un ficheiro con varias contas.\n\nPor mor deste cambio, todos os ficheiros enviados coas versións anteriores deste aplicativo cópianse no cartafol %2$s. Porén, un erro impediu a finalización desta operación durante a sincronización da conta. É posíbel deixar o(s) ficheiro(s) como está(n) e retirar a ligazón a %3$s, ou mover o(s) ficheiro(s) ao directorio %1$s e manter a ligazón a %4$s.\n\nA seguir enuméranse o(s) ficheiro(s) local(is), e o(s) ficheiro(s) remoto(s) en %5$s co(s) que estaba(n) ligados.</string>
   <string name="sync_current_folder_was_removed">O cartafol %1$s xa non existe</string>
   <string name="foreign_files_move">Mover todo</string>
   <string name="foreign_files_success">Foron movidos todos os ficheiros</string>
   <string name="wait_a_moment">Agarde un chisco</string>
   <string name="filedisplay_unexpected_bad_get_content">Produciuse un erro non agardado. Seleccione o ficheiro con outro aplicativo diferente</string>
   <string name="filedisplay_no_file_selected">Non se escolleu ningún ficheiro</string>
+  <string name="activity_chooser_title">Enviar a ligazón a ...</string>
   <string name="oauth_check_onoff">Acceder con oAuth2</string>
   <string name="oauth_login_connection">Conectando co servidor oAuth2…</string>
   <string name="ssl_validator_header">Non foi posíbel verificar a identidade do sitio</string>
   <string name="failed_upload_retry_do_nothing_text">non facer nada que non estea en liña para o envío instantáneo</string>
   <string name="failed_upload_failure_text">Mensaxe de fallo:</string>
   <string name="failed_upload_quota_exceeded_text">Comprobe a configuración do seu servidor. é probábel que xa excedera a cota.</string>
+  <string name="share_link_no_support_share_api">O seu servidor non ten activada a opción de compartir. Póñase en contacto co administrador.</string>
+  <string name="share_link_file_no_exist">Non foi posíbel compartir este ficheiro ou cartafol. Asegurese de que existe.</string>
+  <string name="share_link_file_error">Produciuse un erro ao tentar compartir este ficheiro ou cartafol.</string>
+  <string name="unshare_link_file_no_exist">Non foi posíbel compartir este ficheiro ou cartafol xa que non existe.</string>
+  <string name="unshare_link_file_error">Produciuse un erro ao tentar deixar de compartir este ficheiro ou cartafol</string>
+  <string name="activity_chooser_send_file_title">Enviar</string>
+  <string name="copy_link">Copiar a ligazón</string>
+  <string name="clipboard_text_copied">Copiado no portapapeis.</string>
 </resources>
index 36de5a7..f24106e 100644 (file)
@@ -6,6 +6,7 @@
   <string name="actionbar_mkdir">יצירת תיקייה</string>
   <string name="actionbar_settings">הגדרות</string>
   <string name="actionbar_see_details">פרטים</string>
+  <string name="actionbar_send_file">שליחה</string>
   <string name="prefs_category_general">כללי</string>
   <string name="prefs_category_more">יותר</string>
   <string name="prefs_accounts">חשבונות</string>
   <string name="failed_upload_load_more_images">טעינת תמונות נוספות</string>
   <string name="failed_upload_failure_text">הודעת התקלה:</string>
   <string name="failed_upload_quota_exceeded_text">נא לבדוק את תצורת שרת שלך, יתכן שחרגת מהמיכסה שלך.</string>
+  <string name="activity_chooser_send_file_title">שליחה</string>
 </resources>
index da6fb71..d559775 100644 (file)
@@ -2,10 +2,12 @@
 <resources>
   <string name="actionbar_upload">अपलोड </string>
   <string name="actionbar_settings">सेटिंग्स</string>
+  <string name="actionbar_send_file">भेजें</string>
   <string name="prefs_category_general">सामान्य </string>
   <string name="prefs_help">सहयोग</string>
   <string name="auth_username">प्रयोक्ता का नाम</string>
   <string name="auth_password">पासवर्ड</string>
   <string name="uploader_btn_upload_text">अपलोड </string>
   <string name="common_error">त्रुटि</string>
+  <string name="activity_chooser_send_file_title">भेजें</string>
 </resources>
index 24b3fd4..1697312 100644 (file)
@@ -10,6 +10,7 @@
   <string name="actionbar_mkdir">Mappa létrehozása</string>
   <string name="actionbar_settings">Beállítások</string>
   <string name="actionbar_see_details">Részletek</string>
+  <string name="actionbar_send_file">Küldjük el</string>
   <string name="prefs_category_general">Általános</string>
   <string name="prefs_category_more">Több</string>
   <string name="prefs_accounts">Fiókok</string>
@@ -55,6 +56,8 @@
   <string name="filedetails_download">Letöltés</string>
   <string name="filedetails_sync_file">File frissítése</string>
   <string name="filedetails_renamed_in_upload_msg">A feltöltés során az állmányt erre neveztük át: %1$s</string>
+  <string name="action_share_file">Megosztás hivatkozással</string>
+  <string name="action_unshare_file">Megosztás visszavonása</string>
   <string name="common_yes">Igen</string>
   <string name="common_no">Nem</string>
   <string name="common_ok">OK</string>
@@ -94,7 +97,6 @@
   <string name="sync_fail_in_favourites_content">%1$d fájl szinkronizálása nem sikerült (%2$d ütközés)</string>
   <string name="sync_foreign_files_forgotten_ticker">Néhány helyi fájlt figyelmen kívül hagytunk</string>
   <string name="sync_foreign_files_forgotten_content">%1$d fájlt nem sikerült a %2$s mappából  bemásolni</string>
-  <string name="sync_foreign_files_forgotten_explanation">Az 1.3.16 verzió használatakor azok az állományok, amiket erről az eszközről töltenek fel, a helyi %1$s mappába másolódnak be, hogy elkerülhető legyen az adatveszteség, amikor ugyanazt az állományt több résztvevő is szinkronizál.\n\nEmiatt a változás miatt, az e program korábbi változataival feltöltött állományok a %2$s mappába másolódtak. Sajnos azonban egy a szinkronizáció közben fellépő hiba miatt ez a feladat csak részben valósult meg. Két lehetősége van: vagy úgy dönt, hogy maradjanak a fájl(ok) ahol vannak és akkor törölje a %3$s-re mutató linket, vagy pedig helyezze át az állomány(oka)t a %1$s mappába, és tartsa meg a %4$s-re mutató linket.\n\nAz alábbiakban látható a helyi fájl(ok) listája és a távoli fájl(ok) a %5$s mappában, amihez linkelve voltak.</string>
   <string name="sync_current_folder_was_removed">A %1$s mappa már nem létezik</string>
   <string name="foreign_files_move">Helyezzük át mindet</string>
   <string name="foreign_files_success">Az összes fájlt áthelyeztük</string>
   <string name="wait_a_moment">Egy pillanat...</string>
   <string name="filedisplay_unexpected_bad_get_content">Váratlan hiba; válassza ki a fájlt más programból</string>
   <string name="filedisplay_no_file_selected">Egy fájl sincs kiválasztva</string>
+  <string name="activity_chooser_title">Hivatkozás küldése ...</string>
   <string name="oauth_check_onoff">Bejelentkezés oAuth2-vel</string>
   <string name="oauth_login_connection">Kapcsolódás az oAuth2 szerverhez...</string>
   <string name="ssl_validator_header">A kiszolgálót nem sikerült azonosítani</string>
   <string name="failed_upload_retry_do_nothing_text">nem vagyunk online üzemmódban az azonnali feltöltéshez</string>
   <string name="failed_upload_failure_text">Hibaüzenet</string>
   <string name="failed_upload_quota_exceeded_text">Kérjük ellenőrizd a szerver konfigurációt, mert lehet, hogy a kvótát túllépted.</string>
+  <string name="share_link_no_support_share_api">Bocsánat, a megosztás nincs engedélyezve. A rendszergazda segíthet ezt tisztázni.</string>
+  <string name="share_link_file_no_exist">A mappa nem osztható meg. Lehet, hogy nem is létezik.</string>
+  <string name="share_link_file_error">Hiba lépett fel a mappa megosztásakor</string>
+  <string name="unshare_link_file_no_exist">Nem lehet a megosztást megszüntetni. A mappa vagy fájl nem létezik.</string>
+  <string name="unshare_link_file_error">Hiba lépett fel a mappa megosztásának visszavonásakor</string>
+  <string name="activity_chooser_send_file_title">Küldjük el</string>
+  <string name="clipboard_text_copied">Bemásolva a vágólapra</string>
 </resources>
index ecfaa30..80deb00 100644 (file)
@@ -3,6 +3,7 @@
   <string name="actionbar_upload">Incargar</string>
   <string name="actionbar_upload_files">Files</string>
   <string name="actionbar_settings">Configurationes</string>
+  <string name="actionbar_send_file">Invia</string>
   <string name="prefs_category_general">General</string>
   <string name="prefs_category_more">Plus</string>
   <string name="prefs_help">Adjuta</string>
@@ -16,4 +17,5 @@
   <string name="common_error">Error</string>
   <string name="common_error_unknown">Error Incognite</string>
   <string name="change_password">Cambiar contrasigno</string>
+  <string name="activity_chooser_send_file_title">Invia</string>
 </resources>
index bd151ad..73287d8 100644 (file)
@@ -10,6 +10,7 @@
   <string name="actionbar_mkdir">Buat folder</string>
   <string name="actionbar_settings">pengaturan</string>
   <string name="actionbar_see_details">Rincian</string>
+  <string name="actionbar_send_file">Kirim</string>
   <string name="prefs_category_general">umum</string>
   <string name="prefs_category_more">Lainnya</string>
   <string name="prefs_accounts">Akun</string>
@@ -55,6 +56,7 @@
   <string name="filedetails_download">Unduh</string>
   <string name="filedetails_sync_file">Segarkan berkas</string>
   <string name="filedetails_renamed_in_upload_msg">Berkas diubah namanya menjadi %1$s saat pengunggahan</string>
+  <string name="action_share_file">Bagikan tautan</string>
   <string name="common_yes">Ya</string>
   <string name="common_no">Tidak</string>
   <string name="common_ok">Oke</string>
   <string name="failed_upload_retry_do_nothing_text">Tidak melakukan apapun, Anda tidak sedang online</string>
   <string name="failed_upload_failure_text">Pesan Kegagalan:</string>
   <string name="failed_upload_quota_exceeded_text">Silakan periksa konfigurasi server Anda, kemungkinan kuota terlampaui.</string>
+  <string name="activity_chooser_send_file_title">Kirim</string>
 </resources>
index e7d228b..8e67458 100644 (file)
@@ -3,6 +3,7 @@
   <string name="actionbar_upload">Senda inn</string>
   <string name="actionbar_upload_files">Skrár</string>
   <string name="actionbar_settings">Stillingar</string>
+  <string name="actionbar_send_file">Senda</string>
   <string name="prefs_category_more">Meira</string>
   <string name="prefs_help">Hjálp</string>
   <string name="auth_username">Notendanafn</string>
@@ -18,4 +19,5 @@
   <string name="change_password">Breyta lykilorði</string>
   <string name="common_rename">Endurskýra</string>
   <string name="common_remove">Fjarlægja</string>
+  <string name="activity_chooser_send_file_title">Senda</string>
 </resources>
index 72061d2..d516061 100644 (file)
@@ -10,6 +10,7 @@
   <string name="actionbar_mkdir">Crea cartella</string>
   <string name="actionbar_settings">Impostazioni</string>
   <string name="actionbar_see_details">Dettagli</string>
+  <string name="actionbar_send_file">Invia</string>
   <string name="prefs_category_general">Generale</string>
   <string name="prefs_category_more">Altro</string>
   <string name="prefs_accounts">Account</string>
@@ -55,6 +56,8 @@
   <string name="filedetails_download">Scarica</string>
   <string name="filedetails_sync_file">Aggiorna file</string>
   <string name="filedetails_renamed_in_upload_msg">Il file è stato rinominato in %1$s durante il caricamento</string>
+  <string name="action_share_file">Condividi collegamento</string>
+  <string name="action_unshare_file">Rimuovi condivisione collegamento</string>
   <string name="common_yes">Sì</string>
   <string name="common_no">No</string>
   <string name="common_ok">OK</string>
   <string name="wait_a_moment">Attendi</string>
   <string name="filedisplay_unexpected_bad_get_content">Problema inatteso; prova un\'altra applicazione per selezionare il file</string>
   <string name="filedisplay_no_file_selected">Non è stato selezionato alcun file</string>
+  <string name="activity_chooser_title">Invia collegamento a...</string>
   <string name="oauth_check_onoff">Accesso con oAuth2.</string>
   <string name="oauth_login_connection">Connessione al server oAuth2 in corso...</string>
   <string name="ssl_validator_header">L\'identità del sito non può essere verificata</string>
   <string name="failed_upload_retry_do_nothing_text">non fare niente, non sei collegato per i caricamenti istantanei</string>
   <string name="failed_upload_failure_text">Messaggio d\'errore:</string>
   <string name="failed_upload_quota_exceeded_text">Controlla la configurazione del server, forse hai superato la tua quota.</string>
+  <string name="share_link_no_support_share_api">Spiacenti, la condivisione non è abilitata sul server. Contatta il tuo amministratore.</string>
+  <string name="share_link_file_no_exist">Impossibile condividere il file o la cartella. Assicurati che esista.</string>
+  <string name="share_link_file_error">Si è verificato un errore durante il tentativo di condivisione del file o della cartella</string>
+  <string name="unshare_link_file_no_exist">Impossibile rimuovere dalla condivisione il file o la cartella. Non esiste.</string>
+  <string name="unshare_link_file_error">Si è verificato un errore durante il tentativo di rimuovere la condivisione del file o della cartella</string>
+  <string name="activity_chooser_send_file_title">Invia</string>
+  <string name="copy_link">Copia collegamento</string>
+  <string name="clipboard_text_copied">Copiato negli appunti</string>
 </resources>
index 3870de6..fe478c7 100644 (file)
@@ -10,6 +10,7 @@
   <string name="actionbar_mkdir">ディレクトリを作成</string>
   <string name="actionbar_settings">設定</string>
   <string name="actionbar_see_details">詳細</string>
+  <string name="actionbar_send_file">送信</string>
   <string name="prefs_category_general">一般</string>
   <string name="prefs_category_more">もっと見る</string>
   <string name="prefs_accounts">アカウント</string>
@@ -18,9 +19,9 @@
   <string name="prefs_pincode_summary">クライアントを保護する</string>
   <string name="prefs_instant_upload">自動アップロードを有効</string>
   <string name="prefs_instant_upload_summary">カメラで撮影した画像を自動アップロード</string>
-  <string name="prefs_log_title">記録を有効化</string>
-  <string name="prefs_log_summary">これは問題を記録するのにつかわれます。</string>
-  <string name="prefs_log_title_history">記録している履歴</string>
+  <string name="prefs_log_title">ログを有効にする</string>
+  <string name="prefs_log_summary">これは問題をログに記録するのに使用します。</string>
+  <string name="prefs_log_title_history">ログ履歴</string>
   <string name="prefs_log_summary_history">これは記録されたログを表示します</string>
   <string name="prefs_log_delete_history_button">履歴を削除</string>
   <string name="prefs_help">ヘルプ</string>
@@ -46,7 +47,7 @@
   <string name="uploader_wrn_no_content_text">コンテンツを受信しませんでした。アップロードするものはありません。</string>
   <string name="uploader_error_forbidden_content">%1$sで共有コンテンツへのアクセスが許可されていません。</string>
   <string name="uploader_info_uploading">アップロード中</string>
-  <string name="file_list_empty">このフォルダにはファイルがありません。\n\"アップロード\" メニューで新しいファイルを追加することができます。</string>
+  <string name="file_list_empty">ã\81\93ã\81®ã\83\95ã\82©ã\83«ã\83\80ã\83¼ã\81«ã\81¯ã\83\95ã\82¡ã\82¤ã\83«ã\81\8cã\81\82ã\82\8aã\81¾ã\81\9bã\82\93ã\80\82\n\"ã\82¢ã\83\83ã\83\97ã\83­ã\83¼ã\83\89\" ã\83¡ã\83\8bã\83¥ã\83¼ã\81§æ\96°ã\81\97ã\81\84ã\83\95ã\82¡ã\82¤ã\83«ã\82\92追å\8a ã\81\99ã\82\8bã\81\93ã\81¨ã\81\8cã\81§ã\81\8dã\81¾ã\81\99ã\80\82</string>
   <string name="filedetails_select_file">ファイルをタップすると追加情報が表示されます。</string>
   <string name="filedetails_size">サイズ:</string>
   <string name="filedetails_type">タイプ:</string>
@@ -55,6 +56,8 @@
   <string name="filedetails_download">ダウンロード</string>
   <string name="filedetails_sync_file">ファイルを同期</string>
   <string name="filedetails_renamed_in_upload_msg">アップロード中にファイル名を %1$s に変更しました</string>
+  <string name="action_share_file">URLで共有</string>
+  <string name="action_unshare_file">未共有のリンク</string>
   <string name="common_yes">はい</string>
   <string name="common_no">いいえ</string>
   <string name="common_ok">OK</string>
   <string name="sync_conflicts_in_favourites_content">%1$d 同期ファイルを同期できませんでした</string>
   <string name="sync_fail_in_favourites_ticker">ファイルの同期に失敗しました</string>
   <string name="sync_fail_in_favourites_content">%1$d ファイルのコンテンツを同期できませんでした(%2$d の競合)</string>
-  <string name="sync_foreign_files_forgotten_ticker">いくつかのローカルファイルが忘れられています</string>
+  <string name="sync_foreign_files_forgotten_ticker">一部のローカルファイルが忘れられています</string>
   <string name="sync_foreign_files_forgotten_content">%2$s ディレクトリ内の %1$d ファイルはコピーすることができませんでした</string>
-  <string name="sync_foreign_files_forgotten_explanation">\"バージョン 1.3.16から、このデバイスからアップロードされたファイルは、単独のファイルが複数のアカウントと同期される時にデータの損失を防ぐため、ローカルの%1$sのフォルダにコピーされます。\n\nこの変更により、このアプリの以前のバージョンでアップロードされたすべてのファイルが%2$s フォルダにコピーされます。ただし、アカウント同期の際に、エラーがこの操作の完了を阻止しました。このままファイルを残し、%3$sへのリンクを削除するか、あるいは%1$s ディレクトリのファイルを移動し、%4$sへのリンクを維持することができます。\n\n以下にローカルのファイルと、それにリンクしていた%5$sのリモートファイルがリストされています</string>
-  <string name="sync_current_folder_was_removed">フォルダ %1$s はもう存在しません</string>
+  <string name="sync_foreign_files_forgotten_explanation">バージョン 1.3.16から、このデバイスからアップロードされたファイルは、単独のファイルが複数のアカウントと同期される時にデータの損失を防ぐため、ローカルの%1$sのフォルダにコピーされます。\n\nこの変更により、このアプリの以前のバージョンでアップロードされたすべてのファイルが%2$s フォルダにコピーされます。ただし、アカウント同期の際に、エラーがこの操作の完了を阻止しました。ファイルをこのままにして%3$sへのリンクを削除するか、あるいは%1$s ディレクトリにファイルを移動して%4$sへのリンクを維持することができます。\n\n以下にリストされているのは、ローカルのファイル及びそれらにリンクしている %5$s 内のリモートファイルです。</string>
+  <string name="sync_current_folder_was_removed">フォルダ %1$s はもう存在しません</string>
   <string name="foreign_files_move">全て移動</string>
   <string name="foreign_files_success">全てのファイルは移動されました</string>
-  <string name="foreign_files_fail">いくつかのファイルは移動出来ませんでした</string>
+  <string name="foreign_files_fail">一部のファイルは移動できませんでした</string>
   <string name="foreign_files_local_text">ローカル: %1$s</string>
   <string name="foreign_files_remote_text">リモート: %1$s</string>
-  <string name="upload_query_move_foreign_files">%1$s ã\83\95ã\82©ã\83«ã\83\80ã\81«é\81¸æ\8a\9eã\81\95ã\82\8cã\81\9fã\83\95ã\82¡ã\82¤ã\83«ã\82\92ã\82³ã\83\94ã\83¼ã\81\99ã\82\8bã\81®ã\81«å\8d\81å\88\86ã\81ªã\82¹ã\83\9aã\83¼ã\82¹がありません。コピーする代わりに、それらを移動させますか?</string>
+  <string name="upload_query_move_foreign_files">%1$s ã\83\95ã\82©ã\83«ã\83\80ã\83¼ã\81«é\81¸æ\8a\9eã\81\95ã\82\8cã\81\9fã\83\95ã\82¡ã\82¤ã\83«ã\82\92ã\82³ã\83\94ã\83¼ã\81\99ã\82\8bã\81®ã\81«å\8d\81å\88\86ã\81ªç©ºã\81\8dé \98å\9f\9fがありません。コピーする代わりに、それらを移動させますか?</string>
   <string name="pincode_enter_pin_code">アプリのパスワードを入力してください</string>
   <string name="pincode_configure_your_pin">アプリのパスワードを入力してください</string>
   <string name="pincode_configure_your_pin_explanation">アプリ開始時に毎回PINが要求されます。</string>
   <string name="media_err_malformed">メディアファイルが正確にエンコードされていません</string>
   <string name="media_err_timeout">再生中にタイムアウトが発生しました</string>
   <string name="media_err_invalid_progressive_playback">メディアファイルをストリーミングできません</string>
-  <string name="media_err_unknown">メディアファイルをStock Media Playerでプレイ出来ません</string>
-  <string name="media_err_security_ex">プレイに際してセキュリティエラー %1$s</string>
-  <string name="media_err_io_ex">プレイに際して入力エラー %1$s</string>
-  <string name="media_err_unexpected">プレイに際して予期しないエラー %1$s</string>
+  <string name="media_err_unknown">メディアファイルをStock Media Playerで再生できません</string>
+  <string name="media_err_security_ex">再生時にセキュリティエラー %1$s</string>
+  <string name="media_err_io_ex">再生時に入力エラー %1$s</string>
+  <string name="media_err_unexpected">再生時に予期しないエラー %1$s</string>
   <string name="media_rewind_description">巻き戻しボタン</string>
-  <string name="media_play_pause_description">プレイ/ポーズボタン</string>
+  <string name="media_play_pause_description">再生/一時停止ボタン</string>
   <string name="media_forward_description">早送りボタン</string>
   <string name="auth_trying_to_login">ログイン中...</string>
   <string name="auth_no_net_conn_title">ネットワークに接続されていません</string>
   <string name="auth_nossl_plain_ok_title">暗号化通信が利用できません。</string>
   <string name="auth_connection_established">接続が確立しました</string>
   <string name="auth_testing_connection">接続をテスト中...</string>
-  <string name="auth_not_configured_title">サーバーの間違った設定</string>
-  <string name="auth_account_not_new">å\90\8cã\81\98ã\83¦ã\83¼ã\82¶ã\81¨ã\82µã\83¼ã\83\90のアカウントがデバイス上にすでに存在します</string>
-  <string name="auth_account_not_the_same">å\85¥å\8a\9bã\81\95ã\82\8cã\81\9fã\83¦ã\83¼ã\82¶ã\81¯ã\81\93ã\81®ã\82¢ã\82«ã\82¦ã\83³ã\83\88ã\81®ã\83¦ã\83¼ã\82と一致しません</string>
+  <string name="auth_not_configured_title">サーバー設定が間違っています</string>
+  <string name="auth_account_not_new">å\90\8cã\81\98ã\83¦ã\83¼ã\82¶ã\83¼ã\81¨ã\82µã\83¼ã\83\90ã\83¼のアカウントがデバイス上にすでに存在します</string>
+  <string name="auth_account_not_the_same">å\85¥å\8a\9bã\81\95ã\82\8cã\81\9fã\83¦ã\83¼ã\82¶ã\83¼ã\81¯ã\81\93ã\81®ã\82¢ã\82«ã\82¦ã\83³ã\83\88ã\81®ã\83¦ã\83¼ã\82¶ã\83¼と一致しません</string>
   <string name="auth_unknown_error_title">不明なエラーに発生しました</string>
   <string name="auth_unknown_host_title">ホストが見つかりませんでした</string>
-  <string name="auth_incorrect_path_title">ã\81®ã\82¤ã\83³ã\82¹ã\82¿ã\83³ã\82¹ã\81\8cè¦\8bã\81¤ã\81\8bã\82\8aã\81¾ã\81\9bã\82\93ã\81§ã\81\97ã\81\9f</string>
-  <string name="auth_timeout_title">サーバーからの反応がありません</string>
+  <string name="auth_incorrect_path_title">ã\82µã\83¼ã\83\90ã\83¼ã\81®ã\82¤ã\83³ã\82¹ã\82¿ã\83³ã\82¹ã\81\8cè¦\8bã\81¤ã\81\8bã\82\8aã\81¾ã\81\9bã\82\93</string>
+  <string name="auth_timeout_title">サーバーからの反応がありません</string>
   <string name="auth_incorrect_address_title">不明なURL形式</string>
   <string name="auth_ssl_general_error_title">SSLの初期化に失敗しました</string>
-  <string name="auth_ssl_unverified_server_title">SSL サーバ識別子を確認できませんでした</string>
-  <string name="auth_bad_oc_version_title">認識出来ないサーバのバージョンです</string>
+  <string name="auth_ssl_unverified_server_title">SSLサーバー識別子を確認できませんでした</string>
+  <string name="auth_bad_oc_version_title">認識できないサーバーのバージョンです</string>
   <string name="auth_wrong_connection_title">接続を確立できませんでした</string>
   <string name="auth_secure_connection">暗号化通信を確立しました</string>
   <string name="auth_unauthorized">間違ったユーザー名もしくはパスワード</string>
   <string name="auth_expired_oauth_token_toast">認証情報は有効期限切れです。再度認証を行ってください。</string>
   <string name="auth_expired_basic_auth_toast">現在のパスワードを入力してください</string>
   <string name="auth_expired_saml_sso_token_toast">セッションの有効期限切れです。再度接続してください。</string>
-  <string name="auth_connecting_auth_server">認証サーバに接続中 ...</string>
-  <string name="auth_unsupported_auth_method">サーバはこの認証方式をサポートしていません</string>
+  <string name="auth_connecting_auth_server">èª\8d証ã\82µã\83¼ã\83\90ã\83¼ã\81«æ\8e¥ç¶\9a中 ...</string>
+  <string name="auth_unsupported_auth_method">ã\82µã\83¼ã\83\90ã\83¼ã\81¯ã\81\93ã\81®èª\8d証æ\96¹å¼\8fã\82\92ã\82µã\83\9dã\83¼ã\83\88ã\81\97ã\81¦ã\81\84ã\81¾ã\81\9bã\82\93</string>
   <string name="auth_unsupported_multiaccount">%1$s は複数アカウントをサポートしていません</string>
+  <string name="auth_fail_get_user_name">サーバーが正しいユーザーIDを返してきません。管理者に連絡してください。</string>
   <string name="fd_keep_in_sync">ファイルを最新に保つ</string>
   <string name="common_rename">名前を変更</string>
   <string name="common_remove">削除</string>
   <string name="confirmation_remove_folder_alert">本当に %1$s およびそのコンテンツを削除してもよろしいですか?</string>
   <string name="confirmation_remove_local">ローカルのみ</string>
   <string name="confirmation_remove_folder_local">ローカルコンテンツのみ</string>
-  <string name="confirmation_remove_remote">サーバから削除</string>
+  <string name="confirmation_remove_remote">ã\82µã\83¼ã\83\90ã\83¼ã\81\8bã\82\89å\89\8aé\99¤</string>
   <string name="confirmation_remove_remote_and_local">リモートとローカルの両方</string>
   <string name="remove_success_msg">削除に成功しました</string>
   <string name="remove_fail_msg">削除を完了できませんでした</string>
   <string name="wait_a_moment">しばらくお待ちください</string>
   <string name="filedisplay_unexpected_bad_get_content">予期せぬ問題;他のアプリでファイルを選択してみてください。</string>
   <string name="filedisplay_no_file_selected">ファイルは選択されていません</string>
-  <string name="oauth_check_onoff">oAuth2 でログイン</string>
+  <string name="activity_chooser_title">リンクを送信…</string>
+  <string name="oauth_check_onoff">oAuth2でログイン</string>
   <string name="oauth_login_connection">oAuth2サーバーに接続中...</string>
   <string name="ssl_validator_header">サイトの識別子を確認できませんでした</string>
-  <string name="ssl_validator_reason_cert_not_trusted">- サーバ証明書は信頼されていません</string>
-  <string name="ssl_validator_reason_cert_expired">- サーバ証明書は有効期限切れです</string>
-  <string name="ssl_validator_reason_cert_not_yet_valid">- サーバ証明書は若すぎます</string>
+  <string name="ssl_validator_reason_cert_not_trusted">- サーバ証明書は信頼されていません</string>
+  <string name="ssl_validator_reason_cert_expired">- サーバ証明書は有効期限切れです</string>
+  <string name="ssl_validator_reason_cert_not_yet_valid">- サーバー証明書の有効期限は未来のものです</string>
   <string name="ssl_validator_reason_hostname_not_verified">- URLは証明書内のホスト名と一致しません</string>
   <string name="ssl_validator_question">この証明書を信頼してもよろしいですか?</string>
   <string name="ssl_validator_not_saved">証明書は保存できませんでした</string>
   <string name="placeholder_media_time">12:23:45</string>
   <string name="instant_upload_on_wifi">WiFi経由でのみ写真をアップロード</string>
   <string name="instant_upload_path">/InstantUpload</string>
-  <string name="conflict_title">æ\9b´æ\96°ã\81®競合</string>
-  <string name="conflict_message">リモートファイル %s はローカルファイルと同期していません。続行すると、サーバ上のファイルを置き換えます。</string>
+  <string name="conflict_title">æ\9b´æ\96°ã\81\8c競合</string>
+  <string name="conflict_message">リモートファイル %s はローカルファイルと同期していません。続行すると、サーバ上のファイルを置き換えます。</string>
   <string name="conflict_keep_both">両方を保持</string>
   <string name="conflict_overwrite">上書き</string>
   <string name="conflict_dont_upload">アップロードしない</string>
   <string name="preview_image_description">イメージプレビュー</string>
   <string name="preview_image_error_unknown_format">この画像は表示できません</string>
-  <string name="error__upload__local_file_not_copied">%1$s は %2$s ローカルディレクトリにコピー出来ませんでした</string>
+  <string name="error__upload__local_file_not_copied">%1$s は %2$s ローカルディレクトリにコピーできませんでした</string>
   <string name="actionbar_failed_instant_upload">インスタントアップロードに失敗</string>
   <string name="failed_upload_headline_text">インスタントアップロードに失敗</string>
   <string name="failed_upload_headline_hint">全ての失敗したインスタントアップロードの要約</string>
   <string name="failed_upload_load_more_images">更に画像を読み込む</string>
   <string name="failed_upload_retry_do_nothing_text">オンラインでなく、インスタントアップロードのために何もしません</string>
   <string name="failed_upload_failure_text">失敗メッセージ:</string>
-  <string name="failed_upload_quota_exceeded_text">サーバーの設定を確認してください。許容を超過している可能性があります。</string>
+  <string name="failed_upload_quota_exceeded_text">サーバー設定を確認してください。クォータサイズを超えている可能性があります。</string>
+  <string name="share_link_no_support_share_api">すみませんが、サーバーで共有が有効になっていません。管理者に連絡してください。</string>
+  <string name="share_link_file_no_exist">このファイルまたはフォルダーは共有できません。存在しているか確認してください。</string>
+  <string name="share_link_file_error">このファイルまたはフォルダーを共有する際にエラーが発生しました</string>
+  <string name="unshare_link_file_no_exist">このファイルもしくはフォルダは存在しないため、共有を解除できません。</string>
+  <string name="unshare_link_file_error">このファイルまたはフォルダーの共有を解除する際にエラーが発生しました</string>
+  <string name="activity_chooser_send_file_title">送信</string>
+  <string name="copy_link">リンクをコピー</string>
+  <string name="clipboard_text_copied">クリップボードにコピー</string>
 </resources>
index 0ff4bee..1980bc5 100644 (file)
@@ -5,6 +5,7 @@
   <string name="actionbar_upload_files">ფაილები</string>
   <string name="actionbar_mkdir">დირექტორიის შექმნა</string>
   <string name="actionbar_settings">პარამეტრები</string>
+  <string name="actionbar_send_file">გაგზავნა</string>
   <string name="prefs_category_general">ზოგადი</string>
   <string name="prefs_category_more">უფრო მეტი</string>
   <string name="prefs_accounts">ანგარიში</string>
   <string name="conflict_overwrite">გადააწერე</string>
   <string name="conflict_dont_upload">არ ატვირთო</string>
   <string name="error__upload__local_file_not_copied">%1$s–ის კოპირება ვერ მოხერხდა %2$s  ლოკალურ დირექტორიაში</string>
+  <string name="activity_chooser_send_file_title">გაგზავნა</string>
+  <string name="clipboard_text_copied">კოპირებულია კლიპბორდში</string>
 </resources>
index c757504..b53638a 100644 (file)
@@ -1,2 +1,49 @@
 <?xml version='1.0' encoding='UTF-8'?>
-<resources/>
+<resources>
+  <string name="actionbar_upload">ផ្ទុក​ឡើង</string>
+  <string name="actionbar_upload_files">ឯកសារ</string>
+  <string name="actionbar_mkdir">បង្កើត​ថត​ផ្ទុក</string>
+  <string name="actionbar_settings">ការកំណត់</string>
+  <string name="actionbar_send_file">ផ្ញើ</string>
+  <string name="prefs_category_general">ទូទៅ</string>
+  <string name="prefs_category_more">ច្រើន​ទៀត</string>
+  <string name="prefs_accounts">គណនី</string>
+  <string name="prefs_help">ជំនួយ</string>
+  <string name="auth_username">ឈ្មោះ​អ្នកប្រើ</string>
+  <string name="auth_password">ពាក្យសម្ងាត់</string>
+  <string name="sync_string_files">ឯកសារ</string>
+  <string name="setup_btn_connect">ភ្ជាប់</string>
+  <string name="uploader_btn_upload_text">ផ្ទុក​ឡើង</string>
+  <string name="uploader_wrn_no_account_title">រកមិនឃើញ​គណនី</string>
+  <string name="uploader_wrn_no_account_text">គ្មាន %1$s គណនី​លើម៉ាស៊ីន​របស់អ្នកទេ។ សូមរៀបចំគណនីមួយជាមុនសិន។</string>
+  <string name="uploader_wrn_no_account_setup_btn_text">ដំឡើង</string>
+  <string name="uploader_wrn_no_account_quit_btn_text">ចាក់ចេញ</string>
+  <string name="uploader_info_uploading">កំពុង​ផ្ទុក​ឡើង</string>
+  <string name="filedetails_select_file">ចុចមួយ​លើឯកសារ ដើម្បី​បង្ហាញ​ព័ត៌មាន​បន្ថែម។</string>
+  <string name="filedetails_size">ទំហំ៖</string>
+  <string name="filedetails_type">ប្រភេទ៖</string>
+  <string name="filedetails_created">បាន​បង្កើត៖</string>
+  <string name="filedetails_modified">បាន​កែ​សម្រួល៖</string>
+  <string name="filedetails_download">ទាញយក</string>
+  <string name="common_yes">ព្រម</string>
+  <string name="common_no">ទេ</string>
+  <string name="common_ok">OK</string>
+  <string name="common_cancel">លើកលែង</string>
+  <string name="common_save_exit">រក្សាទុក &amp; ចាកចេញ</string>
+  <string name="common_error">កំហុស</string>
+  <string name="common_error_unknown">មិន​ស្គាល់​កំហុស</string>
+  <string name="change_password">ប្តូរ​ពាក្យសម្ងាត់</string>
+  <string name="uploader_info_dirname">ឈ្មោះ​ថត​ផ្ទុក</string>
+  <string name="common_choose_account">ជ្រើស​គណនី</string>
+  <string name="pincode_enter_pin_code">សូម ដាក់​បញ្ចូល App PIN របស់អ្នក</string>
+  <string name="pincode_configure_your_pin">បញ្ចូល App PIN របស់អ្នក</string>
+  <string name="pincode_reenter_your_pincode">សូម បញ្ចូល App PIN របស់អ្នក​ម្តង​ទៀត</string>
+  <string name="pincode_remove_your_pincode">លុប App PIN របស់​អ្នក</string>
+  <string name="pincode_mismatch">App PIN ទាំងនេះ​មិនដូចគ្នាទេ</string>
+  <string name="pincode_wrong">App PIN មិន​ត្រឹម​ត្រូវទេ</string>
+  <string name="pincode_removed">App PIN បាន​លុបចេញហើយ</string>
+  <string name="pincode_stored">App PIN បាន​យក​មកវិញ</string>
+  <string name="auth_no_net_conn_title">គ្មានបណ្តាញ​តភ្ជាប់ទេ</string>
+  <string name="common_remove">ដកចេញ</string>
+  <string name="activity_chooser_send_file_title">ផ្ញើ</string>
+</resources>
index c18708c..447fab7 100644 (file)
@@ -10,6 +10,7 @@
   <string name="actionbar_mkdir">디렉터리 만들기</string>
   <string name="actionbar_settings">설정</string>
   <string name="actionbar_see_details">세부내용</string>
+  <string name="actionbar_send_file">보내기</string>
   <string name="prefs_category_general">일반</string>
   <string name="prefs_category_more">더 중요함</string>
   <string name="prefs_accounts">계정</string>
@@ -55,6 +56,7 @@
   <string name="filedetails_download">다운로드</string>
   <string name="filedetails_sync_file">파일 새로고침</string>
   <string name="filedetails_renamed_in_upload_msg">업로드 중 파일 이름을 %1$s(으)로 변경하였습니다</string>
+  <string name="action_share_file">링크 공유</string>
   <string name="common_yes">예</string>
   <string name="common_no">아니요</string>
   <string name="common_ok">확인</string>
@@ -94,7 +96,6 @@
   <string name="sync_fail_in_favourites_content">파일 %1$d개의 내용을 동기화할 수 없었습니다 (충돌 %2$d개)</string>
   <string name="sync_foreign_files_forgotten_ticker">몇몇 로컬 파일이 사라졌습니다.</string>
   <string name="sync_foreign_files_forgotten_content">%1$d 파일을 %2$s 디렉토리에 복사하지 못하였습니다.</string>
-  <string name="sync_foreign_files_forgotten_explanation">1.3.16 버전에서, 파일 업로드는 다수의 계정이 동시에 접속될때 데이터 유실을 피하기 위해 로컬 %1$s 폴더로 복사됩니다.⏎\n⏎\n이 변화로 인해, 예전 버전으로 올리신 파일들은 %2$s 폴더로 복사되었습니다. 그러나, 계정 동기화중 오류로 인해 작업을 완료하지 못할수 있습니다. 파일을 남기시고 %3$s로 연결되는 링크를 지우시거나, 혹은 파일을 %1$s 폴더로 이동시키고, %4$s에 링크를 유지시킬수 있습니다.⏎\n⏎\n아래에는 로컬 파일과 더불어, %5$s로 링크된 리모트 파일들의 목록이 있습니다.\n</string>
   <string name="sync_current_folder_was_removed">%1$s 폴더가 존재하지 않습니다.</string>
   <string name="foreign_files_move">모두 옮김</string>
   <string name="foreign_files_success">모든 파일 옮김</string>
   <string name="failed_upload_retry_do_nothing_text">현재 온라인이 아니셔서 자동 업로드를 할수 없습니다</string>
   <string name="failed_upload_failure_text">실패 메시지:</string>
   <string name="failed_upload_quota_exceeded_text">서버 설정을 확인해주세요, 아마 업로드 제한을 초과하셨을겁니다.</string>
+  <string name="activity_chooser_send_file_title">보내기</string>
+  <string name="copy_link">링크 복사</string>
+  <string name="clipboard_text_copied">클립보드로 복사됨</string>
 </resources>
index 6031cfc..d87bb4a 100644 (file)
@@ -7,6 +7,7 @@
   <string name="actionbar_mkdir">Dossier erstellen</string>
   <string name="actionbar_settings">Astellungen</string>
   <string name="actionbar_see_details">Detailer</string>
+  <string name="actionbar_send_file">Schécken</string>
   <string name="prefs_category_general">Allgemeng</string>
   <string name="prefs_category_more">Méi</string>
   <string name="prefs_accounts">Accounten</string>
@@ -27,6 +28,7 @@
   <string name="filedetails_created">Erstallt:</string>
   <string name="filedetails_modified">Geännert:</string>
   <string name="filedetails_download">Download</string>
+  <string name="action_share_file">Link deelen</string>
   <string name="common_yes">Jo</string>
   <string name="common_no">Nee</string>
   <string name="common_ok">OK</string>
@@ -81,4 +83,5 @@
   <string name="conflict_dont_upload">Net eroplueden</string>
   <string name="failed_upload_all_cb">all auswielen</string>
   <string name="failed_upload_failure_text">Fehler Message:</string>
+  <string name="activity_chooser_send_file_title">Schécken</string>
 </resources>
index ed04b6a..69132c7 100644 (file)
@@ -10,6 +10,7 @@
   <string name="actionbar_mkdir">Kurti aplanką</string>
   <string name="actionbar_settings">Nustatymai</string>
   <string name="actionbar_see_details">Informacija</string>
+  <string name="actionbar_send_file">Siųsti</string>
   <string name="prefs_category_general">Bendras</string>
   <string name="prefs_category_more">Daugiau</string>
   <string name="prefs_accounts">Paskyros</string>
@@ -30,6 +31,7 @@
   <string name="recommend_subject">Išbandykite %1$s savo išmaniajame telefone!</string>
   <string name="recommend_text">Siūlau pabandyti %1$s savo išmaniajame telefone!\nParsisiųskite štai čia: %2$s</string>
   <string name="auth_check_server">Patikrinti Serverį</string>
+  <string name="auth_host_url">Serverio adresas </string>
   <string name="auth_username">Prisijungimo vardas</string>
   <string name="auth_password">Slaptažodis</string>
   <string name="sync_string_files">Failai</string>
@@ -53,6 +55,7 @@
   <string name="filedetails_download">Atsisiųsti</string>
   <string name="filedetails_sync_file">Atnaujinti failą</string>
   <string name="filedetails_renamed_in_upload_msg">Įkėlimo metu failas buvo pervadintas į %1$s</string>
+  <string name="action_share_file">Dalintis nuoroda</string>
   <string name="common_yes">Taip</string>
   <string name="common_no">Ne</string>
   <string name="common_ok">Gerai</string>
   <string name="media_event_done">%1$s sąrašas baigtas</string>
   <string name="media_err_nothing_to_play">Nerasta medija failų</string>
   <string name="media_err_no_account">Nenurodyta paskyra</string>
+  <string name="media_err_not_in_owncloud">Failas yra netinkamoje sąskaitoje</string>
   <string name="media_err_unsupported">Nepalaikomas kodekas</string>
   <string name="media_err_io">Nenuskaitomas medijos failas</string>
   <string name="media_err_malformed">Netinkamai užkoduotas medijos failas</string>
   <string name="wait_a_moment">Truputį palaukite</string>
   <string name="filedisplay_unexpected_bad_get_content">Netikėta problema ; prašome pasirinkti failą iš kitos programėlės</string>
   <string name="filedisplay_no_file_selected">Joks failas nebuvo pasirinktas</string>
+  <string name="activity_chooser_title">Siųsti nuorodą asmeniui ...</string>
   <string name="oauth_check_onoff">Prisijungti naudojant oAuth2</string>
   <string name="oauth_login_connection">Jungiamasi prie oAuth2 serverio...</string>
   <string name="ssl_validator_header">Serverio tapatybė negali būti patikrinta</string>
   <string name="conflict_dont_upload">Nebesiųsti</string>
   <string name="preview_image_description">Paveikslėlio peržiūra</string>
   <string name="preview_image_error_unknown_format">Neįmanoma parodyti paveikslėlio</string>
+  <string name="failed_upload_headline_text">Nepavykę momentiniai įkėlimai</string>
+  <string name="failed_upload_headline_hint">Suvestinė visų nepavykusių momentinių įkėlimų</string>
   <string name="failed_upload_all_cb">pažymėti viską</string>
+  <string name="failed_upload_headline_retryall_btn">bandyti dar kartą su visais pažymėtais</string>
   <string name="failed_upload_retry_text">bandyti iš naujo nusiųsti paveikslėlį:</string>
   <string name="failed_upload_load_more_images">Įkelti daugiau Nuotraukų</string>
   <string name="failed_upload_failure_text">Klaidos pranešimas:</string>
   <string name="failed_upload_quota_exceeded_text">Patikrinkite savo serverio nustatymus, tikėtina jog viršijote savo limitą.</string>
+  <string name="share_link_no_support_share_api">Deja, bendrinimas neįjungtas Jūsų serveryje. Prašome susisiekti su administratoriumi.</string>
+  <string name="activity_chooser_send_file_title">Siųsti</string>
+  <string name="copy_link">Kopijuoti nuorodą</string>
+  <string name="clipboard_text_copied">Nukopijuota į talpyklę</string>
 </resources>
index e52b10f..1f68e9a 100644 (file)
@@ -5,6 +5,7 @@
   <string name="actionbar_upload_files">Datnes</string>
   <string name="actionbar_mkdir">Izveidot direktoriju</string>
   <string name="actionbar_settings">Iestatījumi</string>
+  <string name="actionbar_send_file">Sūtīt</string>
   <string name="prefs_category_general">Vispārīgi</string>
   <string name="prefs_category_more">Vairāk</string>
   <string name="prefs_accounts">Konti</string>
@@ -43,6 +44,7 @@
   <string name="common_cancel">Atcelt</string>
   <string name="common_save_exit">Saglabāt un iziet</string>
   <string name="common_error">Kļūda</string>
+  <string name="common_loading">Ielādē</string>
   <string name="about_title">Par</string>
   <string name="change_password">Mainīt paroli</string>
   <string name="delete_account">Dzēst kontu</string>
   <string name="conflict_keep_both">Paturēt abas</string>
   <string name="conflict_overwrite">Pārrakstīt</string>
   <string name="conflict_dont_upload">Neaugšupielādēt</string>
+  <string name="activity_chooser_send_file_title">Sūtīt</string>
 </resources>
index 2c514f5..c90336a 100644 (file)
@@ -6,6 +6,7 @@
   <string name="actionbar_mkdir">Создади папка</string>
   <string name="actionbar_settings">Параметри</string>
   <string name="actionbar_see_details">Детали:</string>
+  <string name="actionbar_send_file">Прати</string>
   <string name="prefs_category_general">Општо</string>
   <string name="prefs_category_more">Повеќе</string>
   <string name="prefs_accounts">Сметки</string>
@@ -29,6 +30,7 @@
   <string name="filedetails_created">Создадено:</string>
   <string name="filedetails_modified">Изменето:</string>
   <string name="filedetails_download">Преземање</string>
+  <string name="action_share_file">Сподели ја врската</string>
   <string name="common_yes">Да</string>
   <string name="common_no">Не</string>
   <string name="common_ok">Во ред</string>
   <string name="conflict_keep_both">Задржи ги и двете</string>
   <string name="conflict_overwrite">Препиши</string>
   <string name="failed_upload_all_cb">избери се</string>
+  <string name="activity_chooser_send_file_title">Прати</string>
 </resources>
diff --git a/res/values-ml/strings.xml b/res/values-ml/strings.xml
new file mode 100644 (file)
index 0000000..c757504
--- /dev/null
@@ -0,0 +1,2 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<resources/>
diff --git a/res/values-mn/strings.xml b/res/values-mn/strings.xml
new file mode 100644 (file)
index 0000000..c757504
--- /dev/null
@@ -0,0 +1,2 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<resources/>
index 48b731b..f953e43 100644 (file)
@@ -1,32 +1,63 @@
 <?xml version='1.0' encoding='UTF-8'?>
 <resources>
+  <string name="about_android">%1$s Andriod app</string>
+  <string name="about_version">versjon %1$s</string>
+  <string name="actionbar_sync">Oppdater konto</string>
   <string name="actionbar_upload">Last opp</string>
   <string name="actionbar_upload_from_apps">Innhold fra andre applikasjoner</string>
   <string name="actionbar_upload_files">Filer</string>
+  <string name="actionbar_open_with">Åpne med</string>
   <string name="actionbar_mkdir">Opprett katalog</string>
   <string name="actionbar_settings">Innstillinger</string>
+  <string name="actionbar_see_details">Detaljer</string>
+  <string name="actionbar_send_file">Send</string>
   <string name="prefs_category_general">Generelt</string>
   <string name="prefs_category_more">Mer</string>
   <string name="prefs_accounts">Kontoer</string>
+  <string name="prefs_manage_accounts">Håndter kontoer</string>
+  <string name="prefs_pincode">PIN kode</string>
+  <string name="prefs_pincode_summary">Beskytt klienten din</string>
+  <string name="prefs_instant_upload">Aktiver direkte opplastinger</string>
   <string name="prefs_instant_upload_summary">Last opp bilder tatt med kamera øyeblikkelig</string>
+  <string name="prefs_log_title">Aktiver loggføring</string>
+  <string name="prefs_log_summary">Denne er brukt til å loggføre problemer</string>
+  <string name="prefs_log_title_history">Loggføringshistorikk</string>
+  <string name="prefs_log_summary_history">Denne viser de lagrede loggene</string>
+  <string name="prefs_log_delete_history_button">Slett historikk</string>
   <string name="prefs_help">Hjelp</string>
+  <string name="prefs_recommend">Anbefal til en venn</string>
+  <string name="prefs_feedback">Tilbakemelding</string>
+  <string name="prefs_imprint">Avtrykk</string>
+  <string name="recommend_subject">Prøv %1$s på smarttelefonen din!</string>
+  <string name="recommend_text">Jeg vil gjerne invitere deg til å bruke %1$s på smarttelefonen din!\nLast ned her: %2$s</string>
+  <string name="auth_check_server">Sjekk server</string>
+  <string name="auth_host_url">Serveradresse https://...</string>
   <string name="auth_username">Brukernavn</string>
   <string name="auth_password">Passord</string>
+  <string name="auth_register">Ny med %1$s?</string>
   <string name="sync_string_files">Filer</string>
   <string name="setup_btn_connect">Koble til</string>
   <string name="uploader_btn_upload_text">Last opp</string>
+  <string name="uploader_top_message">Velg opplastingsmappe:</string>
   <string name="uploader_wrn_no_account_title">Ingen konto funnet</string>
+  <string name="uploader_wrn_no_account_text">Det finnes ingen %1$s kontoer for din enhet. For å bruker denne appen må du først opprette en.</string>
   <string name="uploader_wrn_no_account_setup_btn_text">Oppsett</string>
   <string name="uploader_wrn_no_account_quit_btn_text">Avslutt</string>
   <string name="uploader_wrn_no_content_title">Intet innhold å laste opp</string>
   <string name="uploader_wrn_no_content_text">Intet innhold ble mottatt. Intet å laste opp.</string>
+  <string name="uploader_error_forbidden_content">%1$s har ikke tilgang til det delte innholdet</string>
   <string name="uploader_info_uploading">Laster opp</string>
+  <string name="file_list_empty">Det finnes ikke filer i mappen.\nNye filer kan legges til med \"last opp\" i menyen.</string>
   <string name="filedetails_select_file">Trykk på en fil for å vise ekstra informasjon.</string>
   <string name="filedetails_size">Størrelse:</string>
   <string name="filedetails_type">Type:</string>
   <string name="filedetails_created">Opprettet:</string>
   <string name="filedetails_modified">Endret:</string>
   <string name="filedetails_download">Last ned</string>
+  <string name="filedetails_sync_file">Oppdater fil</string>
+  <string name="filedetails_renamed_in_upload_msg">Filnavnet ble endret til  %1$s under opplasting</string>
+  <string name="action_share_file">Del lenke</string>
+  <string name="action_unshare_file">Avslutt deling av lenke</string>
   <string name="common_yes">Ja</string>
   <string name="common_no">Nei</string>
   <string name="common_ok">OK</string>
@@ -35,6 +66,8 @@
   <string name="common_cancel">Avbryt</string>
   <string name="common_save_exit">Lagre og avslutt</string>
   <string name="common_error">Feil</string>
+  <string name="common_loading">Laster...</string>
+  <string name="common_error_unknown">Ukjent feil</string>
   <string name="about_title">Om</string>
   <string name="change_password">Endre passord</string>
   <string name="delete_account">Slett konto</string>
   <string name="uploader_upload_in_progress_ticker">Laster opp...</string>
   <string name="uploader_upload_in_progress_content">%1$d%% Laster opp %2$s</string>
   <string name="uploader_upload_succeeded_ticker">Opplasting fullført</string>
+  <string name="uploader_upload_succeeded_content_single">%1$s ble lastet opp</string>
   <string name="uploader_upload_failed_ticker">Opplasting feilet</string>
   <string name="uploader_upload_failed_content_single">Opplasting av %1$s kunne ikke fullføres</string>
   <string name="downloader_download_in_progress_ticker">Laster ned...</string>
   <string name="downloader_download_in_progress_content">%1$d%% Laster ned %2$s</string>
   <string name="downloader_download_succeeded_ticker">Nedlasting fullført</string>
+  <string name="downloader_download_succeeded_content">%1$s ble lastet ned</string>
   <string name="downloader_download_failed_ticker">Nedlasting feilet</string>
   <string name="downloader_download_failed_content">Nedlasting av %1$s kunne ikke fullføres</string>
+  <string name="downloader_not_downloaded_yet">Ikke lastet ned enda</string>
   <string name="common_choose_account">Velg konto</string>
   <string name="sync_fail_ticker">Synkronisering feilet</string>
   <string name="sync_fail_content">Synkronisering av %1$s kunne ikke fullføres</string>
+  <string name="sync_fail_content_unauthorized">Ugyldig passord for %1$s</string>
   <string name="sync_conflicts_in_favourites_ticker">Konflikter funnet</string>
+  <string name="sync_conflicts_in_favourites_content">%1$d hold-i-synk filer kunne ikke synkroniseres</string>
+  <string name="sync_fail_in_favourites_ticker">Hold i synk filer mislyktes</string>
+  <string name="sync_fail_in_favourites_content">Innholdet av %1$d filer kunne ikke synkroniseres (%2$d konflikter)</string>
+  <string name="sync_foreign_files_forgotten_ticker">Noen lokale filer ble glemt</string>
+  <string name="sync_foreign_files_forgotten_content">%1$d filer av %2$s mappen kunne ikke kopieres til</string>
+  <string name="sync_foreign_files_forgotten_explanation">Fra versjon 1.3.16 blir filer som lastes opp fra denne enheten kopiert inn i lokal mappe %1$s for å forhindre tap av data når en enkelt fil synkroniseres med flere kontoer.\n\nPga. denne endringen ble alle filer som er lastet opp med tidligere versjoner kopiert inn i lokal mappe %2$s. Imidlertid skjedde det en feil og denne operasjonen kunne ikke fullføres under kontosynkroniseringen. Du kan enten la filen(e) være som de er og fjerne lenken til %3$s, eller flytte filen(e) inn i mappen %1$s og beholde lenken til %4$s.\n\nNedenfor vises de lokale filen(e) og de fjernlagrede filen(e) i %5$s som de var lenket til.</string>
+  <string name="sync_current_folder_was_removed">Mappen %1$s finnes ikke lengere</string>
+  <string name="foreign_files_move">Flytt alle</string>
+  <string name="foreign_files_success">Alle filer ble flyttet</string>
+  <string name="foreign_files_fail">Noen filer kunne ikke fjernes</string>
+  <string name="foreign_files_local_text">Lokal: %1$s</string>
+  <string name="foreign_files_remote_text">Ekstern: %1$s</string>
+  <string name="upload_query_move_foreign_files">Det er ikke nok plass til å kopiere de valgte filene til %1$s mappe. Vil du flytte dem i stedet?</string>
   <string name="pincode_enter_pin_code">Vennligst tast inn din App-PIN</string>
+  <string name="pincode_configure_your_pin">Skriv inn din PIN kode</string>
+  <string name="pincode_configure_your_pin_explanation">PIN koden vil bli ettersourt hver gang appen starter</string>
+  <string name="pincode_reenter_your_pincode">Vennligst tast inn din PIN kode på nytt</string>
+  <string name="pincode_remove_your_pincode">Fjern din PIN kode</string>
+  <string name="pincode_mismatch">PIN kodene du tastet er ulike</string>
+  <string name="pincode_wrong">Feil PIN kode</string>
+  <string name="pincode_removed">PIN kode fjernet</string>
+  <string name="pincode_stored">PIN kode lagret</string>
+  <string name="media_notif_ticker">%1$s musikkspiller</string>
+  <string name="media_state_playing">%1$s (spiller)</string>
+  <string name="media_state_loading">%1$s (laster)</string>
+  <string name="media_event_done">%1$s avspilling avsluttet</string>
+  <string name="media_err_nothing_to_play">Ingen mediafil funnet</string>
+  <string name="media_err_no_account">Ingen konto angitt</string>
+  <string name="media_err_not_in_owncloud">Filen er ikke i en gyldig konto</string>
+  <string name="media_err_unsupported">Mediakodek er ikke støttet</string>
+  <string name="media_err_io">Mediafilen kunne ikke leses</string>
+  <string name="media_err_malformed">Mediafilen er ikke riktig kodet</string>
+  <string name="media_err_timeout">Tidsavbrudd under avspillingsforsøk</string>
+  <string name="media_err_invalid_progressive_playback">Mediafilen kan ikke strømmes</string>
+  <string name="media_err_unknown">Mediafilen kan ikke spilles med standard mediaspiller</string>
+  <string name="media_err_security_ex">Sikkerhetsfeil under avspilling av %1$s</string>
+  <string name="media_err_io_ex">Inputfeil under avspilling av %1$s</string>
+  <string name="media_err_unexpected">Uforventet feil under avspilling av %1$s</string>
+  <string name="media_rewind_description">Spol tilbake</string>
+  <string name="media_play_pause_description">Spill eller pause</string>
+  <string name="media_forward_description">Spol fremover</string>
   <string name="auth_trying_to_login">Prøver å logge inn...</string>
   <string name="auth_no_net_conn_title">Ingen nettverkstilkobling</string>
   <string name="auth_nossl_plain_ok_title">Sikker tilkobling ikke tilgjengelig.</string>
   <string name="auth_connection_established">Tilkobling opprettet</string>
   <string name="auth_testing_connection">Tester tilgang...</string>
+  <string name="auth_not_configured_title">Feil i server konfigurasjon</string>
+  <string name="auth_account_not_new">En konto for samme bruker og server finnes allerede på enheten</string>
+  <string name="auth_account_not_the_same">Den innskrevne brukeren matcher ikke brukeren av denne kontoen</string>
   <string name="auth_unknown_error_title">Ukjent feil oppstod!</string>
   <string name="auth_unknown_host_title">Fant ikke tjener</string>
+  <string name="auth_incorrect_path_title">Finner ikke server instans</string>
   <string name="auth_timeout_title">Serveren brukte for lang tid på å svare</string>
   <string name="auth_incorrect_address_title">Feil formatert URL</string>
   <string name="auth_ssl_general_error_title">Oppstart av SSL feilet</string>
+  <string name="auth_ssl_unverified_server_title">Kunne ikke verifisere SSL-serverens identitet</string>
+  <string name="auth_bad_oc_version_title">Ukjent server versjon</string>
   <string name="auth_wrong_connection_title">Klarte ikke å opprette tilkobling</string>
   <string name="auth_secure_connection">Sikker tilkobling opprettet</string>
+  <string name="auth_unauthorized">Feil brukernavn eller passord</string>
+  <string name="auth_oauth_error">Mislykket autorisasjon</string>
+  <string name="auth_oauth_error_access_denied">Tilgang nektet av autorisasjonsserver</string>
+  <string name="auth_wtf_reenter_URL">Uforventet tilstand; vennligst skriv inn serveradressen en gang til</string>
+  <string name="auth_expired_oauth_token_toast">Autorisasjonen din har gått ut. Vennligt autoriser igjen</string>
+  <string name="auth_expired_basic_auth_toast">Vennligst skriv inn gjeldende passord</string>
+  <string name="auth_expired_saml_sso_token_toast">Sesjonen din har gått ut. Vennligst koble til igjen</string>
+  <string name="auth_connecting_auth_server">Kobler til autorisasjonsserver...</string>
+  <string name="auth_unsupported_auth_method">Serveren støtter ikke denne autorisasjonsmetoden</string>
+  <string name="auth_unsupported_multiaccount">%1$s støtter ikke flere kontoer</string>
   <string name="fd_keep_in_sync">Hold filen oppdatert</string>
   <string name="common_rename">Endre navn</string>
   <string name="common_remove">Fjern</string>
   <string name="confirmation_remove_alert">Er du sikker på at du vil fjerne %1$s ?</string>
+  <string name="confirmation_remove_folder_alert">Vil du virkelig fjerne %1$s og dens innhold?</string>
   <string name="confirmation_remove_local">Kun lokalt</string>
+  <string name="confirmation_remove_folder_local">Kun lokalt innhold</string>
   <string name="confirmation_remove_remote">Fjern fra server</string>
+  <string name="confirmation_remove_remote_and_local">Ekstern og lokal</string>
+  <string name="remove_success_msg">Fjerning var vellykket</string>
+  <string name="remove_fail_msg">Fjerning mislyktes</string>
+  <string name="rename_dialog_title">Skriv inn et nytt navn</string>
+  <string name="rename_local_fail_msg">Lokal kopi kunne ikke endre navn; prøv et annet navn</string>
   <string name="rename_server_fail_msg">Klarte ikke å endre navn</string>
+  <string name="sync_file_fail_msg">Eksterne filer kunne ikke sjekkes</string>
+  <string name="sync_file_nothing_to_do_msg">filinnhold er allerede synkronisert</string>
   <string name="create_dir_fail_msg">Mappe kunne ikke opprettes</string>
+  <string name="filename_forbidden_characters">Forbudte tegn: / \\ &lt; &gt; : \" | ? *</string>
   <string name="wait_a_moment">Vent et øyeblikk</string>
+  <string name="filedisplay_unexpected_bad_get_content">Uforventet problem; vennligst velg filen fra en annen applikasjon</string>
   <string name="filedisplay_no_file_selected">Ingen fil ble valgt</string>
+  <string name="activity_chooser_title">Send lenke til ...</string>
+  <string name="oauth_check_onoff">Logg inn med oAuth2</string>
+  <string name="oauth_login_connection">Kobler til oAuth2 server...</string>
   <string name="ssl_validator_header">Identiteten til siden kunne ikke verifiseres</string>
   <string name="ssl_validator_reason_cert_not_trusted">- Serverens sertifikat er ikke til å stole på</string>
   <string name="ssl_validator_reason_cert_expired">- Serverens sertifikat er utløpt</string>
+  <string name="ssl_validator_reason_cert_not_yet_valid">- Server-sertifikatets gyldige datoer er i fremtiden</string>
+  <string name="ssl_validator_reason_hostname_not_verified">- Nettadressen samsvarer ikke med vertsnavnet i sertifikatet</string>
+  <string name="ssl_validator_question">Vil du stole på dette sertifikatet likevel?</string>
+  <string name="ssl_validator_not_saved">Sertifikatet kunne ikke lagres</string>
   <string name="ssl_validator_btn_details_see">Detaljer</string>
   <string name="ssl_validator_btn_details_hide">Skjul</string>
+  <string name="ssl_validator_label_subject">Utstedt til:</string>
+  <string name="ssl_validator_label_issuer">Utstedt av:</string>
+  <string name="ssl_validator_label_CN">Vanlig navn:</string>
+  <string name="ssl_validator_label_O">Organisasjon:</string>
+  <string name="ssl_validator_label_OU">Organisasjonsenhet:</string>
   <string name="ssl_validator_label_C">Land:</string>
+  <string name="ssl_validator_label_ST">Stat:</string>
+  <string name="ssl_validator_label_L">Sted:</string>
+  <string name="ssl_validator_label_validity">Gyldighet:</string>
   <string name="ssl_validator_label_validity_from">Fra:</string>
   <string name="ssl_validator_label_validity_to">Til:</string>
   <string name="ssl_validator_label_signature">Signatur:</string>
+  <string name="ssl_validator_label_signature_algorithm">Algoritme:</string>
+  <string name="placeholder_sentence">Dette er en plassholder</string>
+  <string name="placeholder_filename">placeholder.txt</string>
+  <string name="placeholder_filetype">PNG bilde</string>
+  <string name="placeholder_filesize">389 KB</string>
+  <string name="placeholder_timestamp">18.05.2012 12:23</string>
+  <string name="placeholder_media_time">12:23:45</string>
+  <string name="instant_upload_on_wifi">Kun last opp bilder via WiFi</string>
+  <string name="instant_upload_path">/Direkteopplasting</string>
+  <string name="conflict_title">Oppdateringskonflikt</string>
+  <string name="conflict_message">Ekstern fil %s er ikke synkronisert med lokal fil. Hvis du fortsetter vil det erstatte innhold på serveren.</string>
   <string name="conflict_keep_both">Behold begge</string>
+  <string name="conflict_overwrite">Overskriv</string>
+  <string name="conflict_dont_upload">Ikke last opp</string>
+  <string name="preview_image_description">Bildeforhåndsvisning</string>
+  <string name="preview_image_error_unknown_format">Dette bildet kan ikke vises</string>
+  <string name="error__upload__local_file_not_copied">%1$s kunne ikke kopieres til %2$s lokale mapper</string>
+  <string name="actionbar_failed_instant_upload">Misslyktes direkteopplasting</string>
+  <string name="failed_upload_headline_text">Mislykket direkteopplastinger</string>
+  <string name="failed_upload_headline_hint">Oppsumering av alle mislykkede direkteopplastinger</string>
+  <string name="failed_upload_all_cb">velg alle</string>
+  <string name="failed_upload_headline_retryall_btn">forsøk alle valgte på nytt</string>
+  <string name="failed_upload_headline_delete_all_btn">slett alle valgte fra opplastingskø</string>
+  <string name="failed_upload_retry_text">forsøk å laste opp bildet på nytt:</string>
+  <string name="failed_upload_load_more_images">Last flere bilder</string>
+  <string name="failed_upload_retry_do_nothing_text">ikke gjør noe når du ikke er online for direkteopplasting</string>
+  <string name="failed_upload_failure_text">Feilmelding:</string>
+  <string name="failed_upload_quota_exceeded_text">Vennligst sjekk serverkonfigurasjon, kanskje kvoten din er brukt opp.</string>
+  <string name="share_link_no_support_share_api">Beklager, deling er ikke aktivert på serveren din. Vennligst kontrakt administratoren.</string>
+  <string name="share_link_file_no_exist">Klarte ikke å dele denne filen eller mappen. Sjekk at den eksisterer.</string>
+  <string name="share_link_file_error">Det skjedde en feil under deling av denne filen eller mappen</string>
+  <string name="unshare_link_file_no_exist">Klarte ikke å avslutte delingen av denne filen eller mappen. Den eksisterer ikke.</string>
+  <string name="unshare_link_file_error">En feil oppstod ved avslutting av delingen av denne filen eller mappen</string>
+  <string name="activity_chooser_send_file_title">Send</string>
+  <string name="copy_link">Kopier lenke</string>
+  <string name="clipboard_text_copied">Kopiert til utklippstavlen</string>
 </resources>
index f60574b..46d8edf 100644 (file)
@@ -10,6 +10,7 @@
   <string name="actionbar_mkdir">Creëer map</string>
   <string name="actionbar_settings">Instellingen</string>
   <string name="actionbar_see_details">Details</string>
+  <string name="actionbar_send_file">Versturen</string>
   <string name="prefs_category_general">Algemeen</string>
   <string name="prefs_category_more">Meer</string>
   <string name="prefs_accounts">Accounts</string>
@@ -55,6 +56,8 @@
   <string name="filedetails_download">Download</string>
   <string name="filedetails_sync_file">Bestand verversen</string>
   <string name="filedetails_renamed_in_upload_msg">Bestand was hernoemt naar %1$s tijdens het uploaden</string>
+  <string name="action_share_file">Deel link</string>
+  <string name="action_unshare_file">Link niet meer delen</string>
   <string name="common_yes">Ja</string>
   <string name="common_no">Nee</string>
   <string name="common_ok">OK</string>
@@ -94,7 +97,7 @@
   <string name="sync_fail_in_favourites_content">Inhoud van %1$d bestanden kon niet worden gesynchroniseerd (%2$d conflicten)</string>
   <string name="sync_foreign_files_forgotten_ticker">Een paar lokale bestanden werden vergeten</string>
   <string name="sync_foreign_files_forgotten_content">%1$d bestanden uit de %2$s directory konden niet worden gekopieerd naar</string>
-  <string name="sync_foreign_files_forgotten_explanation">Vanaf versie 1.3.16 worden bestanden die geüpload zijn vanaf dit apparaat gekopieerd naar de lokale %1$s map om gegevensverlies te voorkomen wanneer een enkel bestand wordt gesynchroniseerd met meerdere accounts.\n\nDoor deze wijziging zijn alle bestanden die met een voorgaande versie van deze app zijn geüpload gekopieërd naar de %2$s map. Echter, door een fout kon deze bewerking niet volledig uitgevoerd worden tijdens het synchroniseren van het account. U kunt het bestand / de bestanden laten zoals ze zijn en de link naar %3$s verwijderen, of het bestand / de bestanden verplaatsen naar de %1$s map en de links naar %4$s behouden.\n\nHieronder staan de locale bestanden, en de externe bestanden in %5$s waarnaar ze doorverwezen.</string>
+  <string name="sync_foreign_files_forgotten_explanation">Vanaf versie 1.3.16, worden bestanden die vanaf dit apparaat worden ge-uploaded ook gekopieerd naar de lokale %1$s map om gegevensverlies te voorkomen als een enkel bestand wordt gesynchroniseerd met meerdere accounts.\n\nDoor deze aanpassing werden alle bestanden die met een eerdere versie zijn ge-uploaded gekopieerd naar de %2$s map. Maar een fout voorkwam het succesvol afronden van deze actie tijdens het synchroniseren. U kunt de/het bestand(en) laten staan zoals ze nu zijn en de link naar %3$s verwijderen, of u kunt de/het bestand(en) verplaatsen naar de %1$s map en de link naar %4$s laten staan.\n\nHieronder staan de/het lokale bestand(en) en de/het externe bestand(en) in %5$s waar ze naar verwezen.</string>
   <string name="sync_current_folder_was_removed">Map %1$s bestaat niet meer</string>
   <string name="foreign_files_move">Alle verplaatsen</string>
   <string name="foreign_files_success">Alle bestanden zijn verplaatst</string>
   <string name="auth_connecting_auth_server">Verbinden met authenticatieserver...</string>
   <string name="auth_unsupported_auth_method">De server ondersteunt deze authenticatiemethode niet</string>
   <string name="auth_unsupported_multiaccount">%1$s ondersteunt het gebruik van meerdere accounts niet</string>
+  <string name="auth_fail_get_user_name">Uw server geeft geen geldig user id terug, neem contact op met uw beheerder</string>
   <string name="fd_keep_in_sync">Houd bestand actueel</string>
   <string name="common_rename">Hernoemen</string>
   <string name="common_remove">Verwijderen</string>
   <string name="wait_a_moment">Even geduld</string>
   <string name="filedisplay_unexpected_bad_get_content">Onverwacht probleem; probeer een andere app om het bestand te selecteren</string>
   <string name="filedisplay_no_file_selected">Er werd geen bestand geselecteerd</string>
+  <string name="activity_chooser_title">Verstuur link naar ...</string>
   <string name="oauth_check_onoff">Inloggen met oAuth2</string>
   <string name="oauth_login_connection">Verbinden met oAuth2-server.</string>
   <string name="ssl_validator_header">De identiteit van de site kan niet worden gecontroleerd</string>
   <string name="failed_upload_retry_do_nothing_text">doe niks, u bent niet online voor directe upload</string>
   <string name="failed_upload_failure_text">Mislukkings Bericht:</string>
   <string name="failed_upload_quota_exceeded_text">Controleer uw server instellingen, misschien is uw quota overschreden.</string>
+  <string name="share_link_no_support_share_api">Sorry, delen is niet mogelijk op uw server. Neem contact op met uw beheerder.</string>
+  <string name="share_link_file_no_exist">Kan dit bestand of deze map niet delen. Controleer of dit object wel bestaat.</string>
+  <string name="share_link_file_error">Er trad een fout op bij uw poging dit bestand of deze map te delen</string>
+  <string name="unshare_link_file_no_exist">Kan delen van dit bestand of deze map niet beëindigen. Het object bestaat niet.</string>
+  <string name="unshare_link_file_error">Er trad een fout op bij uw poging het delen van dit bestand of deze map te beëindigen</string>
+  <string name="activity_chooser_send_file_title">Versturen</string>
+  <string name="copy_link">Link kopiëren</string>
+  <string name="clipboard_text_copied">Gekopieerd naar het klembord</string>
 </resources>
index 0d76c8e..5715699 100644 (file)
@@ -5,6 +5,7 @@
   <string name="actionbar_upload_files">Filer</string>
   <string name="actionbar_mkdir">Opprett mappe</string>
   <string name="actionbar_settings">Innstillingar</string>
+  <string name="actionbar_send_file">Send</string>
   <string name="prefs_category_general">Generelt</string>
   <string name="prefs_category_more">Meir</string>
   <string name="prefs_accounts">Kontoar</string>
@@ -82,4 +83,5 @@
   <string name="ssl_validator_question">Vil du stola på dette sertifikatet uansett?</string>
   <string name="ssl_validator_not_saved">Klarte ikkje å lagra sertifikatet</string>
   <string name="instant_upload_on_wifi">Berre last opp bilete over WiFi</string>
+  <string name="activity_chooser_send_file_title">Send</string>
 </resources>
index d3a2836..35df718 100644 (file)
@@ -10,6 +10,7 @@
   <string name="actionbar_mkdir">ਡਾਇਰੈਕਟਰੀ ਬਣਾਓ</string>
   <string name="actionbar_settings">ਸੈਟਿੰਗ</string>
   <string name="actionbar_see_details">ਵੇਰਵ</string>
+  <string name="actionbar_send_file">ਭੇਜੋ</string>
   <string name="prefs_category_general">ਆਮ</string>
   <string name="prefs_accounts">ਅਕਾਊਂਟ</string>
   <string name="prefs_log_title">ਲਾਗ ਰੱਖਣਾ ਚਾਲੂ</string>
   <string name="conflict_dont_upload">ਅੱਪਲੋਡ ਨਾ ਕਰੋ</string>
   <string name="preview_image_description">ਚਿੱਤਰ ਝਲਕ</string>
   <string name="failed_upload_all_cb">ਸਭ ਚੁਣੋ</string>
+  <string name="activity_chooser_send_file_title">ਭੇਜੋ</string>
 </resources>
index de65dbf..35ef100 100644 (file)
@@ -10,6 +10,7 @@
   <string name="actionbar_mkdir">Nowy katalog</string>
   <string name="actionbar_settings">Ustawienia</string>
   <string name="actionbar_see_details">Szczegóły</string>
+  <string name="actionbar_send_file">Wyślij</string>
   <string name="prefs_category_general">Ogólne</string>
   <string name="prefs_category_more">Więcej</string>
   <string name="prefs_accounts">Konta</string>
@@ -55,6 +56,8 @@
   <string name="filedetails_download">Pobierz</string>
   <string name="filedetails_sync_file">Odśwież plik</string>
   <string name="filedetails_renamed_in_upload_msg">Podczas wysyłania nazwa pliku została zmieniona na %1$s</string>
+  <string name="action_share_file">Udostępnij link</string>
+  <string name="action_unshare_file">Anuluj udostępnianie</string>
   <string name="common_yes">Tak</string>
   <string name="common_no">Nie</string>
   <string name="common_ok">OK</string>
@@ -94,7 +97,7 @@
   <string name="sync_fail_in_favourites_content">Zawartość %1$d plików nie może zostać synchronizowana (%2$d konfliktów)</string>
   <string name="sync_foreign_files_forgotten_ticker">Niektóre lokalne pliki zostały zgubione.</string>
   <string name="sync_foreign_files_forgotten_content">%1$d plików z %2$s katalogu nie może zostać skopiowana do niego</string>
-  <string name="sync_foreign_files_forgotten_explanation">\"W wersji 1.3.16, pliki załadowane z tego urządzenia są skopiowane do lokalnego folderu %1$s aby zapobiec utracie danych, gdy pojedynczy plik jest synchronizowany z kilku kont.⏎ ⏎ Ze zwględu na tą zmianę, wszystkie pliki załadowane w poprzedniej wersji tej aplikacji były kopiowane do folderu %2$s. Jednakże błąd podczas synchronizacji spowodował przerwanie procesu. Możesz zostawić plik(i) i usunąć link do %3$s, lub przenieść plik(i) to katalogu %1$s i zostawić link do %4$s.⏎ ⏎ Lista poniżej zawiera lokalne i zdalne pliki, które są podlinkowane do %5$s.</string>
+  <string name="sync_foreign_files_forgotten_explanation">Od wersji 1.3.16, pliki pobrane z tego urządzenia są kopiowane do folderu lokalnego %1$s aby zapobiec utracie danych, gdy pojedynczy plik jest zsynchronizowany z wielu kont.\n\nZ powodu tej zmiany, wszystkie pliki przesłane w poprzednich wersjach tej aplikacji zostały skopiowane do folderu %2$s. Jednak błąd uniemożliwił realizację tego działania podczas synchronizacji konta. Możesz albo zostawić plik(i), jak teraz i usunąć link do %3$s lub przenieść plik(i) do %1$s katalog i zachować link do %4$s.\n\nPoniżej wymienione są lokalne plik(i), i plik(i) zdalne w %5$s które były powiązane.</string>
   <string name="sync_current_folder_was_removed">Folder  %1$s nie istnieje.</string>
   <string name="foreign_files_move">Przenieś wszystko</string>
   <string name="foreign_files_success">Wszystkie pliki zostały przeniesione</string>
   <string name="wait_a_moment">Poczekaj chwilę</string>
   <string name="filedisplay_unexpected_bad_get_content">Nieoczekiwany problem; spróbuj wybrać plik z innej aplikacji</string>
   <string name="filedisplay_no_file_selected">Nie wybrano żadnych plików</string>
+  <string name="activity_chooser_title">Wyślij link do ...</string>
   <string name="oauth_check_onoff">Loguj przez oAuth2</string>
   <string name="oauth_login_connection">Łączenie z serwerem oAuth2...</string>
   <string name="ssl_validator_header">Nie można zweryfikować tożsamości strony</string>
   <string name="failed_upload_retry_do_nothing_text">nic nie rób, ponieważ nie jesteś online, nie możesz przesyłać plików</string>
   <string name="failed_upload_failure_text">Komunikat błędu:</string>
   <string name="failed_upload_quota_exceeded_text">Proszę sprawdź ustawienia serwera, możliwe że przekroczyłes limit wielkości pliku</string>
+  <string name="share_link_no_support_share_api">Przepraszamy, udostępnianie jest wyłączone na twoim serwerze. Skontaktuj się z twoim administratorem.</string>
+  <string name="share_link_file_no_exist">Brak możliwości udostępnienia tego pliku lub folderu. Upewnij się, że istnieje.</string>
+  <string name="share_link_file_error">Wystąpił błąd podczas udostępniania tego pliku lub folderu.</string>
+  <string name="unshare_link_file_no_exist">Nie można anulować udostępniania tego pliku lub folderu. Jeśli nie istnieje.</string>
+  <string name="unshare_link_file_error">Wystąpił błąd podczas anulowania udostępniania tego pliku lub folderu.</string>
+  <string name="activity_chooser_send_file_title">Wyślij</string>
+  <string name="copy_link">Skopiuj link</string>
+  <string name="clipboard_text_copied">Skopiuj do schowka</string>
 </resources>
index 072c19d..a84b798 100644 (file)
@@ -10,6 +10,7 @@
   <string name="actionbar_mkdir">Criar pasta</string>
   <string name="actionbar_settings">Ajustes</string>
   <string name="actionbar_see_details">Detalhes</string>
+  <string name="actionbar_send_file">Enviar</string>
   <string name="prefs_category_general">Geral</string>
   <string name="prefs_category_more">Mais</string>
   <string name="prefs_accounts">Contas</string>
@@ -55,6 +56,8 @@
   <string name="filedetails_download">Download</string>
   <string name="filedetails_sync_file">Atualizar arquivo</string>
   <string name="filedetails_renamed_in_upload_msg">Arquivo foi renomeado para %1$s durante o upload</string>
+  <string name="action_share_file">Compartilher link</string>
+  <string name="action_unshare_file">Descompartilhar o link</string>
   <string name="common_yes">Sim</string>
   <string name="common_no">Não</string>
   <string name="common_ok">OK</string>
@@ -94,7 +97,7 @@
   <string name="sync_fail_in_favourites_content">O conteúdo de %1$d arquivos não puderam ser sincronizados (%2$d conflitos)</string>
   <string name="sync_foreign_files_forgotten_ticker">Alguns arquivos locais foram esquecidos</string>
   <string name="sync_foreign_files_forgotten_content">%1$d arquivos da pasta %2$s não foram copiados</string>
-  <string name="sync_foreign_files_forgotten_explanation">A partir da versão 1.3.16, os arquivos enviados a partir deste dispositivo são copiados para a pasta local %1$s para evitar a perda de dados quando um único arquivo é sincronizado com várias contas. \n\nDevido a essa mudança, todos os arquivos carregados em versões anteriores deste aplicativo foram copiados para a pasta %2$s. No entanto, um erro evita a conclusão desta operação durante a conta de sincronização. Você pode tanto deixar os arquivos como é e remover o link para %3$s, ou mover o arquivos para o diretório %1$s e manter o link para %4$s. \n\nListados abaixo estão os arquivos locais, e os arquivos remotos em %5$s que estavam vinculados.</string>
+  <string name="sync_foreign_files_forgotten_explanation">A partir da versão 1.3.16, os arquivos enviados a partir deste dispositivo são copiados para a pasta local %1$s para evitar a perda de dados quando um único arquivo é sincronizado com várias contas.  \n \nDevido a essa mudança, todos os arquivos carregados em versões anteriores deste aplicativo foram copiados para a pasta de %2$s . No entanto, um erro impediu a conclusão desta operação durante a sincronização da conta. Você pode tanto deixar o arquivo(s) como é e remover o link para %3$s , ou mover o arquivo(s) para o diretório %1$s e manter o link para %4$s .  \n \nListados abaixo estão o arquivo local(is), e o arquivo remoto(s) em %5$s que estavam vinculados.</string>
   <string name="sync_current_folder_was_removed">Pasta %1s não existe mais</string>
   <string name="foreign_files_move">Mover todos</string>
   <string name="foreign_files_success">Todos os arquivos foram movidos</string>
   <string name="auth_connecting_auth_server">Conectando ao servidor de autenticação ...</string>
   <string name="auth_unsupported_auth_method">O servidor não suporta este método de autenticação</string>
   <string name="auth_unsupported_multiaccount">%1$s não suporta múltiplas contas</string>
+  <string name="auth_fail_get_user_name">Seu servidor não está retornando uma ID de usuário correta, por favor entre em contato com o seu administrador</string>
   <string name="fd_keep_in_sync">Manter arquivo atualizado</string>
   <string name="common_rename">Renomear</string>
   <string name="common_remove">Remover</string>
   <string name="wait_a_moment">Aguarde um momento</string>
   <string name="filedisplay_unexpected_bad_get_content">Problema inesperado; por favor, tente selecionar o arquivo com outro app</string>
   <string name="filedisplay_no_file_selected">Nenhum arquivo foi selecionado</string>
+  <string name="activity_chooser_title">Enviar o link para</string>
   <string name="oauth_check_onoff">Login com oAuth2</string>
   <string name="oauth_login_connection">Conectando-se a oAuth2 servidor ...</string>
   <string name="ssl_validator_header">A identidade do site não pode ser verificada</string>
   <string name="failed_upload_retry_do_nothing_text">não fazer nada voce não está conectado para envio instantâneo </string>
   <string name="failed_upload_failure_text">Mensagem de Falha:</string>
   <string name="failed_upload_quota_exceeded_text">Por favor verifique a configuração do servidor, talvez a sua cota esteja vencida.</string>
+  <string name="share_link_no_support_share_api">Desculpe, compartilhamento não está habilitado para seu servidor. Por favor faça contato com o seu administrador.</string>
+  <string name="share_link_file_no_exist">Incapaz de compartilhar esse arquivo ou pasta. Por favor, certifique-se que existe</string>
+  <string name="share_link_file_error">Ocorreu um erro durante a tentativa de compartilhar esse arquivo ou pasta</string>
+  <string name="unshare_link_file_no_exist">Incapaz de descompartilhar este arquivo ou pasta. Ela não existe.</string>
+  <string name="unshare_link_file_error">Ocorreu um erro ao tentar descompartilhar este arquivo ou pasta</string>
+  <string name="activity_chooser_send_file_title">Enviar</string>
+  <string name="copy_link">Copiar o link</string>
+  <string name="clipboard_text_copied">Copiado para área de transferência</string>
 </resources>
index 8cc9985..c79abe5 100644 (file)
@@ -10,6 +10,7 @@
   <string name="actionbar_mkdir">Criar pasta</string>
   <string name="actionbar_settings">Definições</string>
   <string name="actionbar_see_details">Detalhes</string>
+  <string name="actionbar_send_file">Enviar</string>
   <string name="prefs_category_general">Geral</string>
   <string name="prefs_category_more">Mais</string>
   <string name="prefs_accounts">Contas</string>
@@ -55,6 +56,8 @@
   <string name="filedetails_download">Descarregar</string>
   <string name="filedetails_sync_file">Atualizar ficheiro</string>
   <string name="filedetails_renamed_in_upload_msg">O nome do ficheiro foi alterado para %1$s durante o envio.</string>
+  <string name="action_share_file">Partilhar o link</string>
+  <string name="action_unshare_file">Deixar de partilhar a ligação</string>
   <string name="common_yes">Sim</string>
   <string name="common_no">Não</string>
   <string name="common_ok">OK</string>
@@ -94,7 +97,7 @@
   <string name="sync_fail_in_favourites_content">Não foi possível sincronizar  o conteúdo de %1$d ficheiros  (%2$d conflictos)</string>
   <string name="sync_foreign_files_forgotten_ticker">Alguns ficheiros locais ficaram esquecidos</string>
   <string name="sync_foreign_files_forgotten_content">%1$d ficheiros da directoria %2$s não foram copiados</string>
-  <string name="sync_foreign_files_forgotten_explanation">Com a versão 1.3.16, os ficheiros que foram enviados deste dispositivo foram copiados para a pasta local %1$s para prevenir perda de dados quando um ficheiro está partilhado com várias contas.\nDevido a esta alteração, todos os ficheiros e as suas versões foram copiados para a pasta %2$s. Contudo, um erro não deixou concluír este processo durante a sincronização da conta. Pode deixar o ficheiro(s) como está(ão) e remover o link para %3$s, ou mover o(s) ficheiro(s)  para a pasta %1$s e guardar o link para %4$s.\n\nEm baixo está(ão) listados o(s) ficheiro(s) locais e remotos em %5$s que foram ligados.</string>
+  <string name="sync_foreign_files_forgotten_explanation">Com a versão 1.3.16, os ficheiros que foram enviados deste dispositivo foram copiados para a pasta local %1$s para prevenir perda de dados quando um ficheiro está partilhado com várias contas.\nDevido a esta alteração, todos os ficheiros e as suas versões foram copiados para a pasta %2$s. Contudo, um erro não deixou concluír este processo durante a sincronização da conta. Pode deixar o(s) ficheiro(s) como está(ão) e remover o link para %3$s, ou mover o(s) ficheiro(s)  para a pasta %1$s e guardar o link para %4$s.\n\nEm baixo está(ão) listado(s) o(s) ficheiro(s) local(is) e remoto(s) em %5$s que foram ligados.</string>
   <string name="sync_current_folder_was_removed">A pasta %1$s já não existe</string>
   <string name="foreign_files_move">Mover Todos</string>
   <string name="foreign_files_success">Todos os ficheiros foram movidos</string>
   <string name="wait_a_moment">Aguarde um momento</string>
   <string name="filedisplay_unexpected_bad_get_content">Erro inesperado. Por favor tente outra aplicação para seleccionar o ficheiro.</string>
   <string name="filedisplay_no_file_selected">Não selecionou nenhum ficheiro</string>
+  <string name="activity_chooser_title">Enviar a ligação para ...</string>
   <string name="oauth_check_onoff">Autenticar-se com oAuth2</string>
   <string name="oauth_login_connection">A ligar ao servidor oAuth2</string>
   <string name="ssl_validator_header">Não foi possível verificar a identidade do site.</string>
   <string name="failed_upload_retry_do_nothing_text">não fazer nada, nao está online para o Upload-Instantâneo</string>
   <string name="failed_upload_failure_text">Mensagem de erro:</string>
   <string name="failed_upload_quota_exceeded_text">Por favor verifique a configuração do servidor, talvez tenha excedido a sua quota</string>
+  <string name="share_link_no_support_share_api">Desculpe, a partilha não está activada no servidor. Por favor contacte o administrador.</string>
+  <string name="share_link_file_no_exist">Não é possível partilhar este ficheiro ou pasta. Por favor, verifique se existe</string>
+  <string name="share_link_file_error">Ocorreu um erro enquanto tentava partilhar este ficheiro ou pasta</string>
+  <string name="unshare_link_file_no_exist">Não é possível retirar a partilha deste ficheiro ou pasta. Não existe.</string>
+  <string name="unshare_link_file_error">Ocorreu um erro enquanto retirava a partilha deste ficheiro ou pasta</string>
+  <string name="activity_chooser_send_file_title">Enviar</string>
+  <string name="copy_link">Copiar ligação</string>
+  <string name="clipboard_text_copied">Copiado para a área de transferência</string>
 </resources>
index 0569277..4c2b2b9 100644 (file)
@@ -5,6 +5,7 @@
   <string name="actionbar_upload_files">Fișiere</string>
   <string name="actionbar_mkdir">Creare director</string>
   <string name="actionbar_settings">Setări</string>
+  <string name="actionbar_send_file">Expediază</string>
   <string name="prefs_category_general">General</string>
   <string name="prefs_category_more">Mai mult</string>
   <string name="prefs_accounts">Conturi</string>
@@ -33,6 +34,7 @@
   <string name="common_cancel">Anulare</string>
   <string name="common_save_exit">Salvare &amp; Ieșire</string>
   <string name="common_error">Eroare</string>
+  <string name="common_error_unknown">Eroare necunoscută</string>
   <string name="about_title">Despre</string>
   <string name="change_password">Schimbă parola</string>
   <string name="delete_account">Șterge cont</string>
@@ -79,4 +81,5 @@
   <string name="create_dir_fail_msg">Directorul nu a putut fi creat</string>
   <string name="wait_a_moment">Așteaptă un moment</string>
   <string name="filedisplay_no_file_selected">Nu a fost selectat nici un fișier</string>
+  <string name="activity_chooser_send_file_title">Expediază</string>
 </resources>
index ed9a7b8..239d73f 100644 (file)
@@ -1,52 +1,53 @@
 <?xml version='1.0' encoding='UTF-8'?>
 <resources>
-  <string name="about_android">%1$s Ð\9fÑ\80иложение Ð\90ндÑ\80оид</string>
+  <string name="about_android">%1$s Ð\9fÑ\80иложение Ð´Ð»Ñ\8f Ð\90ндÑ\80оида</string>
   <string name="about_version">Версия %1$s</string>
   <string name="actionbar_sync">Обновить учетную запись</string>
-  <string name="actionbar_upload">Ð\97агÑ\80Ñ\83зка</string>
-  <string name="actionbar_upload_from_apps">СодеÑ\80жимое Ð¾Ñ\82 других приложений</string>
+  <string name="actionbar_upload">Ð\97агÑ\80Ñ\83зиÑ\82Ñ\8c</string>
+  <string name="actionbar_upload_from_apps">СодеÑ\80жимое Ð¸Ð· других приложений</string>
   <string name="actionbar_upload_files">Файлы</string>
   <string name="actionbar_open_with">Открыть с помощью</string>
-  <string name="actionbar_mkdir">СоздаÑ\82Ñ\8c Ð´Ð¸Ñ\80екÑ\82оÑ\80иÑ\8e</string>
+  <string name="actionbar_mkdir">СоздаÑ\82Ñ\8c ÐºÐ°Ñ\82алог</string>
   <string name="actionbar_settings">Настройки</string>
-  <string name="actionbar_see_details">Детали</string>
-  <string name="prefs_category_general">Главные</string>
+  <string name="actionbar_see_details">Подробно</string>
+  <string name="actionbar_send_file">Отправить</string>
+  <string name="prefs_category_general">Основные</string>
   <string name="prefs_category_more">Больше</string>
-  <string name="prefs_accounts">Ð\90ккаÑ\83нÑ\82Ñ\8b</string>
-  <string name="prefs_manage_accounts">Управление аккаунтами</string>
+  <string name="prefs_accounts">УÑ\87Ñ\91Ñ\82нÑ\8bе Ð·Ð°Ð¿Ð¸Ñ\81и</string>
+  <string name="prefs_manage_accounts">Управление учётными записями</string>
   <string name="prefs_pincode">App PIN</string>
-  <string name="prefs_pincode_summary">Защитить ваш клиент применение</string>
-  <string name="prefs_instant_upload">Включить моментальную загрузку</string>
-  <string name="prefs_instant_upload_summary">Ð\9cоменÑ\82алÑ\8cно загружать фотографии, полученные с камеры</string>
-  <string name="prefs_log_title">Ð\92клÑ\8eÑ\87иÑ\82Ñ\8c Ð·Ð°Ð¿Ð¸Ñ\81Ñ\8c Ð¶Ñ\83Ñ\80нала</string>
-  <string name="prefs_log_summary">ЭÑ\82о Ð¸Ñ\81полÑ\8cзÑ\83еÑ\82Ñ\81Ñ\8f Ð´Ð»Ñ\8f  Ñ\80егиÑ\81Ñ\82Ñ\80аÑ\86ии Ð¿Ñ\80облем</string>
-  <string name="prefs_log_title_history">Ð\97апиÑ\81Ñ\8bваÑ\82Ñ\8c Ð¸Ñ\81Ñ\82оÑ\80иÑ\8e</string>
-  <string name="prefs_log_summary_history">Ð\97деÑ\81Ñ\8c Ð¿Ð¾ÐºÐ°Ð·Ð°Ð½Ñ\8b Ð¶Ñ\83Ñ\80налÑ\8b</string>
-  <string name="prefs_log_delete_history_button">Удалить историю</string>
+  <string name="prefs_pincode_summary">Защитить ваш клиент</string>
+  <string name="prefs_instant_upload">Включить режим немедленной загрузки</string>
+  <string name="prefs_instant_upload_summary">Ð\9dемедленно загружать фотографии, полученные с камеры</string>
+  <string name="prefs_log_title">Ð\92клÑ\8eÑ\87иÑ\82Ñ\8c Ð¶Ñ\83Ñ\80налиÑ\80ование</string>
+  <string name="prefs_log_summary">Ð\98Ñ\81полÑ\8cзÑ\83еÑ\82Ñ\81Ñ\8f Ð´Ð»Ñ\8f Ñ\80егиÑ\81Ñ\82Ñ\80аÑ\86ии Ð¾Ñ\88ибок</string>
+  <string name="prefs_log_title_history">Ð\96Ñ\83Ñ\80нал</string>
+  <string name="prefs_log_summary_history">Ð\97деÑ\81Ñ\8c Ð¿Ð¾ÐºÐ°Ð·Ð°Ð½Ñ\8b Ð·Ð°Ð¿Ð¸Ñ\81и Ð² Ð¶Ñ\83Ñ\80нал</string>
+  <string name="prefs_log_delete_history_button">Удалить историю записей</string>
   <string name="prefs_help">Помощь</string>
   <string name="prefs_recommend">Рекомендовать другу</string>
   <string name="prefs_feedback">Обратная связь</string>
   <string name="prefs_imprint">Штамп</string>
   <string name="recommend_subject">Попробуйте %1$s на вашем смартфоне!</string>
-  <string name="recommend_text">ХоÑ\87Ñ\83 Ð¿Ñ\80едложиÑ\82Ñ\8c Ð²Ð°Ð¼ Ð¿Ð¾Ð»Ñ\8cзоваÑ\82Ñ\8cÑ\81Ñ\8f %1$s Ð½Ð° Ð²Ð°Ñ\88ем Ñ\81маÑ\80Ñ\82Ñ\84оне!\nÐ\94лÑ\8f Ð·Ð°Ð³Ñ\80Ñ\83зки: %2$s</string>
+  <string name="recommend_text">ХоÑ\87Ñ\83 Ð¿Ñ\80едложиÑ\82Ñ\8c Ð²Ð°Ð¼ Ð¿Ð¾Ð»Ñ\8cзоваÑ\82Ñ\8cÑ\81Ñ\8f %1$s Ð½Ð° Ð²Ð°Ñ\88ем Ñ\81маÑ\80Ñ\82Ñ\84оне!\nСкаÑ\87аÑ\82Ñ\8c: %2$s</string>
   <string name="auth_check_server">Проверить сервер</string>
   <string name="auth_host_url">Адрес сервера https://...</string>
-  <string name="auth_username">Ð\9fолÑ\8cзоваÑ\82елÑ\8c</string>
+  <string name="auth_username">Ð\98мÑ\8f Ð¿Ð¾Ð»Ñ\8cзоваÑ\82елÑ\8f</string>
   <string name="auth_password">Пароль</string>
-  <string name="auth_register">Ð\92пеÑ\80вÑ\8bе с %1$s?</string>
+  <string name="auth_register">Ð\9dезнакомÑ\8b с %1$s?</string>
   <string name="sync_string_files">Файлы</string>
   <string name="setup_btn_connect">Соединить</string>
-  <string name="uploader_btn_upload_text">Ð\97агÑ\80Ñ\83зка</string>
-  <string name="uploader_top_message">Ð\92Ñ\8bбÑ\80аÑ\82Ñ\8c Ð¼ÐµÑ\81Ñ\82о Ð´Ð»Ñ\8f Ð·Ð°Ð³Ñ\80Ñ\83зки:</string>
-  <string name="uploader_wrn_no_account_title">Ð\90ккаÑ\83нÑ\82Ñ\8b Ð½Ðµ Ð½Ð°Ð¹Ð´ÐµÐ½Ñ\8b</string>
-  <string name="uploader_wrn_no_account_text">На вашем устройстве нет аккаунтов %1$s. Настройте сначала аккаунт.</string>
+  <string name="uploader_btn_upload_text">Ð\97агÑ\80Ñ\83зиÑ\82Ñ\8c</string>
+  <string name="uploader_top_message">Ð\92Ñ\8bбÑ\80аÑ\82Ñ\8c ÐºÐ°Ñ\82алог Ð´Ð»Ñ\8f Ð·Ð°Ð³Ñ\80Ñ\83зок:</string>
+  <string name="uploader_wrn_no_account_title">УÑ\87Ñ\91Ñ\82наÑ\8f Ð·Ð°Ð¿Ð¸Ñ\81Ñ\8c Ð½Ðµ Ð½Ð°Ð¹Ð´ÐµÐ½Ð°</string>
+  <string name="uploader_wrn_no_account_text">На вашем устройстве нет учётных записей %1$s. Сначала нужно настроить учётную запись.</string>
   <string name="uploader_wrn_no_account_setup_btn_text">Установка</string>
   <string name="uploader_wrn_no_account_quit_btn_text">Выход</string>
   <string name="uploader_wrn_no_content_title">Нет содержимого для загрузки</string>
-  <string name="uploader_wrn_no_content_text">Ð\9aонÑ\82енÑ\82 Ð½Ðµ Ð¿Ð¾Ð»Ñ\83Ñ\87ен. Нечего загружать.</string>
+  <string name="uploader_wrn_no_content_text">СодеÑ\80жимое Ð½Ðµ Ð¿Ð¾Ð»Ñ\83Ñ\87ено. Нечего загружать.</string>
   <string name="uploader_error_forbidden_content">%1$s не имеет доступа к опубликованным данным</string>
   <string name="uploader_info_uploading">Загрузка</string>
-  <string name="file_list_empty">Ð\92 Ñ\8dÑ\82ой Ð¿Ð°Ð¿Ðºе нет файлов.\nНовые файлы могут быть добавлены с помощью пункта меню \"Загрузить\".</string>
+  <string name="file_list_empty">Ð\92 Ñ\8dÑ\82ом ÐºÐ°Ñ\82алоге нет файлов.\nНовые файлы могут быть добавлены с помощью пункта меню \"Загрузить\".</string>
   <string name="filedetails_select_file">Нажмите на файл для отображения дополнительной информации.</string>
   <string name="filedetails_size">Размер:</string>
   <string name="filedetails_type">Тип:</string>
   <string name="filedetails_download">Скачать</string>
   <string name="filedetails_sync_file">Обновить файл</string>
   <string name="filedetails_renamed_in_upload_msg">Файл был переименован в %1$s во время загрузки</string>
+  <string name="action_share_file">Поделиться ссылкой</string>
+  <string name="action_unshare_file">Удалить ссылку</string>
   <string name="common_yes">Да</string>
   <string name="common_no">Нет</string>
   <string name="common_ok">ОК</string>
   <string name="common_cancel_download">Отменить скачивание</string>
-  <string name="common_cancel_upload">Ð\9eÑ\82мена Ð·Ð°Ð³Ñ\80Ñ\83зки</string>
+  <string name="common_cancel_upload">Ð\9eÑ\82мениÑ\82Ñ\8c Ð·Ð°Ð³Ñ\80Ñ\83зкÑ\83</string>
   <string name="common_cancel">Отмена</string>
   <string name="common_save_exit">Сохранить &amp; Выйти</string>
   <string name="common_error">Ошибка</string>
-  <string name="common_loading">Ð\97агÑ\80Ñ\83жаеÑ\82Ñ\81Ñ\8f...</string>
+  <string name="common_loading">Ð\98дÑ\91Ñ\82 Ð·Ð°Ð³Ñ\80Ñ\83зка...</string>
   <string name="common_error_unknown">Неизвестная ошибка</string>
   <string name="about_title">О программе</string>
   <string name="change_password">Сменить пароль</string>
-  <string name="delete_account">Удалить аккаунт</string>
-  <string name="create_account">Создать аккаунт</string>
+  <string name="delete_account">Удалить учётную запись</string>
+  <string name="create_account">Создать учётную запись</string>
   <string name="upload_chooser_title">Загрузить из...</string>
-  <string name="uploader_info_dirname">Ð\98мÑ\8f Ð´Ð¸Ñ\80екÑ\82оÑ\80ии</string>
+  <string name="uploader_info_dirname">Ð\98мÑ\8f ÐºÐ°Ñ\82алога</string>
   <string name="uploader_upload_in_progress_ticker">Загрузка...</string>
   <string name="uploader_upload_in_progress_content">%1$d%% загрузки %2$s</string>
-  <string name="uploader_upload_succeeded_ticker">Ð\97агÑ\80Ñ\83зка Ð¿Ñ\80оÑ\88ла Ñ\83Ñ\81пеÑ\88но</string>
+  <string name="uploader_upload_succeeded_ticker">Ð\97агÑ\80Ñ\83зка Ð·Ð°Ð²ÐµÑ\80Ñ\88ена</string>
   <string name="uploader_upload_succeeded_content_single">%1$s был успешно загружен</string>
   <string name="uploader_upload_failed_ticker">Ошибка загрузки</string>
   <string name="uploader_upload_failed_content_single">Загрузка %1$s не может быть завершена</string>
   <string name="downloader_download_in_progress_ticker">Скачивание...</string>
   <string name="downloader_download_in_progress_content">%1$d%% скачивания %2$s</string>
-  <string name="downloader_download_succeeded_ticker">СкаÑ\87ивание Ð¿Ñ\80оÑ\88ло Ñ\83Ñ\81пеÑ\88но</string>
+  <string name="downloader_download_succeeded_ticker">СкаÑ\87ивание Ð·Ð°Ð²ÐµÑ\80Ñ\88ено</string>
   <string name="downloader_download_succeeded_content">%1$s успешно скачан</string>
-  <string name="downloader_download_failed_ticker">СкаÑ\87ивание Ð½Ðµ Ñ\83далась</string>
+  <string name="downloader_download_failed_ticker">СкаÑ\87ивание Ð½Ðµ Ñ\83далось</string>
   <string name="downloader_download_failed_content">Скачивание %1$s не может быть завершено</string>
-  <string name="downloader_not_downloaded_yet">Ещё не загружено</string>
-  <string name="common_choose_account">Выберите аккаунт</string>
+  <string name="downloader_not_downloaded_yet">Ещё не скачано</string>
+  <string name="common_choose_account">Выберите учётную запись</string>
   <string name="sync_fail_ticker">Синхронизация прошла неудачно</string>
   <string name="sync_fail_content">Синхронизация %1$s не может быть завершена</string>
   <string name="sync_fail_content_unauthorized">Неверный пароль для %1$s</string>
   <string name="sync_conflicts_in_favourites_ticker">Обнаружены конфликты</string>
-  <string name="sync_conflicts_in_favourites_content">%1$d файлы, которые должны быть синхронизированными не могут синхронизироваться</string>
+  <string name="sync_conflicts_in_favourites_content">%1$d файлы не могут быть синхронизированы</string>
   <string name="sync_fail_in_favourites_ticker">Не удалось синхронизировать файлы</string>
-  <string name="sync_fail_in_favourites_content">СодеÑ\80жание %1$d Ñ\84айла(ов) Ð½Ðµ Ð¼Ð¾Ð¶ÐµÑ\82 Ð±Ñ\8bÑ\82Ñ\8c Ñ\81инÑ\85Ñ\80онизиÑ\80овано (%2$d ÐºÐ¾Ð½Ñ\84ликÑ\82а(ов))</string>
+  <string name="sync_fail_in_favourites_content">СодеÑ\80жимое %1$d Ñ\84айлов Ð½Ðµ Ð¼Ð¾Ð¶ÐµÑ\82 Ð±Ñ\8bÑ\82Ñ\8c Ñ\81инÑ\85Ñ\80онизиÑ\80овано (конÑ\84ликÑ\82ов: %2$d)</string>
   <string name="sync_foreign_files_forgotten_ticker">Несколько локальных файлов были забыты</string>
-  <string name="sync_foreign_files_forgotten_content">%1$d файлы из %2$s папки не могут быть скопированы в</string>
-  <string name="sync_foreign_files_forgotten_explanation">файлы, загруженные с этого устройства, скопированы в локальную папку %1$s для предотвращения потери данных, когда отдельный файл синхронизируется с нескольких учётных записей. По причине этого изменения, все файлы, загруженные в предыдущих версиях этого приложения, были скопированы в папку %2$s. Однако, ошибка помешала завершению этой операции при синхронизации учётной записи. Вы можете либо оставить файлы как есть, или переместить их в папку %1$s и сохранить ссылку в %4$s. \nВ списке указаны локальные файлы, привязанные к файлам на сервере в папке %5$s.</string>
+  <string name="sync_foreign_files_forgotten_content">%1$d файлов из %2$s папок не могут быть скопированы в</string>
   <string name="sync_current_folder_was_removed">Каталог %1$s больше не существует</string>
   <string name="foreign_files_move">Переместить всё</string>
   <string name="foreign_files_success">Все файлы были перемещены</string>
   <string name="foreign_files_fail">Некоторые файлы не могут быть перемещены</string>
   <string name="foreign_files_local_text">Локально: %1$s</string>
   <string name="foreign_files_remote_text">Удаленно: %1$s</string>
-  <string name="upload_query_move_foreign_files">Ð\9eÑ\82Ñ\81Ñ\83Ñ\82Ñ\81Ñ\82вÑ\83еÑ\82 Ð´Ð¾Ñ\81Ñ\82аÑ\82оÑ\87ное ÐºÐ¾Ð»Ð¸Ñ\87еÑ\81Ñ\82во Ð¼ÐµÑ\81Ñ\82а Ð´Ð»Ñ\8f ÐºÐ¾Ð¿Ð¸Ñ\80ованиÑ\8f Ð²Ñ\8bделеннÑ\8bÑ\85 Ñ\84айлов Ð² Ð¿Ð°Ð¿ÐºÑ\83 %1$s. Ð¥Ð¾Ñ\82иÑ\82е Ð»Ð¸ Ð\92Ñ\8b Ð¿ереместить их в другое место?</string>
+  <string name="upload_query_move_foreign_files">Ð\9dедоÑ\81Ñ\82аÑ\82оÑ\87но Ð¼ÐµÑ\81Ñ\82а Ð´Ð»Ñ\8f ÐºÐ¾Ð¿Ð¸Ñ\80ованиÑ\8f Ð²Ñ\8bделеннÑ\8bÑ\85 Ñ\84айлов Ð² ÐºÐ°Ñ\82алог %1$s. Ð\9fереместить их в другое место?</string>
   <string name="pincode_enter_pin_code">Вставьте PIN вашего приложения</string>
-  <string name="pincode_configure_your_pin">Введите  App PIN</string>
-  <string name="pincode_configure_your_pin_explanation">ПИН-код будет запрашиваться каждый раз, когда вы запускаете приложение.</string>
-  <string name="pincode_reenter_your_pincode">Повторите App PIN</string>
+  <string name="pincode_configure_your_pin">Введите App PIN</string>
+  <string name="pincode_configure_your_pin_explanation">PIN-код будет запрашиваться при каждом запуске приложения.</string>
+  <string name="pincode_reenter_your_pincode">Повторите ввод App PIN</string>
   <string name="pincode_remove_your_pincode">Удалить App PIN</string>
-  <string name="pincode_mismatch">Ð\94ва App PIN не совпадают</string>
+  <string name="pincode_mismatch">Ð\92ведÑ\91ннÑ\8bе App PIN не совпадают</string>
   <string name="pincode_wrong">Неверный App PIN</string>
   <string name="pincode_removed">App PIN удалён</string>
   <string name="pincode_stored">App PIN сохранён</string>
-  <string name="media_notif_ticker">%1$s Ð¼Ñ\83зÑ\8bкалÑ\8cнÑ\8bй Ð¿Ñ\80оигÑ\80Ñ\8bваÑ\82елÑ\8c</string>
+  <string name="media_notif_ticker">%1$s Ð°Ñ\83диоплееÑ\80</string>
   <string name="media_state_playing">%1$s (проигрывается)</string>
   <string name="media_state_loading">%1$s (загружается)</string>
   <string name="media_event_done">%1$s воспроизведение завершено</string>
-  <string name="media_err_nothing_to_play">Ð\9dе Ð½Ð°Ð¹Ð´ÐµÐ½ Ð¼ÐµÐ´Ð¸Ð°-Ñ\84айл</string>
-  <string name="media_err_no_account">Ð\9dе Ð½Ð°Ñ\81Ñ\82Ñ\80оена Ñ\83Ñ\87Ñ\91Ñ\82наÑ\8f Ð·Ð°Ð¿Ð¸Ñ\81Ñ\8c</string>
+  <string name="media_err_nothing_to_play">Ð\9cедиаÑ\84айлов Ð½Ðµ Ð½Ð°Ð¹Ð´ÐµÐ½Ð¾</string>
+  <string name="media_err_no_account">УÑ\87Ñ\91Ñ\82наÑ\8f Ð·Ð°Ð¿Ð¸Ñ\81Ñ\8c Ð½Ðµ Ð½Ð°Ñ\81Ñ\82Ñ\80оена</string>
   <string name="media_err_not_in_owncloud">Файл в неверной учётной записи</string>
   <string name="media_err_unsupported">Неподдерживаемый кодек</string>
-  <string name="media_err_io">Файл не может быть прочитан</string>
-  <string name="media_err_malformed">Файл </string>
-  <string name="media_err_timeout">Тайм Ð°Ñ\83Ñ\82 Ð¿Ñ\80и Ð²Ð¾Ñ\81пÑ\80оизведении</string>
-  <string name="media_err_invalid_progressive_playback">Ð\9dевозможно Ð²Ð¾Ñ\81пÑ\80оизвеÑ\81Ñ\82и Ñ\84айл ÐºÐ°Ðº Ð¿Ð¾Ñ\82ок</string>
-  <string name="media_err_unknown">Файл Ð½Ðµ Ð¼Ð¾Ð¶ÐµÑ\82 Ð±Ñ\8bÑ\82Ñ\8c Ð¿Ñ\80оигÑ\80ан  стандартным плеером</string>
+  <string name="media_err_io">Ð\9cедиаÑ\84айл не может быть прочитан</string>
+  <string name="media_err_malformed">Ð\9cедиаÑ\84айл Ð½ÐµÐºÐ¾Ñ\80Ñ\80екÑ\82но Ð·Ð°ÐºÐ¾Ð´Ð¸Ñ\80ован</string>
+  <string name="media_err_timeout">Ð\92Ñ\80емÑ\8f Ð¿Ð¾Ð¿Ñ\8bÑ\82ок Ð²Ð¾Ñ\81пÑ\80оизведениÑ\8f Ð²Ñ\8bÑ\88ло</string>
+  <string name="media_err_invalid_progressive_playback">Ð\9dевозможно Ð¾Ñ\80ганизоваÑ\82Ñ\8c Ð¿Ð¾Ñ\82оковÑ\83Ñ\8e Ð¿ÐµÑ\80едаÑ\87Ñ\83 Ð¼ÐµÐ´Ð¸Ð°Ñ\84айла</string>
+  <string name="media_err_unknown">Ð\9cедиаÑ\84айл Ð½Ðµ Ð¼Ð¾Ð¶ÐµÑ\82 Ð±Ñ\8bÑ\82Ñ\8c Ð¿Ñ\80оигÑ\80ан стандартным плеером</string>
   <string name="media_err_security_ex">Ошибка безопасности при воспроизведении %1$s</string>
   <string name="media_err_io_ex">Ошибка ввода при воспроизведении %1$s</string>
   <string name="media_err_unexpected">Неожиданная ошибка при воспроизведении %1$s</string>
   <string name="auth_nossl_plain_ok_title">Защищённое соединение недоступно.</string>
   <string name="auth_connection_established">Соединение установлено</string>
   <string name="auth_testing_connection">Тестирование соединения...</string>
-  <string name="auth_not_configured_title">Ð\9dевеÑ\80наÑ\8f ÐºÐ¾Ð½Ñ\84игÑ\83Ñ\80аÑ\86иÑ\8f Ñ\81еÑ\80веÑ\80</string>
-  <string name="auth_account_not_new">Учётная запись для такого пользователя и сервера уже существует на устройстве</string>
-  <string name="auth_account_not_the_same">Введённый пользователь не соответсвует пользователю учётной записи</string>
+  <string name="auth_not_configured_title">Ð\9aонÑ\84игÑ\83Ñ\80аÑ\86иÑ\8f Ñ\81еÑ\80веÑ\80а Ð·Ð°Ð´Ð°Ð½Ð° Ð½ÐµÐ²ÐµÑ\80но</string>
+  <string name="auth_account_not_new">Учётная запись такого пользователя и сервера уже существует на устройстве</string>
+  <string name="auth_account_not_the_same">Введённый пользователь не соответствует этой учётной записи</string>
   <string name="auth_unknown_error_title">Произошла неизвестная ошибка!</string>
   <string name="auth_unknown_host_title">Невозможно найти сервер</string>
-  <string name="auth_incorrect_path_title">ЭкземплÑ\8fÑ\80 Ñ\81ервер не найден</string>
+  <string name="auth_incorrect_path_title">Сервер не найден</string>
   <string name="auth_timeout_title">Сервер слишком долго не отвечает</string>
   <string name="auth_incorrect_address_title">Неверный URL</string>
   <string name="auth_ssl_general_error_title">Ошибка инициализации SSL</string>
-  <string name="auth_ssl_unverified_server_title">Невозможно проверить сертификат SSL сервера</string>
+  <string name="auth_ssl_unverified_server_title">Невозможно проверить SSL-сертификат сервера</string>
   <string name="auth_bad_oc_version_title">Неизвестная версия сервера</string>
   <string name="auth_wrong_connection_title">Невозможно установить соединение</string>
   <string name="auth_secure_connection">Защищённое соединение установлено</string>
   <string name="auth_unauthorized">Неверное имя пользователя или пароль</string>
   <string name="auth_oauth_error">Ошибка авторизации</string>
-  <string name="auth_oauth_error_access_denied">Сервер отказал в доступе</string>
-  <string name="auth_wtf_reenter_URL">Ð\9dеожиданнÑ\8bй Ð¾Ñ\82веÑ\82; Ð¿Ð¾Ð¶Ð°Ð»Ñ\83йÑ\81Ñ\82а, Ð²Ð²ÐµÐ´Ð¸Ñ\82е Ð°Ð´Ñ\80еÑ\81 Ñ\81еÑ\80веÑ\80а ÐµÑ\89Ñ\91 Ñ\80аз</string>
-  <string name="auth_expired_oauth_token_toast">Ваша авторизация истекла. Пожалуйста, авторизуйтесь снова</string>
+  <string name="auth_oauth_error_access_denied">СеÑ\80веÑ\80 Ð°Ð²Ñ\82оÑ\80изаÑ\86ии Ð¾Ñ\82казал Ð² Ð´Ð¾Ñ\81Ñ\82Ñ\83пе</string>
+  <string name="auth_wtf_reenter_URL">Неожиданный ответ; введите адрес сервера ещё раз</string>
+  <string name="auth_expired_oauth_token_toast">Время авторизации истекло. Пожалуйста, авторизуйтесь снова</string>
   <string name="auth_expired_basic_auth_toast">Пожалуйста, введите пароль</string>
-  <string name="auth_expired_saml_sso_token_toast">Ваша сессия истекла. Пожалуйста, подключитесь снова</string>
+  <string name="auth_expired_saml_sso_token_toast">Время сессии истекло. Пожалуйста, подключитесь снова</string>
   <string name="auth_connecting_auth_server">Подключение к серверу аутентификации...</string>
   <string name="auth_unsupported_auth_method">Сервер не поддерживает выбранный метод аутентификации</string>
-  <string name="auth_unsupported_multiaccount">%1$s не поддерживает множественные учётные записи</string>
+  <string name="auth_unsupported_multiaccount">%1$s не поддерживает сразу несколько учётных записей</string>
   <string name="fd_keep_in_sync">Обновлять файл</string>
   <string name="common_rename">Переименовать</string>
   <string name="common_remove">Удалить</string>
-  <string name="confirmation_remove_alert">Ð\92Ñ\8b Ð² Ñ\81амом Ð´ÐµÐ»Ðµ хотите удалить %1$s ?</string>
-  <string name="confirmation_remove_folder_alert">Вы действительно хотите удалить %1$s  и его содержимое ?</string>
+  <string name="confirmation_remove_alert">Ð\92Ñ\8b Ð´ÐµÐ¹Ñ\81Ñ\82виÑ\82елÑ\8cно хотите удалить %1$s ?</string>
+  <string name="confirmation_remove_folder_alert">Вы действительно хотите удалить %1$s и его содержимое?</string>
   <string name="confirmation_remove_local">Только локально</string>
   <string name="confirmation_remove_folder_local">Только локальные данные</string>
   <string name="confirmation_remove_remote">Удалить с сервера</string>
-  <string name="confirmation_remove_remote_and_local">Ð\98 Ñ\83далённо и локально</string>
-  <string name="remove_success_msg">Успешное удаление</string>
-  <string name="remove_fail_msg">Удаление Ð½Ðµ Ð¼Ð¾Ð¶ÐµÑ\82 Ð±Ñ\8bÑ\82Ñ\8c Ð·Ð°Ð²ÐµÑ\80Ñ\88ено</string>
+  <string name="confirmation_remove_remote_and_local">Удалённо и локально</string>
+  <string name="remove_success_msg">Удаление завершено</string>
+  <string name="remove_fail_msg">Ð\9eÑ\88ибка Ñ\83далениÑ\8f</string>
   <string name="rename_dialog_title">Введите новое имя</string>
   <string name="rename_local_fail_msg">Локальная копия не может быть переименована; попробуйте другое имя</string>
   <string name="rename_server_fail_msg">Переименование не может быть завершено</string>
   <string name="sync_file_fail_msg">Удаленный файл не может быть проверен</string>
   <string name="sync_file_nothing_to_do_msg">Содержимое файла уже синхронизировано</string>
-  <string name="create_dir_fail_msg">Ð\94иÑ\80екÑ\82оÑ\80иÑ\8f Ð½Ðµ Ð¼Ð¾Ð¶ÐµÑ\82 Ð±Ñ\8bÑ\82Ñ\8c Ñ\81оздана</string>
-  <string name="filename_forbidden_characters">Ð\97апÑ\80еÑ\89Ñ\91нные символы: / \\ &lt; &gt; : \" | ? *</string>
+  <string name="create_dir_fail_msg">Ð\9aаÑ\82алог Ð½Ðµ Ð¼Ð¾Ð¶ÐµÑ\82 Ð±Ñ\8bÑ\82Ñ\8c Ñ\81оздан</string>
+  <string name="filename_forbidden_characters">Ð\9dедопÑ\83Ñ\81Ñ\82имые символы: / \\ &lt; &gt; : \" | ? *</string>
   <string name="wait_a_moment">Подождите немного</string>
-  <string name="filedisplay_unexpected_bad_get_content">Ð\9dеизвеÑ\81Ñ\82наÑ\8f Ð¾Ñ\88ибка; Ð¿Ð¾Ð¿Ñ\80обÑ\83йÑ\82е Ð´Ñ\80Ñ\83гое Ð¿Ñ\80иложение Ð´Ð»Ñ\8f Ð²Ñ\8bбоÑ\80а Ñ\84айла</string>
+  <string name="filedisplay_unexpected_bad_get_content">Ð\9dеизвеÑ\81Ñ\82наÑ\8f Ð¾Ñ\88ибка; Ð²Ñ\8bбеÑ\80иÑ\82е Ñ\8dÑ\82оÑ\82 Ñ\84айл Ð¸Ð· Ð´Ñ\80Ñ\83гого Ð¿Ñ\80иложениÑ\8f</string>
   <string name="filedisplay_no_file_selected">Файлы не выбраны</string>
-  <string name="oauth_check_onoff">Подключать через oAuth2</string>
+  <string name="activity_chooser_title">Отправить ссылку...</string>
+  <string name="oauth_check_onoff">Войти через oAuth2</string>
   <string name="oauth_login_connection">Подключение к серверу oAuth2...</string>
   <string name="ssl_validator_header">Подлинность сайта не может быть проверена</string>
   <string name="ssl_validator_reason_cert_not_trusted">- Сертификат сервера не является доверенным</string>
   <string name="ssl_validator_reason_cert_expired">- Срок действия сертификата сервера истёк</string>
-  <string name="ssl_validator_reason_cert_not_yet_valid">- Сертификат сервера слишком новый</string>
-  <string name="ssl_validator_reason_hostname_not_verified">- Адрес не совпадает с именем в сертификате</string>
-  <string name="ssl_validator_question">Ð\92Ñ\81е-Ñ\80авно Ð´Ð¾Ð²ÐµÑ\80Ñ\8fÑ\82Ñ\8c Ð´Ð°Ð½Ð½Ð¾Ð¼Ñ\83 Ñ\81еÑ\80Ñ\82иÑ\84икаÑ\82Ñ\83?</string>
+  <string name="ssl_validator_reason_cert_not_yet_valid">- Срок действия сертификата сервера ещё не начался</string>
+  <string name="ssl_validator_reason_hostname_not_verified">- URL не совпадает с именем сервера в сертификате</string>
+  <string name="ssl_validator_question">Ð\92Ñ\8b Ñ\85оÑ\82иÑ\82е Ð´Ð¾Ð²ÐµÑ\80Ñ\8fÑ\82Ñ\8c Ð´Ð°Ð½Ð½Ð¾Ð¼Ñ\83 Ñ\81еÑ\80Ñ\82иÑ\84икаÑ\82Ñ\83 Ð² Ð»Ñ\8eбом Ñ\81лÑ\83Ñ\87ае?</string>
   <string name="ssl_validator_not_saved">Сертификат не может быть сохранён</string>
-  <string name="ssl_validator_btn_details_see">Ð\94еÑ\82али</string>
-  <string name="ssl_validator_btn_details_hide">СпÑ\80Ñ\8fÑ\82ать</string>
-  <string name="ssl_validator_label_subject">Ð\92Ñ\8bдано Ð´Ð»Ñ\8f:</string>
-  <string name="ssl_validator_label_issuer">Ð\92Ñ\8bдан:</string>
+  <string name="ssl_validator_btn_details_see">Ð\9fодÑ\80обно</string>
+  <string name="ssl_validator_btn_details_hide">СкÑ\80Ñ\8bть</string>
+  <string name="ssl_validator_label_subject">Ð\9aомÑ\83 Ð²Ñ\8bдано:</string>
+  <string name="ssl_validator_label_issuer">Ð\9aем Ð²Ñ\8bдано:</string>
   <string name="ssl_validator_label_CN">Имя:</string>
   <string name="ssl_validator_label_O">Организация:</string>
   <string name="ssl_validator_label_OU">Организационное подразделение:</string>
   <string name="ssl_validator_label_C">Страна:</string>
-  <string name="ssl_validator_label_ST">СÑ\82аÑ\82Ñ\83Ñ\81:</string>
+  <string name="ssl_validator_label_ST">ШÑ\82аÑ\82:</string>
   <string name="ssl_validator_label_L">Местонахождение:</string>
   <string name="ssl_validator_label_validity">Срок действия:</string>
-  <string name="ssl_validator_label_validity_from">Ð\9eÑ\82:</string>
-  <string name="ssl_validator_label_validity_to">Ð\94о:</string>
+  <string name="ssl_validator_label_validity_from">Ð\98з:</string>
+  <string name="ssl_validator_label_validity_to">Ð\92:</string>
   <string name="ssl_validator_label_signature">Подпись:</string>
   <string name="ssl_validator_label_signature_algorithm">Алгоритм:</string>
   <string name="placeholder_sentence">Это заполнитель</string>
   <string name="placeholder_filename">placeholder.txt</string>
   <string name="placeholder_filetype">Изображение PNG</string>
-  <string name="placeholder_filesize">389 KB</string>
+  <string name="placeholder_filesize">389 КБ</string>
   <string name="placeholder_timestamp">2012/05/18 12:23 PM</string>
   <string name="placeholder_media_time">12:23:45</string>
-  <string name="instant_upload_on_wifi">Загружать изображения только через WiFi</string>
+  <string name="instant_upload_on_wifi">Загружать изображения только через Wi-Fi</string>
   <string name="instant_upload_path">/InstantUpload</string>
   <string name="conflict_title">Конфликт обновления</string>
-  <string name="conflict_message">УдаленнÑ\8bй Ñ\84айл %s Ð½Ðµ Ñ\81инÑ\85Ñ\80онизиÑ\80ован Ñ\81 Ð»Ð¾ÐºÐ°Ð»Ñ\8cнÑ\8bм. Ð\97авеÑ\80Ñ\88ение Ð¿Ñ\80иведеÑ\82 Ðº Ð·Ð°Ð¼ÐµÐ½Ðµ Ñ\81одеÑ\80жаниÑ\8f файла на сервере.</string>
-  <string name="conflict_keep_both">Ð\9eÑ\81Ñ\82авить оба</string>
+  <string name="conflict_message">УдаленнÑ\8bй Ñ\84айл %s Ð½Ðµ Ñ\81инÑ\85Ñ\80онизиÑ\80ован Ñ\81 Ð»Ð¾ÐºÐ°Ð»Ñ\8cнÑ\8bм. Ð\9fÑ\80одолжение Ð¿Ñ\80иведеÑ\82 Ðº Ð·Ð°Ð¼ÐµÐ½Ðµ Ñ\81одеÑ\80жимого файла на сервере.</string>
+  <string name="conflict_keep_both">СоÑ\85Ñ\80анить оба</string>
   <string name="conflict_overwrite">Заменить</string>
   <string name="conflict_dont_upload">Не загружать</string>
   <string name="preview_image_description">Предпросмотр</string>
-  <string name="preview_image_error_unknown_format">ЭÑ\82о Ð¸Ð·Ð¾Ð±Ñ\80ажение Ð½Ðµ Ð¼Ð¾Ð¶ÐµÑ\82 Ð±Ñ\8bÑ\82Ñ\8c Ð¾Ñ\82обÑ\80ажено</string>
-  <string name="error__upload__local_file_not_copied">%1$s не может быть скопирован в %2$s локальною папку</string>
-  <string name="actionbar_failed_instant_upload">Ð\91Ñ\8bÑ\81Ñ\82Ñ\80аÑ\8f Ð·Ð°Ð³Ñ\80Ñ\83зка Ð½Ðµ Ñ\83далаÑ\81Ñ\8c</string>
-  <string name="failed_upload_headline_text">Ð\91Ñ\8bÑ\81Ñ\82Ñ\80Ñ\8bе Ð·Ð°Ð³Ñ\80Ñ\83зки Ð½Ðµ Ñ\83далиÑ\81Ñ\8c</string>
-  <string name="failed_upload_headline_hint">СпиÑ\81ок Ð²Ñ\81еÑ\85 Ð½ÐµÑ\83даÑ\87нÑ\8bÑ\85 Ð·Ð°Ð³Ñ\80Ñ\83зок</string>
+  <string name="preview_image_error_unknown_format">ЭÑ\82о Ð¸Ð·Ð¾Ð±Ñ\80ажение Ð½Ðµ Ð¼Ð¾Ð¶ÐµÑ\82 Ð±Ñ\8bÑ\82Ñ\8c Ð¿Ð¾ÐºÐ°Ð·Ð°но</string>
+  <string name="error__upload__local_file_not_copied">%1$s не может быть скопирован в локальный каталог %2$s</string>
+  <string name="actionbar_failed_instant_upload">Сбой Ð½ÐµÐ¼ÐµÐ´Ð»ÐµÐ½Ð½Ð¾Ð¹ Ð·Ð°Ð³Ñ\80Ñ\83зки</string>
+  <string name="failed_upload_headline_text">Сбой Ð½ÐµÐ¼ÐµÐ´Ð»ÐµÐ½Ð½Ð¾Ð¹ Ð·Ð°Ð³Ñ\80Ñ\83зки</string>
+  <string name="failed_upload_headline_hint">Сводка Ð¿Ð¾ Ð²Ñ\81ем Ñ\81бойнÑ\8bм Ð½ÐµÐ¼ÐµÐ´Ð»ÐµÐ½Ð½Ñ\8bм Ð·Ð°Ð³Ñ\80Ñ\83зкам</string>
   <string name="failed_upload_all_cb">Выбрать всё</string>
   <string name="failed_upload_headline_retryall_btn">Ещё раз попробовать всё выделенное</string>
-  <string name="failed_upload_headline_delete_all_btn">УдалиÑ\82Ñ\8c Ð²Ñ\81Ñ\91| Ð²Ñ\8bбÑ\80анное Ð¸Ð· Ð¾Ñ\87еÑ\80еди Ð·Ð°Ð³Ñ\80Ñ\83зки</string>
-  <string name="failed_upload_retry_text">Ð\9fопÑ\80обоваÑ\82Ñ\8c ÐµÑ\89Ñ\91 Ñ\80аз Ð·Ð°Ð³Ñ\80Ñ\83зиÑ\82Ñ\8c Ð¸Ð·Ð¾Ð±Ñ\80ажение</string>
+  <string name="failed_upload_headline_delete_all_btn">Удалить выбранное из очереди загрузки</string>
+  <string name="failed_upload_retry_text">попÑ\80обоваÑ\82Ñ\8c ÐµÑ\89Ñ\91 Ñ\80аз Ð·Ð°Ð³Ñ\80Ñ\83зиÑ\82Ñ\8c Ð¸Ð·Ð¾Ð±Ñ\80ажение:</string>
   <string name="failed_upload_load_more_images">Загрузить больше картинок</string>
-  <string name="failed_upload_retry_do_nothing_text">Ничего не делать, если не в сети</string>
-  <string name="failed_upload_failure_text">Сообщение об ошибке</string>
-  <string name="failed_upload_quota_exceeded_text">Проверьте настройки сервера, возможно ваш лимит превышен</string>
+  <string name="failed_upload_retry_do_nothing_text">Ничего не делать, если нет подключения к сети</string>
+  <string name="failed_upload_failure_text">Сообщение об ошибке:</string>
+  <string name="failed_upload_quota_exceeded_text">Проверьте настройки сервера, возможно ваш лимит исчерпан</string>
+  <string name="share_link_no_support_share_api">Механизм общего доступа не включен на вашем сервере. Свяжитесь с администратором.</string>
+  <string name="share_link_file_no_exist">Невозможно предоставить доступ к этому файлу или каталогу. Убедитесь, что он существует</string>
+  <string name="share_link_file_error">Ошибка предоставления общего доступа к этому файлу или каталогу</string>
+  <string name="unshare_link_file_error">Ошибка удаления общего доступа к этому файлу или каталогу</string>
+  <string name="activity_chooser_send_file_title">Отправить</string>
+  <string name="clipboard_text_copied">Скопировано в буфер обмена</string>
 </resources>
index 996544e..d8c1d11 100644 (file)
@@ -10,6 +10,7 @@
   <string name="actionbar_mkdir">Vytvor priečinok</string>
   <string name="actionbar_settings">Nastavenia</string>
   <string name="actionbar_see_details">Podrobnosti</string>
+  <string name="actionbar_send_file">Odoslať</string>
   <string name="prefs_category_general">Všeobecné</string>
   <string name="prefs_category_more">Viac</string>
   <string name="prefs_accounts">Účty</string>
@@ -55,6 +56,8 @@
   <string name="filedetails_download">Stiahnuť</string>
   <string name="filedetails_sync_file">Obnoviť súbor</string>
   <string name="filedetails_renamed_in_upload_msg">Súbor bol premenovaný na %1$s počas nahrávania</string>
+  <string name="action_share_file">Zdieľať linku</string>
+  <string name="action_unshare_file">Zrušiť zdieľanie odkazu</string>
   <string name="common_yes">Áno</string>
   <string name="common_no">Nie</string>
   <string name="common_ok">OK</string>
@@ -94,7 +97,7 @@
   <string name="sync_fail_in_favourites_content">Obsah %1$d súborov nemohol byť synchronizovaný (%2$d konfliktov)</string>
   <string name="sync_foreign_files_forgotten_ticker">Niektoré lokálne súbory boli zabudnuté</string>
   <string name="sync_foreign_files_forgotten_content">%1$d súborov z priečinka %2$s nemožno skopírovať do</string>
-  <string name="sync_foreign_files_forgotten_explanation">Od verzie 1.3.16 sú súbory nahrané z tohoto zariadenia, skopírovné do lokálneho priečinka %1$s, aby sa zabránilo strate dát, keď je jeden súbor synchronizovný s viacerými účtami.\n\nPre túto zmenu, všetky súbory nahraté v predchádzajúcich verziách tejto aplikácie boli skopírované do priečinka %2$s. Je nám to ľúto, chyba zabránila dokončeniu tejto operácie počas synchronizácie účtu. Súbor(y) môžete ponechať v súčasnom stave a zmazať odkaz na %3$s, alebo presunúť súbor(y) do priečinka %1$s a zachovať odkaz na %4$s.\n\nĎalej lokálny súbor(y) a vzdialený súbor(y) sú spojené v priečinku %5$s.</string>
+  <string name="sync_foreign_files_forgotten_explanation">Od verzie 1.3.16 sú súbory nahrané z tohoto zariadenia, skopírovné do lokálneho priečinka %1$s, aby sa zabránilo strate dát, keď je jeden súbor synchronizovný s viacerými účtami.\n\nPre túto zmenu, všetky súbory nahraté v predchádzajúcich verziách tejto aplikácie boli skopírované do priečinka %2$s. Je nám to ľúto, chyba zabránila dokončeniu tejto operácie počas synchronizácie účtu. Súbor(y) môžete ponechať v súčasnom stave a zmazať odkaz na %3$s, alebo presunúť súbor(y) do priečinka %1$s a zachovať odkaz na %4$s.\n\nNižšie je zoznam lokálnych súborov a vzdialených súborov z %5$s na ktoré odkazovali.</string>
   <string name="sync_current_folder_was_removed">Priečinok %1$s už existuje</string>
   <string name="foreign_files_move">Premiestniť všetko</string>
   <string name="foreign_files_success">Všetky súbory boli premiestnené</string>
   <string name="wait_a_moment">Počkať chvíľu</string>
   <string name="filedisplay_unexpected_bad_get_content">Neočakávaný problém; skúste vybrať súbor inou aplikáciou</string>
   <string name="filedisplay_no_file_selected">Nebol vybraný súbor</string>
+  <string name="activity_chooser_title">Odošli link do ...</string>
   <string name="oauth_check_onoff">Prihlásiť sa z oAuth2</string>
   <string name="oauth_login_connection">Pripájam sa na oAuth2 server…</string>
   <string name="ssl_validator_header">Identitu stránky nemožno overiť</string>
   <string name="failed_upload_retry_do_nothing_text">nevykonať nič, nie ste online pre instantné nahratie</string>
   <string name="failed_upload_failure_text">Chybová správa:</string>
   <string name="failed_upload_quota_exceeded_text">Prosím skontrolujte nastavenie vášho servera, možno bola prekročená disková kvóta.</string>
+  <string name="share_link_no_support_share_api">Je nám ľúto, zdieľanie nie je povolené na Vašom serveri. Prosím, obráťte sa na správcu.</string>
+  <string name="share_link_file_no_exist">Nie je možné zdieľať tento súbor alebo adresár. Prosím uistite sa že existuje</string>
+  <string name="share_link_file_error">Pri pokuse o zdieľanie tohto súboru alebo priečinka došlo k chybe</string>
+  <string name="unshare_link_file_no_exist">Nie je možné zrušiť zdieľanie tohoto súboru alebo priečinka. Súbor alebo priečinok neexistuje.</string>
+  <string name="unshare_link_file_error">Pri pokuse zrušiť zdieľanie tohto súboru alebo priečinka došlo k chybe</string>
+  <string name="activity_chooser_send_file_title">Odoslať</string>
+  <string name="copy_link">Kopíruj odkaz</string>
+  <string name="clipboard_text_copied">Skopírované do \"clipboard\"</string>
 </resources>
index b951d63..5521388 100644 (file)
@@ -10,6 +10,7 @@
   <string name="actionbar_mkdir">Ustvari mapo</string>
   <string name="actionbar_settings">Nastavitve</string>
   <string name="actionbar_see_details">Podrobnosti</string>
+  <string name="actionbar_send_file">Pošlji</string>
   <string name="prefs_category_general">Splošno</string>
   <string name="prefs_category_more">Več</string>
   <string name="prefs_accounts">Računi</string>
@@ -55,6 +56,8 @@
   <string name="filedetails_download">Prejmi</string>
   <string name="filedetails_sync_file">Osveži datoteko</string>
   <string name="filedetails_renamed_in_upload_msg">Datoteka je bila med nalaganjem preimenovana v %1$s</string>
+  <string name="action_share_file">Povezava za souporabo</string>
+  <string name="action_unshare_file">Odstrani možnost souporabe</string>
   <string name="common_yes">Da</string>
   <string name="common_no">Ne</string>
   <string name="common_ok">V redu</string>
@@ -94,7 +97,6 @@
   <string name="sync_fail_in_favourites_content">Vsebine %1$d datotek ni bilo mogoče uskladiti (zaznanih je %2$d sporov)</string>
   <string name="sync_foreign_files_forgotten_ticker">Nekatere krajevne datoteke so spregledane</string>
   <string name="sync_foreign_files_forgotten_content">Skupno %1$d datotek iz mape %2$s ni mogoče kopirati v</string>
-  <string name="sync_foreign_files_forgotten_explanation">Od različice 1.3.16 dalje so datoteke, poslane iz te naprave, kopirane v krajevno mapo %1$s. S tem je preprečena izguba podatkov, kadar poteka usklajevanje ene datoteke z več računi.\n\nZaradi te spremembe so vse datoteke, poslane pred namestitvijo te različice programa, kopirane v mapo %2$s. Med usklajevanjem računov je prišlo do napake, ki je preprečila končanje tega opravila. Datoteke lahko pustite nespremenjene in odstranite povezavo do %3$s ali jih premaknete v mapo %1$s in ohranite povezavo do %4$s.\n\nNavedene so krajevne in oddaljene datoteke in mesto %5$s, kje so bile povezane.</string>
   <string name="sync_current_folder_was_removed">Mapa %1$s ne obstaja več</string>
   <string name="foreign_files_move">Premakni vse</string>
   <string name="foreign_files_success">Vse datoteke so uspešno premaknjene na novo mesto</string>
   <string name="wait_a_moment">Počakajte trenutek ...</string>
   <string name="filedisplay_unexpected_bad_get_content">Prišlo je do nepričakovane napake. Poskusite datoteko izbrati z drugim programom.</string>
   <string name="filedisplay_no_file_selected">Ni izbranih datotek</string>
+  <string name="activity_chooser_title">Pošlji povezavo ...</string>
   <string name="oauth_check_onoff">Prijava  z oAuth2</string>
   <string name="oauth_login_connection">Poteka povezovanje s strežnikom oAuth2 ...</string>
   <string name="ssl_validator_header">Istovetnosti strani ni mogoče preveriti</string>
   <string name="failed_upload_retry_do_nothing_text">ne pošlji takoj, saj je povezava v omrežje ni dejavna</string>
   <string name="failed_upload_failure_text">Sporočilo o napaki:</string>
   <string name="failed_upload_quota_exceeded_text">Preverite nastavitve strežnika. Morda je presežena vrednost količinske omejitve.</string>
+  <string name="share_link_no_support_share_api">Souporaba je na strežniku onemogočena. Možnost lahko spreminjajo le uporabniki s skrbniškimi dovoljenji.</string>
+  <string name="share_link_file_no_exist">Ni mogoče omogočiti souporabe te datoteke ali mape. Prepričajte se, da obstaja ...</string>
+  <string name="share_link_file_error">Prišlo je do napake med poskusom omogočanja souporabe te datoteke ali mape</string>
+  <string name="unshare_link_file_no_exist">Ni mogoče prekiniti souporabe te datoteke ali mape, ker ne obstaja.</string>
+  <string name="unshare_link_file_error">Prišlo je do napake med poskusom odstranjevanja souporabe te datoteke ali mape</string>
+  <string name="activity_chooser_send_file_title">Pošlji</string>
+  <string name="copy_link">Kopiraj povezavo</string>
+  <string name="clipboard_text_copied">Kopirano v odložišče</string>
 </resources>
index c460e82..5b40e5f 100644 (file)
@@ -4,6 +4,7 @@
   <string name="actionbar_upload_files">Skedarët</string>
   <string name="actionbar_mkdir">Krijo kartelë</string>
   <string name="actionbar_settings">Parametrat</string>
+  <string name="actionbar_send_file">Dërgo</string>
   <string name="prefs_category_general">Përgjithshme</string>
   <string name="prefs_category_more">Më tepër</string>
   <string name="prefs_accounts">Llogarit</string>
@@ -51,4 +52,5 @@
   <string name="auth_secure_connection">Lidhja e Sigurt vendos</string>
   <string name="common_rename">Riemërto</string>
   <string name="common_remove">Hiq</string>
+  <string name="activity_chooser_send_file_title">Dërgo</string>
 </resources>
index eefd16d..478d843 100644 (file)
@@ -5,6 +5,7 @@
   <string name="actionbar_mkdir">Novi folder</string>
   <string name="actionbar_settings">Podešavanja</string>
   <string name="actionbar_see_details">Detaljnije</string>
+  <string name="actionbar_send_file">Pošalji</string>
   <string name="prefs_category_general">Opšte</string>
   <string name="prefs_accounts">Nalozi</string>
   <string name="prefs_manage_accounts">Upravljaj nalozima</string>
@@ -50,4 +51,5 @@
   <string name="ssl_validator_label_validity_to">Za:</string>
   <string name="ssl_validator_label_signature">Potpis:</string>
   <string name="conflict_keep_both">Zadrži oboje</string>
+  <string name="activity_chooser_send_file_title">Pošalji</string>
 </resources>
index 83ce42d..bd39b2b 100644 (file)
@@ -5,6 +5,7 @@
   <string name="actionbar_upload_files">Датотеке</string>
   <string name="actionbar_mkdir">Направи фасциклу</string>
   <string name="actionbar_settings">Поставке</string>
+  <string name="actionbar_send_file">Пошаљи</string>
   <string name="prefs_category_general">Опште</string>
   <string name="prefs_category_more">Више</string>
   <string name="prefs_accounts">Налози</string>
   <string name="ssl_validator_label_signature_algorithm">Алгоритам:</string>
   <string name="instant_upload_on_wifi">Отпремај слике само путем бежичне мреже</string>
   <string name="conflict_title">Ажурирај сукоб</string>
+  <string name="activity_chooser_send_file_title">Пошаљи</string>
 </resources>
diff --git a/res/values-su/strings.xml b/res/values-su/strings.xml
new file mode 100644 (file)
index 0000000..c757504
--- /dev/null
@@ -0,0 +1,2 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<resources/>
index af6e259..562413e 100644 (file)
@@ -10,6 +10,7 @@
   <string name="actionbar_mkdir">Skapa mapp</string>
   <string name="actionbar_settings">Inställningar</string>
   <string name="actionbar_see_details">Detaljer</string>
+  <string name="actionbar_send_file">Skicka</string>
   <string name="prefs_category_general">Allmänt</string>
   <string name="prefs_category_more">Mer</string>
   <string name="prefs_accounts">Konton</string>
@@ -54,6 +55,7 @@
   <string name="filedetails_download">Ladda ner</string>
   <string name="filedetails_sync_file">Ladda om fil</string>
   <string name="filedetails_renamed_in_upload_msg">Filen bytte namn till %1$s under uppladdningen</string>
+  <string name="action_share_file">Dela länk</string>
   <string name="common_yes">Ja</string>
   <string name="common_no">Nej</string>
   <string name="common_ok">OK</string>
@@ -93,7 +95,6 @@
   <string name="sync_fail_in_favourites_content">Innehållet i %1$d filer kunde inte synkas (%2$d konflikter)</string>
   <string name="sync_foreign_files_forgotten_ticker">Vissa lokala filer glömdes</string>
   <string name="sync_foreign_files_forgotten_content">%1$d filer från %2$s mappar kunde inte kopieras till</string>
-  <string name="sync_foreign_files_forgotten_explanation">Från och med version 1.3.16 kopieras uppladdade filer från den här enheten till den lokala %1$s mappen för att förhindra förlust av data när en enda fil synkroniseras med flera konton.\n\nPå grund av denna förändring har alla filer som laddats upp i tidigare versioner av denna app kopierats till %2$s mappen. Men ett fel förhindrade slutförande av denna operation under synkronisering. Du kan antingen lämna fil(er) som det är och ta bort länken till %3$s, eller flytta fil(er) till %1$s mappen och behålla länken till %4$s.\n\nNedan listas dom lokala fil(er) och fjärrfil(er) i %5$s dom var länkade till.</string>
   <string name="sync_current_folder_was_removed">Mappen %1$s existerar inte längre</string>
   <string name="foreign_files_move">Flytta allt</string>
   <string name="foreign_files_success">Alla filer flyttades</string>
   <string name="failed_upload_retry_do_nothing_text">Du är inte ansluten, direktuppladdning ej möjligt</string>
   <string name="failed_upload_failure_text">Felmeddelande:</string>
   <string name="failed_upload_quota_exceeded_text">Vänligen kontrollera dina serverkonfiguration. Din kvot kan ha överskridits.</string>
+  <string name="activity_chooser_send_file_title">Skicka</string>
+  <string name="clipboard_text_copied">Kopierat till urklipp</string>
 </resources>
index ca33f4e..25cec00 100644 (file)
@@ -1,6 +1,7 @@
 <?xml version='1.0' encoding='UTF-8'?>
 <resources>
   <string name="actionbar_settings">అమరికలు</string>
+  <string name="actionbar_send_file">పంపించు</string>
   <string name="prefs_category_more">మరిన్ని</string>
   <string name="prefs_help">సహాయం</string>
   <string name="auth_username">వాడుకరి పేరు</string>
@@ -9,4 +10,5 @@
   <string name="common_no">కాదు</string>
   <string name="common_cancel">రద్దుచేయి</string>
   <string name="common_error">పొరపాటు</string>
+  <string name="activity_chooser_send_file_title">పంపించు</string>
 </resources>
index 77451fa..58d7333 100644 (file)
@@ -6,6 +6,7 @@
   <string name="actionbar_mkdir">สร้างไดเร็กทอรี่</string>
   <string name="actionbar_settings">ตั้งค่า</string>
   <string name="actionbar_see_details">รายละเอียด</string>
+  <string name="actionbar_send_file">ส่ง</string>
   <string name="prefs_category_general">ทั่วไป</string>
   <string name="prefs_category_more">มาก</string>
   <string name="prefs_accounts">บัญชี</string>
@@ -44,6 +45,7 @@
   <string name="common_cancel">ยกเลิก</string>
   <string name="common_save_exit">บันทึก &amp; ออก</string>
   <string name="common_error">ข้อผิดพลาด</string>
+  <string name="common_error_unknown">ข้อผิดพลาดที่ไม่ทราบสาเหตุ</string>
   <string name="about_title">เกี่ยวกับเรา</string>
   <string name="change_password">เปลี่ยนรหัสผ่าน</string>
   <string name="delete_account">ลบบัญชี</string>
   <string name="conflict_overwrite">เขียนทับ</string>
   <string name="conflict_dont_upload">ไม่ต้องอัพโหลด</string>
   <string name="error__upload__local_file_not_copied">%1$s ไม่สามารถถูกคัดลอกไปที่ %2$s ไดเรกทอรีท้องถิ่น</string>
+  <string name="activity_chooser_send_file_title">ส่ง</string>
 </resources>
index 5db0dd5..ac7df89 100644 (file)
@@ -10,6 +10,7 @@
   <string name="actionbar_mkdir">Dizin oluştur</string>
   <string name="actionbar_settings">Ayarlar</string>
   <string name="actionbar_see_details">Detaylar</string>
+  <string name="actionbar_send_file">Gönder</string>
   <string name="prefs_category_general">Genel</string>
   <string name="prefs_category_more">Daha fazla</string>
   <string name="prefs_accounts">Hesaplar</string>
@@ -55,6 +56,8 @@
   <string name="filedetails_download">İndir</string>
   <string name="filedetails_sync_file">Dosyayı yenile</string>
   <string name="filedetails_renamed_in_upload_msg">Dosya adı, yükleme sırasında %1$s olarak değiştirildi</string>
+  <string name="action_share_file">Paylaşma bağlantısı</string>
+  <string name="action_unshare_file">Bağlantı paylaşımını kaldır</string>
   <string name="common_yes">Evet</string>
   <string name="common_no">Hayır</string>
   <string name="common_ok">OK</string>
   <string name="auth_connecting_auth_server">Kimlik doğrulama sunucusuna bağlanılıyor...</string>
   <string name="auth_unsupported_auth_method">Sunucu bu kimlik doğrulama yöntemini desteklemiyor</string>
   <string name="auth_unsupported_multiaccount">%1$s çoklu hesapları desteklemiyor</string>
+  <string name="auth_fail_get_user_name">Sunucunuz geçerli bir kullanıcı kimliği döndürmüyor, lütfen yöneticinizle iletişime geçin</string>
   <string name="fd_keep_in_sync">Dosyayı güncel tut </string>
   <string name="common_rename">İsim değiştir.</string>
   <string name="common_remove">Kaldır</string>
   <string name="wait_a_moment">Bir süre bekleyin</string>
   <string name="filedisplay_unexpected_bad_get_content">Beklenmeyen problem ; lütfen, dosya seçmek için diğer uygulamayı deneyin</string>
   <string name="filedisplay_no_file_selected">Hiçbir dosya seçilmedi</string>
+  <string name="activity_chooser_title">Bağlantıyı gönder ...</string>
   <string name="oauth_check_onoff">oAuth2 ile oturum aç</string>
   <string name="oauth_login_connection">oAuth2 sunucusuna bağlanılıyor…</string>
   <string name="ssl_validator_header">Bu sitenin sertifikası doğrulanamadı</string>
   <string name="failed_upload_retry_do_nothing_text">anında yükleme için çevrimiçi değilsiniz, bir şey yapma</string>
   <string name="failed_upload_failure_text">Hata Mesajı:</string>
   <string name="failed_upload_quota_exceeded_text">Sunucu yapılandırmanızı kontrol edin. Kotanızı aşmış olabilirsiniz.</string>
+  <string name="share_link_no_support_share_api">Üzgünüz, paylaşım sunucunuzda etkin değil. Lütfen yöneticinizle iletişime geçin.</string>
+  <string name="share_link_file_no_exist">Bu dosya veya klasör paylaşılamıyor. Lütfen mevcut olup olmadığını denetleyin</string>
+  <string name="share_link_file_error">Bu dosya veya klasörü paylaşmaya çalışılırken bir hata oluştu</string>
+  <string name="unshare_link_file_no_exist">Bu dosya veya klasörün paylaşımı kaldırılamadı. Mevcut değil.</string>
+  <string name="unshare_link_file_error">Bu dosya veya klasör paylaşımı kaldırılmaya çalışılırken bir hata oluştu</string>
+  <string name="activity_chooser_send_file_title">Gönder</string>
+  <string name="copy_link">Bağlantıyı kopyala</string>
+  <string name="clipboard_text_copied">Panoya kopyalandı</string>
 </resources>
index 16a441a..6f06192 100644 (file)
@@ -4,6 +4,7 @@
   <string name="actionbar_upload_files">ھۆججەتلەر</string>
   <string name="actionbar_mkdir">مۇندەرىجە قۇر</string>
   <string name="actionbar_settings">تەڭشەكلەر</string>
+  <string name="actionbar_send_file">يوللا</string>
   <string name="prefs_category_general">ئادەتتىكى</string>
   <string name="prefs_category_more">تېخىمۇ كۆپ</string>
   <string name="prefs_accounts">ھېساباتلار</string>
@@ -36,4 +37,5 @@
   <string name="common_choose_account">ھېسابات تاللاڭ</string>
   <string name="common_rename">ئات ئۆزگەرت</string>
   <string name="common_remove">چىقىرىۋەت</string>
+  <string name="activity_chooser_send_file_title">يوللا</string>
 </resources>
index a3adb7d..807ff52 100644 (file)
@@ -6,6 +6,7 @@
   <string name="actionbar_mkdir">Створити теку</string>
   <string name="actionbar_settings">Налаштування</string>
   <string name="actionbar_see_details">Деталі</string>
+  <string name="actionbar_send_file">Надіслати</string>
   <string name="prefs_category_general">Основне</string>
   <string name="prefs_category_more">Більше</string>
   <string name="prefs_accounts">Облікові записи</string>
@@ -38,6 +39,7 @@
   <string name="filedetails_modified">Змінено:</string>
   <string name="filedetails_download">Завантажити</string>
   <string name="filedetails_renamed_in_upload_msg">Файл був переіменований в %1$s протягом вивантаження</string>
+  <string name="action_share_file">Опублікувати посилання</string>
   <string name="common_yes">Так</string>
   <string name="common_no">Ні</string>
   <string name="common_ok">OK</string>
   <string name="conflict_overwrite">Замінити</string>
   <string name="conflict_dont_upload">Не завантажувати</string>
   <string name="error__upload__local_file_not_copied">%1$s неможливо скопіювати в локальний каталог %2$s</string>
+  <string name="activity_chooser_send_file_title">Надіслати</string>
+  <string name="clipboard_text_copied">Скопійовано в буфер обміну</string>
 </resources>
index 868c564..3fbddf8 100644 (file)
@@ -10,6 +10,7 @@
   <string name="actionbar_mkdir">Tạo thư mục</string>
   <string name="actionbar_settings">Cài đặt</string>
   <string name="actionbar_see_details">Chi tiết</string>
+  <string name="actionbar_send_file">Gởi</string>
   <string name="prefs_category_general">Tổng hợp</string>
   <string name="prefs_category_more">hơn</string>
   <string name="prefs_accounts">Tài khoản</string>
@@ -55,6 +56,8 @@
   <string name="filedetails_download">Tải về</string>
   <string name="filedetails_sync_file">Cập nhật lại tập tin</string>
   <string name="filedetails_renamed_in_upload_msg">Tập tin đã bị đổi tên thành %1$s trong quá trình tải lên</string>
+  <string name="action_share_file">Chia sẻ liên kết</string>
+  <string name="action_unshare_file">Liên kết không chia sẻ</string>
   <string name="common_yes">Yes</string>
   <string name="common_no">Không</string>
   <string name="common_ok">Chấp nhận</string>
@@ -94,7 +97,6 @@
   <string name="sync_fail_in_favourites_content">Nội dung tập tin %1$d không thể đồng bộ (%2$d xung đột)</string>
   <string name="sync_foreign_files_forgotten_ticker">Một số tập tin cục bộ bị quên</string>
   <string name="sync_foreign_files_forgotten_content">Các tập tin %1$d ở ngoài thư mục %2$s không thể được chép vào</string>
-  <string name="sync_foreign_files_forgotten_explanation">\"Từ phiên bản 1.3.16, các tập tin tải lên từ thiết bị này được chép vào thư mục cục bộ %1$s để đề phòng mất dữ liệu khi một tập tin được đồng bộ với nhiều tài khoản.\n\nDo thay đổi này, tất cả các tập tin được tải lên ở phiên bản trước của ứng dụng này được chép vào thư mục %2$s. Tuy nhiên, đã có lỗi ngăn cản việc này trong lúc đồng bộ tài khoản. Bạn có thể để (các) tập tin như vậy và xóa liên kết đến %3$s, hoặc di chuyển (các) tập tin vào thư mục %1$s và giữ lại liên kết tới %4$s.\n\nDanh sách bên dưới là (các) tập tin cục bộ và (các) tập tin ở xa trong %5$s mà chúng được liên kết tới.</string>
   <string name="sync_current_folder_was_removed">Thư mục %1$s không còn tồn tại</string>
   <string name="foreign_files_move">Di chuyển tất cả</string>
   <string name="foreign_files_success">Tất cả tập tin đã được chuyển đi</string>
   <string name="wait_a_moment">Chờ một lúc</string>
   <string name="filedisplay_unexpected_bad_get_content">Vấn đề bất ngờ ; hãy thử ứng dụng khác để chọn tập tin</string>
   <string name="filedisplay_no_file_selected">Không có tập tin nào được chọn</string>
+  <string name="activity_chooser_title">Gửi liên kết đến...</string>
   <string name="oauth_check_onoff">Đăng nhập bằng oAuth2.</string>
   <string name="oauth_login_connection">Đang kết nối đến máy chủ oAuth2...</string>
   <string name="ssl_validator_header">Không thể xác minh danh tính của site</string>
   <string name="failed_upload_retry_do_nothing_text">không thực hiện thao tác gì nêu bạn không có kết nối mạng dành cho tải lên nhanh</string>
   <string name="failed_upload_failure_text">Thông điệp lỗi:</string>
   <string name="failed_upload_quota_exceeded_text">Vui lòng kiểm tra cấu hình máy chủ của bạn, có thể hạn ngạch dữ liệu đã quá hạn.</string>
+  <string name="share_link_no_support_share_api">Thật tiếc, chia sẻ đã bị vô hiệu trên server của bạn. Vui lòng liên hệ người quản trị.</string>
+  <string name="share_link_file_no_exist">Không thể chia sẻ file hoặc thư mục này. Hãy chắc chắn rằng nó tồn tại</string>
+  <string name="share_link_file_error">Một lỗi đã xảy ra khi thử chia sẻ file hoặc thư mục này</string>
+  <string name="unshare_link_file_no_exist">Không thể gỡ chia sẻ file hoặc thư mục. Nó không tồn tại.</string>
+  <string name="unshare_link_file_error">Một lỗi đã xảy ra khi thử gỡ chia sẻ file hoặc thư mục này</string>
+  <string name="activity_chooser_send_file_title">Gởi</string>
 </resources>
index 2b83a78..14550d1 100644 (file)
@@ -1,5 +1,6 @@
 <?xml version='1.0' encoding='UTF-8'?>
 <resources>
+  <string name="about_android">%1$s 安卓应用</string>
   <string name="about_version">版本:%1$s</string>
   <string name="actionbar_sync">刷新帐户</string>
   <string name="actionbar_upload">上传</string>
@@ -9,6 +10,7 @@
   <string name="actionbar_mkdir">创建目录</string>
   <string name="actionbar_settings">设置</string>
   <string name="actionbar_see_details">详细信息</string>
+  <string name="actionbar_send_file">发送</string>
   <string name="prefs_category_general">常规</string>
   <string name="prefs_category_more">更多</string>
   <string name="prefs_accounts">账号</string>
@@ -18,7 +20,9 @@
   <string name="prefs_instant_upload">开启即时上传</string>
   <string name="prefs_instant_upload_summary">即时上传相机拍摄的照片</string>
   <string name="prefs_log_title">开启日志</string>
+  <string name="prefs_log_summary">这过去是日志问题</string>
   <string name="prefs_log_title_history">日志历史</string>
+  <string name="prefs_log_summary_history">这显示已经保存的日志</string>
   <string name="prefs_log_delete_history_button">删除历史</string>
   <string name="prefs_help">帮助</string>
   <string name="prefs_feedback">反馈</string>
@@ -26,6 +30,7 @@
   <string name="auth_check_server">检查服务器</string>
   <string name="auth_username">用户名</string>
   <string name="auth_password">密码</string>
+  <string name="auth_register">新增到 %1$s?</string>
   <string name="sync_string_files">文件</string>
   <string name="setup_btn_connect">连接</string>
   <string name="uploader_btn_upload_text">上传</string>
   <string name="filedetails_created">创建于:</string>
   <string name="filedetails_modified">已修改:</string>
   <string name="filedetails_download">下载</string>
+  <string name="filedetails_sync_file">刷新文件</string>
   <string name="filedetails_renamed_in_upload_msg">上传过程中文件被更名为了 %1$s</string>
+  <string name="action_share_file">分享链接</string>
+  <string name="action_unshare_file">取消共享链接</string>
   <string name="common_yes">是</string>
   <string name="common_no">否</string>
   <string name="common_ok">OK</string>
@@ -85,7 +93,6 @@
   <string name="sync_fail_in_favourites_content">无法同步 %1$d 文件内容(与 %2$d 冲突)</string>
   <string name="sync_foreign_files_forgotten_ticker">某些本地文件已被遗忘</string>
   <string name="sync_foreign_files_forgotten_content">%2$s目录中的%1$d个文件不能被复制到</string>
-  <string name="sync_foreign_files_forgotten_explanation">\"从 1.3.16 版起,从此设备上传的文件将被复制到本地的 %1$s 文件夹来防止当某个单一文件在多个账户间同步造成的数据损失。由于此项变化,此应用之前的版本上传的全部文件都已被复制到了 %2$s 文件夹。然而,账户同步期间有一个错误阻止了此操作的完成。您或许可以保持文件不动,并移除指向 %3$s 的链接,或将文件移动到 %1$s 文件夹中并将保持到 %4$s 的链接。下面列出的是本地文件,以及它们被链接到的 %5$s 中的远程文件。</string>
   <string name="foreign_files_move">移动所有</string>
   <string name="foreign_files_success">所有文件已被移动</string>
   <string name="foreign_files_fail">某些文件无法被移动</string>
   <string name="auth_wrong_connection_title">无法建立连接</string>
   <string name="auth_secure_connection">加密连接已建立</string>
   <string name="auth_unauthorized">用户名或密码错误!</string>
+  <string name="auth_oauth_error">认证不成功</string>
+  <string name="auth_oauth_error_access_denied">访问被认证服务器拒绝</string>
+  <string name="auth_wtf_reenter_URL">意外状态;请再次输入服务器的地址</string>
   <string name="auth_expired_basic_auth_toast">请输入当前密码:</string>
   <string name="fd_keep_in_sync">保证文件更新</string>
   <string name="common_rename">重命名</string>
   <string name="wait_a_moment">请稍候</string>
   <string name="filedisplay_unexpected_bad_get_content">未知问题;请试试用其他程序选择此文件</string>
   <string name="filedisplay_no_file_selected">未选择文件。</string>
+  <string name="activity_chooser_title">发送链接给 …</string>
+  <string name="oauth_login_connection">连接oAuth2 服务器...</string>
   <string name="ssl_validator_header">站点身份无法验证</string>
   <string name="ssl_validator_reason_cert_not_trusted">不受信任的服务器证书</string>
   <string name="ssl_validator_reason_cert_expired">服务器证书过期</string>
   <string name="failed_upload_retry_do_nothing_text">不在线时不开启即时上传</string>
   <string name="failed_upload_failure_text">失败消息</string>
   <string name="failed_upload_quota_exceeded_text">请检查服务器设置。可能走出配额。</string>
+  <string name="share_link_no_support_share_api">对不起,共享服务功能未开启,请联系管理员</string>
+  <string name="share_link_file_no_exist">无法共享该文件或目录,请确定该文件或目录存在</string>
+  <string name="share_link_file_error">共享文件或目录出错</string>
+  <string name="unshare_link_file_error">解除文件或目录共享时出错</string>
+  <string name="activity_chooser_send_file_title">发送</string>
+  <string name="clipboard_text_copied">复制到剪贴板</string>
 </resources>
index c119564..ed56719 100644 (file)
@@ -4,6 +4,7 @@
   <string name="actionbar_upload_files">文件</string>
   <string name="actionbar_mkdir">建立目錄</string>
   <string name="actionbar_settings">設定</string>
+  <string name="actionbar_send_file">傳送</string>
   <string name="prefs_category_general">一般</string>
   <string name="prefs_accounts">帳號</string>
   <string name="prefs_help">幫助</string>
@@ -28,4 +29,5 @@
   <string name="common_error">錯誤</string>
   <string name="uploader_info_dirname">目錄名稱</string>
   <string name="common_choose_account">選擇帳戶</string>
+  <string name="activity_chooser_send_file_title">傳送</string>
 </resources>
index bc0a255..522be53 100644 (file)
@@ -10,6 +10,7 @@
   <string name="actionbar_mkdir">建立目錄</string>
   <string name="actionbar_settings">設定</string>
   <string name="actionbar_see_details">詳細資料</string>
+  <string name="actionbar_send_file">寄出</string>
   <string name="prefs_category_general">一般</string>
   <string name="prefs_category_more">更多</string>
   <string name="prefs_accounts">帳號</string>
   <string name="prefs_log_summary_history">顯示之前的記錄檔</string>
   <string name="prefs_log_delete_history_button">刪除歷史記錄</string>
   <string name="prefs_help">說明</string>
+  <string name="prefs_recommend">推薦給朋友</string>
   <string name="prefs_feedback">反饋</string>
   <string name="prefs_imprint">法律聲明</string>
+  <string name="recommend_subject">在您的手機中試用%1$s!</string>
   <string name="auth_check_server">檢查伺服器</string>
+  <string name="auth_host_url">伺服器位址 https://...</string>
   <string name="auth_username">使用者名稱</string>
   <string name="auth_password">密碼</string>
   <string name="auth_register">新增到 %1$s?</string>
@@ -51,6 +55,8 @@
   <string name="filedetails_download">下載</string>
   <string name="filedetails_sync_file">更新檔案列表</string>
   <string name="filedetails_renamed_in_upload_msg">檔案名稱在上傳時已被更改為 %1$s</string>
+  <string name="action_share_file">分享連結</string>
+  <string name="action_unshare_file">取消共享連結</string>
   <string name="common_yes">是</string>
   <string name="common_no">否</string>
   <string name="common_ok">好</string>
@@ -90,7 +96,7 @@
   <string name="sync_fail_in_favourites_content">%1$d 未被同步 (%2$d 衝突)</string>
   <string name="sync_foreign_files_forgotten_ticker">有些本地端的檔案已遺失</string>
   <string name="sync_foreign_files_forgotten_content">%1$d 檔案於 %2$s 目錄未被複製</string>
-  <string name="sync_foreign_files_forgotten_explanation">在 1.3.16 之前, 檔案上傳到本地的 %1$s 目錄以避免在多帳戶內同步造成遺失.\n\n由於這個改變, 所以在之前版本上傳的檔案被複製到 %2$s 目錄中. 為了避免同步發生問題. 你可以保留那些檔案並刪除連結 %3$s, 或搬移檔案到 %1$s 目錄並取得連結到 %4$s.\n\n下面列表是本地檔案, 與被連結遠端檔案 %5$s.</string>
+  <string name="sync_current_folder_was_removed">資料夾 %1$s 不存在</string>
   <string name="foreign_files_move">移動全部</string>
   <string name="foreign_files_success">所有文件已被移動</string>
   <string name="foreign_files_fail">部份文件無法被移動</string>
   <string name="media_err_unsupported">未支援的媒體編碼</string>
   <string name="media_err_io">無法讀取媒體檔案</string>
   <string name="media_err_malformed">媒體檔案未被正確的編碼</string>
+  <string name="media_err_timeout">嘗試播放時逾時</string>
   <string name="media_err_invalid_progressive_playback">媒體檔案無法在網路播放</string>
   <string name="media_err_unknown">媒體檔案無法在正常的播放軟體播放</string>
   <string name="media_err_security_ex">在播放 %1$s 時發生安全性的錯誤</string>
   <string name="auth_timeout_title">伺服器回應逾時</string>
   <string name="auth_incorrect_address_title">URL 不正確</string>
   <string name="auth_ssl_general_error_title">SSL 初始化失敗</string>
+  <string name="auth_ssl_unverified_server_title">無法驗證 SSL 伺服器身份</string>
   <string name="auth_bad_oc_version_title">無法辨識的伺服器版本</string>
   <string name="auth_wrong_connection_title">無法建立連線</string>
   <string name="auth_secure_connection">安全連線已建立</string>
   <string name="auth_oauth_error_access_denied">被授登伺服器拒絕登入</string>
   <string name="auth_wtf_reenter_URL">未知的狀態; 請再輸入一次伺服器的名稱</string>
   <string name="auth_expired_basic_auth_toast">請輸入目錄的密碼</string>
+  <string name="auth_expired_saml_sso_token_toast">您的連接已逾期. 請重新連線.</string>
+  <string name="auth_connecting_auth_server">連線到認證伺服器...</string>
+  <string name="auth_unsupported_auth_method">伺服器不支援這種認證方式</string>
+  <string name="auth_unsupported_multiaccount">%1$s 不支援複數賬戶</string>
   <string name="fd_keep_in_sync">讓檔案保持最新的</string>
   <string name="common_rename">重新命名</string>
   <string name="common_remove">移除</string>
   <string name="sync_file_fail_msg">無法檢查遠端的檔案</string>
   <string name="sync_file_nothing_to_do_msg">檔案與同步</string>
   <string name="create_dir_fail_msg">資料夾無法被建立</string>
+  <string name="filename_forbidden_characters">禁止使用字符: / \\ &lt; &gt; : \" | ? *</string>
   <string name="wait_a_moment">請稍後</string>
   <string name="filedisplay_unexpected_bad_get_content">未知的問題; 請選擇其他程式開啟檔案</string>
   <string name="filedisplay_no_file_selected">沒有挑選檔案</string>
+  <string name="activity_chooser_title">傳送連結至 ...</string>
+  <string name="oauth_check_onoff">以 oAuth2 方式登入</string>
   <string name="oauth_login_connection">連線到 oAuth2 伺服器…</string>
   <string name="ssl_validator_header">這個網站的憑證無法被驗證</string>
   <string name="ssl_validator_reason_cert_not_trusted">- 這個伺服器使用未被信任的憑證</string>
   <string name="preview_image_description">圖片預覽</string>
   <string name="preview_image_error_unknown_format">無法顯示圖片</string>
   <string name="error__upload__local_file_not_copied">%1$s 無法被複製到本地目錄 %2$s</string>
+  <string name="actionbar_failed_instant_upload">即時上傳失敗</string>
   <string name="failed_upload_headline_text">即時上傳失敗</string>
   <string name="failed_upload_headline_hint">所有即時上傳失敗的記錄</string>
   <string name="failed_upload_all_cb">全部選取</string>
   <string name="failed_upload_retry_do_nothing_text">未連線, 所以無法使用上傳功能</string>
   <string name="failed_upload_failure_text">失敗訊息: </string>
   <string name="failed_upload_quota_exceeded_text">請檢查你的伺服器設定, 可能你的額度已超過.</string>
+  <string name="activity_chooser_send_file_title">寄出</string>
+  <string name="copy_link">複製連結</string>
+  <string name="clipboard_text_copied">複製至剪貼簿中</string>
 </resources>
index 226b618..932612e 100644 (file)
@@ -8,17 +8,23 @@
     <string name ="db_name">ownCloud</string>
     <string name ="data_folder">owncloud</string>
     <string name ="log_name">Owncloud_</string>
+    <string name ="default_display_name_for_root_folder">ownCloud</string>
     
     <!-- URLs and flags related -->
     <string name="server_url"></string>
     <bool name="show_server_url_input">true</bool>
     <bool name="show_welcome_link">true</bool>
        <string name="welcome_link_url">"https://owncloud.com/mobile/new"</string>
+       <string name="share_api_link"></string>
     
     <!-- Flags to setup the authentication methods available in the app -->
     <string name="auth_method_oauth2">off</string>
     <string name="auth_method_saml_web_sso">off</string>
     
+    <!-- Flags to enable/disable some features -->
+    <string name = "send_files_to_other_apps">on</string>
+    
+    
     <!-- Colors -->
     <color name="login_background_color">#FFFFFF</color>
     <color name="login_logo_background_color">#FFFFFF</color>
     <bool name="multiaccount_support">true</bool>
     
     <!-- Help, imprint and feedback -->
-    <bool name="help_enabled">false</bool>
+    <bool name="help_enabled">true</bool>
     <bool name="imprint_enabled">false</bool> 
-    <bool name="recommend_enabled">false</bool>
-    <bool name="feedback_enabled">false</bool>
-    <string name="url_help">https://owncloud.com/mobile/help</string>
+    <bool name="recommend_enabled">true</bool>
+    <bool name="feedback_enabled">true</bool>
+    <string name="url_help">http://owncloud.com/mobile/help</string>
     <string name="url_imprint"></string>
     <string name="mail_recommend">"mailto:"</string>
     <string name="mail_feedback">"mailto:apps@owncloud.com"</string>
index 2c06bb8..6967fd0 100644 (file)
@@ -11,7 +11,7 @@
     <string name="actionbar_mkdir">Create directory</string>
     <string name="actionbar_settings">Settings</string>
     <string name="actionbar_see_details">Details</string>
-    
+    <string name="actionbar_send_file">Send</string>
     <string name="prefs_category_general">General</string>
     <string name="prefs_category_more">More</string>
     <string name="prefs_accounts">Accounts</string>
@@ -59,6 +59,8 @@
     <string name="filedetails_download">Download</string>
     <string name="filedetails_sync_file">Refresh file</string>
     <string name="filedetails_renamed_in_upload_msg">File was renamed to %1$s during upload</string>
+    <string name="action_share_file">Share link</string>
+    <string name="action_unshare_file">Unshare link</string>
     <string name="common_yes">Yes</string>
     <string name="common_no">No</string>
     <string name="common_ok">OK</string>
     <string name="sync_fail_in_favourites_content">Contents of %1$d files could not be sync\'ed (%2$d conflicts)</string>
     <string name="sync_foreign_files_forgotten_ticker">Some local files were forgotten</string>
     <string name="sync_foreign_files_forgotten_content">%1$d files out of the %2$s directory could not be copied into</string>
-    <string name="sync_foreign_files_forgotten_explanation">As of version 1.3.16, files uploaded from this device are copied into the local %1$s folder to prevent data loss when a single file is synced with multiple accounts.\n\nDue to this change, all files uploaded in previous versions of this app were copied into the %2$s folder. However, an error prevented the completion of this operation during account synchronization. You may either leave the file(s) as is and remove the link to %3$s, or move the file(s) into the %1$s directory and retain the link to %4$s.\n\nListed below are the local file(s), and the the remote file(s) in %5$s they were linked to.</string>
+    <string name="sync_foreign_files_forgotten_explanation">As of version 1.3.16, files uploaded from this device are copied into the local %1$s folder to prevent data loss when a single file is synced with multiple accounts.\n\nDue to this change, all files uploaded in previous versions of this app were copied into the %2$s folder. However, an error prevented the completion of this operation during account synchronization. You may either leave the file(s) as is and remove the link to %3$s, or move the file(s) into the %1$s directory and retain the link to %4$s.\n\nListed below are the local file(s), and the remote file(s) in %5$s they were linked to.</string>
        <string name="sync_current_folder_was_removed">Folder %1$s does not exist anymore</string>    
     <string name="foreign_files_move">"Move all"</string>
     <string name="foreign_files_success">"All files were moved"</string>
        <string name="auth_connecting_auth_server">Connecting to authentication server…</string>
        <string name="auth_unsupported_auth_method">The server does not support this authentication method</string>    
        <string name="auth_unsupported_multiaccount">%1$s does not support multiple accounts</string>
+       <string name="auth_fail_get_user_name">Your server is not returning a correct user id, contact with your admin please</string>
     
     <string name="fd_keep_in_sync">Keep file up to date</string>
     <string name="common_rename">Rename</string>
     <string name="wait_a_moment">Wait a moment</string>
     <string name="filedisplay_unexpected_bad_get_content">"Unexpected problem ; please select the file from a different app"</string>
     <string name="filedisplay_no_file_selected">No file was selected</string>
+    <string name="activity_chooser_title">Send link to &#8230;</string>
     
     <string name="oauth_check_onoff">Login with oAuth2</string> 
     <string name="oauth_login_connection">Connecting to oAuth2 server…</string>    
        <string name="ssl_validator_label_validity_to">To:</string>
        <string name="ssl_validator_label_signature">Signature:</string>
        <string name="ssl_validator_label_signature_algorithm">Algorithm:</string>
+       <string name="ssl_validator_null_cert">The certificate could not be shown.</string>
+       <string name="ssl_validator_no_info_about_error">- No information about the error</string>
                        
     <string name="placeholder_sentence">This is a placeholder</string>
     <string name="placeholder_filename">placeholder.txt</string>
     <string name="failed_upload_retry_do_nothing_text">do nothing you are not online for instant upload</string>
        <string name="failed_upload_failure_text">Failure Message: </string>
        <string name="failed_upload_quota_exceeded_text">Please check your server configuration,maybe your quota is exceeded.</string>
+       
+       <string name="share_link_no_support_share_api">Sorry, sharing is not enabled on your server. Please contact your administrator.</string>
+       <string name="share_link_file_no_exist">Unable to share this file or folder. Please, make sure it exists</string>
+       <string name="share_link_file_error">An error occurred while trying to share this file or folder</string>
+       <string name="unshare_link_file_no_exist">Unable to unshare this file or folder. It does not exist.</string>
+       <string name="unshare_link_file_error">An error occurred while trying to unshare this file or folder</string>
+
+       <string name="activity_chooser_send_file_title">Send</string>
+
+       <string name="copy_link">Copy link</string>     
+       <string name="clipboard_text_copied">Copied to clipboard</string>
 </resources>
index 034ca5c..c65cbad 100644 (file)
@@ -59,7 +59,7 @@
        </style>
 
        <!-- Dialogs -->
-       <style name="Theme.ownCloud.Dialog" parent="style/Theme.Sherlock.Light.Dialog">
+       <style name="Theme.ownCloud.Dialog" parent="@android:style/Theme.Dialog">
        </style>
        
        <!-- PopDownMenu -->
index d5b78c9..dc44a12 100644 (file)
@@ -1,7 +1,7 @@
 call git submodule init
 call git submodule update
 call android.bat update project -p actionbarsherlock\library -n ActionBarSherlock
-call android.bat update project -p oc_framework -n ownCloudFramework
+call android.bat update lib-project -p owncloud-android-library
 call android.bat update project -p .
 call android.bat update project -p oc_jb_workaround
 copy /Y third_party\android-support-library\android-support-v4.jar actionbarsherlock\library\libs\android-support-v4.jar
index b13fe81..e604752 100755 (executable)
@@ -3,7 +3,7 @@
 git submodule init
 git submodule update
 android update project -p actionbarsherlock/library -n ActionBarSherlock
-android update project -p oc_framework -n ownCloudFramework
+android update lib-project -p owncloud-android-library
 android update project -p .
 android update project -p oc_jb_workaround
 cp third_party/android-support-library/android-support-v4.jar actionbarsherlock/library/libs/android-support-v4.jar 
index 78a8575..5c03fe1 100644 (file)
@@ -28,7 +28,7 @@ import android.os.Bundle;
 import android.os.Handler;
 import android.widget.Toast;
 
-import com.owncloud.android.oc_framework.accounts.AccountTypeUtils;
+import com.owncloud.android.lib.common.accounts.AccountTypeUtils;
 import com.owncloud.android.utils.Log_OC;
 
 
index 33c7e6a..10c8796 100644 (file)
@@ -19,8 +19,8 @@
 package com.owncloud.android.authentication;\r
 \r
 import com.owncloud.android.MainApp;\r
-import com.owncloud.android.oc_framework.accounts.AccountTypeUtils;\r
-import com.owncloud.android.oc_framework.utils.OwnCloudVersion;\r
+import com.owncloud.android.lib.common.accounts.AccountTypeUtils;\r
+import com.owncloud.android.lib.resources.status.OwnCloudVersion;\r
 \r
 import android.accounts.Account;\r
 import android.accounts.AccountManager;\r
index ad40a06..9dcddce 100644 (file)
@@ -18,6 +18,8 @@
 \r
 package com.owncloud.android.authentication;\r
 \r
+import java.security.cert.X509Certificate;\r
+\r
 import android.accounts.Account;\r
 import android.accounts.AccountManager;\r
 import android.app.AlertDialog;\r
@@ -29,10 +31,13 @@ import android.content.SharedPreferences;
 import android.graphics.Rect;\r
 import android.graphics.drawable.Drawable;\r
 import android.net.Uri;\r
+import android.net.http.SslError;\r
 import android.os.Bundle;\r
 import android.os.Handler;\r
 import android.preference.PreferenceManager;\r
 import android.support.v4.app.Fragment;\r
+import android.support.v4.app.FragmentManager;\r
+import android.support.v4.app.FragmentTransaction;\r
 import android.text.Editable;\r
 import android.text.InputType;\r
 import android.text.TextWatcher;\r
@@ -43,6 +48,7 @@ import android.view.View.OnFocusChangeListener;
 import android.view.View.OnTouchListener;\r
 import android.view.Window;\r
 import android.view.inputmethod.EditorInfo;\r
+import android.webkit.SslErrorHandler;\r
 import android.widget.Button;\r
 import android.widget.CheckBox;\r
 import android.widget.EditText;\r
@@ -53,23 +59,26 @@ import com.actionbarsherlock.app.SherlockDialogFragment;
 import com.owncloud.android.MainApp;\r
 import com.owncloud.android.R;\r
 import com.owncloud.android.authentication.SsoWebViewClient.SsoWebViewClientListener;\r
-import com.owncloud.android.oc_framework.accounts.AccountTypeUtils;\r
-import com.owncloud.android.oc_framework.accounts.OwnCloudAccount;\r
-import com.owncloud.android.oc_framework.network.webdav.OwnCloudClientFactory;\r
-import com.owncloud.android.oc_framework.network.webdav.WebdavClient;\r
+import com.owncloud.android.lib.common.accounts.AccountTypeUtils;\r
+import com.owncloud.android.lib.common.accounts.AccountUtils.Constants;\r
+import com.owncloud.android.lib.common.OwnCloudClientFactory;\r
+import com.owncloud.android.lib.common.OwnCloudClient;\r
 import com.owncloud.android.operations.OAuth2GetAccessToken;\r
-import com.owncloud.android.oc_framework.operations.OnRemoteOperationListener;\r
-import com.owncloud.android.operations.OwnCloudServerCheckOperation;\r
-import com.owncloud.android.oc_framework.operations.RemoteOperation;\r
-import com.owncloud.android.oc_framework.operations.RemoteOperationResult;\r
-import com.owncloud.android.oc_framework.operations.RemoteOperationResult.ResultCode;\r
-import com.owncloud.android.oc_framework.operations.remote.ExistenceCheckRemoteOperation;\r
-import com.owncloud.android.oc_framework.operations.remote.GetUserNameRemoteOperation;\r
+
+import com.owncloud.android.lib.common.network.CertificateCombinedException;\r
+import com.owncloud.android.lib.common.operations.OnRemoteOperationListener;\r
+import com.owncloud.android.lib.resources.status.GetRemoteStatusOperation;\r
+import com.owncloud.android.lib.common.operations.RemoteOperation;\r
+import com.owncloud.android.lib.common.operations.RemoteOperationResult;\r
+import com.owncloud.android.lib.common.operations.RemoteOperationResult.ResultCode;\r
+import com.owncloud.android.lib.resources.files.ExistenceCheckRemoteOperation;\r
+import com.owncloud.android.lib.resources.users.GetRemoteUserNameOperation;\r
+
 import com.owncloud.android.ui.dialog.SamlWebViewDialog;\r
-import com.owncloud.android.ui.dialog.SslValidatorDialog;\r
-import com.owncloud.android.ui.dialog.SslValidatorDialog.OnSslValidatorListener;\r
+import com.owncloud.android.ui.dialog.SslUntrustedCertDialog;\r
+import com.owncloud.android.ui.dialog.SslUntrustedCertDialog.OnSslUntrustedCertListener;\r
 import com.owncloud.android.utils.Log_OC;\r
-import com.owncloud.android.oc_framework.utils.OwnCloudVersion;\r
+import com.owncloud.android.lib.resources.status.OwnCloudVersion;\r
 \r
 /**\r
  * This Activity is used to add an ownCloud account to the App\r
@@ -78,7 +87,8 @@ import com.owncloud.android.oc_framework.utils.OwnCloudVersion;
  * @author David A. Velasco\r
  */\r
 public class AuthenticatorActivity extends AccountAuthenticatorActivity\r
-implements  OnRemoteOperationListener, OnSslValidatorListener, OnFocusChangeListener, OnEditorActionListener, SsoWebViewClientListener{\r
+    implements  OnRemoteOperationListener, OnFocusChangeListener, OnEditorActionListener, \r
+    SsoWebViewClientListener, OnSslUntrustedCertListener {\r
 \r
     private static final String TAG = AuthenticatorActivity.class.getSimpleName();\r
 \r
@@ -92,6 +102,7 @@ implements  OnRemoteOperationListener, OnSslValidatorListener, OnFocusChangeList
     private static final String KEY_AUTH_MESSAGE_TEXT = "AUTH_MESSAGE_TEXT";\r
     private static final String KEY_HOST_URL_TEXT = "HOST_URL_TEXT";\r
     private static final String KEY_OC_VERSION = "OC_VERSION";\r
+    private static final String KEY_OC_VERSION_STRING = "OC_VERSION_STRING";\r
     private static final String KEY_ACCOUNT = "ACCOUNT";\r
     private static final String KEY_SERVER_VALID = "SERVER_VALID";\r
     private static final String KEY_SERVER_CHECKED = "SERVER_CHECKED";\r
@@ -103,15 +114,15 @@ implements  OnRemoteOperationListener, OnSslValidatorListener, OnFocusChangeList
     private static final String KEY_AUTH_STATUS_TEXT = "AUTH_STATUS_TEXT";\r
     private static final String KEY_AUTH_STATUS_ICON = "AUTH_STATUS_ICON";\r
     private static final String KEY_REFRESH_BUTTON_ENABLED = "KEY_REFRESH_BUTTON_ENABLED";\r
+    //private static final String KEY_IS_SHARED_SUPPORTED = "KEY_IS_SHARE_SUPPORTED";\r
 \r
     private static final String AUTH_ON = "on";\r
     private static final String AUTH_OFF = "off";\r
     private static final String AUTH_OPTIONAL = "optional";\r
     \r
     private static final int DIALOG_LOGIN_PROGRESS = 0;\r
-    private static final int DIALOG_SSL_VALIDATOR = 1;\r
-    private static final int DIALOG_CERT_NOT_SAVED = 2;\r
-    private static final int DIALOG_OAUTH2_LOGIN_PROGRESS = 3;\r
+    private static final int DIALOG_CERT_NOT_SAVED = 1;\r
+    private static final int DIALOG_OAUTH2_LOGIN_PROGRESS = 2;\r
 \r
     public static final byte ACTION_CREATE = 0;\r
     public static final byte ACTION_UPDATE_TOKEN = 1;\r
@@ -129,9 +140,8 @@ implements  OnRemoteOperationListener, OnSslValidatorListener, OnFocusChangeList
 \r
     private final Handler mHandler = new Handler();\r
     private Thread mOperationThread;\r
-    private OwnCloudServerCheckOperation mOcServerChkOperation;\r
+    private GetRemoteStatusOperation mOcServerChkOperation;\r
     private ExistenceCheckRemoteOperation mAuthCheckOperation;\r
-    private RemoteOperationResult mLastSslUntrustedServerResult;\r
 \r
     private Uri mNewCapturedUriFromOAuth2Redirection;\r
 \r
@@ -164,6 +174,8 @@ implements  OnRemoteOperationListener, OnSslValidatorListener, OnFocusChangeList
     \r
     private boolean mResumed; // Control if activity is resumed\r
 \r
+    public static String DIALOG_UNTRUSTED_CERT = "DIALOG_UNTRUSTED_CERT";\r
+\r
 \r
     /**\r
      * {@inheritDoc}\r
@@ -233,15 +245,17 @@ implements  OnRemoteOperationListener, OnSslValidatorListener, OnFocusChangeList
 \r
             /// retrieve extras from intent\r
             mAccount = getIntent().getExtras().getParcelable(EXTRA_ACCOUNT);\r
-            if (mAccount != null) {\r
-                String ocVersion = mAccountMgr.getUserData(mAccount, OwnCloudAccount.Constants.KEY_OC_VERSION);\r
+            if (mAccount != null) {
+                String ocVersion = mAccountMgr.getUserData(mAccount, Constants.KEY_OC_VERSION);\r
+                String ocVersionString = mAccountMgr.getUserData(mAccount, Constants.KEY_OC_VERSION_STRING);
                 if (ocVersion != null) {\r
-                    mDiscoveredVersion = new OwnCloudVersion(ocVersion);\r
+                    mDiscoveredVersion = new OwnCloudVersion(ocVersion, ocVersionString);\r
                 }\r
-                mHostBaseUrl = normalizeUrl(mAccountMgr.getUserData(mAccount, OwnCloudAccount.Constants.KEY_OC_BASE_URL));\r
+                mHostBaseUrl = normalizeUrl(mAccountMgr.getUserData(mAccount, Constants.KEY_OC_BASE_URL));\r
                 mHostUrlInput.setText(mHostBaseUrl);\r
                 String userName = mAccount.name.substring(0, mAccount.name.lastIndexOf('@'));\r
-                mUsernameInput.setText(userName);\r
+                mUsernameInput.setText(userName);
+                \r
             }\r
             initAuthorizationMethod();  // checks intent and setup.xml to determine mCurrentAuthorizationMethod\r
             mJustCreated = true;\r
@@ -268,8 +282,9 @@ implements  OnRemoteOperationListener, OnSslValidatorListener, OnFocusChangeList
             \r
             /// server data\r
             String ocVersion = savedInstanceState.getString(KEY_OC_VERSION);\r
+            String ocVersionString = savedInstanceState.getString(KEY_OC_VERSION_STRING);\r
             if (ocVersion != null) {\r
-                mDiscoveredVersion = new OwnCloudVersion(ocVersion);\r
+                mDiscoveredVersion = new OwnCloudVersion(ocVersion, ocVersionString);\r
             }\r
             mHostBaseUrl = savedInstanceState.getString(KEY_HOST_URL_TEXT);\r
 \r
@@ -391,8 +406,8 @@ implements  OnRemoteOperationListener, OnSslValidatorListener, OnFocusChangeList
         if (mAuthTokenType == null) {    \r
             if (mAccount != null) {\r
                 /// same authentication method than the one used to create the account to update\r
-                oAuthRequired = (mAccountMgr.getUserData(mAccount, OwnCloudAccount.Constants.KEY_SUPPORTS_OAUTH2) != null);\r
-                samlWebSsoRequired = (mAccountMgr.getUserData(mAccount, OwnCloudAccount.Constants.KEY_SUPPORTS_SAML_WEB_SSO) != null);\r
+                oAuthRequired = (mAccountMgr.getUserData(mAccount, Constants.KEY_SUPPORTS_OAUTH2) != null);\r
+                samlWebSsoRequired = (mAccountMgr.getUserData(mAccount, Constants.KEY_SUPPORTS_SAML_WEB_SSO) != null);\r
             \r
             } else {\r
                 /// use the one set in setup.xml\r
@@ -444,7 +459,8 @@ implements  OnRemoteOperationListener, OnSslValidatorListener, OnFocusChangeList
 \r
         /// server data\r
         if (mDiscoveredVersion != null) {\r
-            outState.putString(KEY_OC_VERSION, mDiscoveredVersion.toString());\r
+            outState.putString(KEY_OC_VERSION, mDiscoveredVersion.getVersion());\r
+            outState.putString(KEY_OC_VERSION_STRING, mDiscoveredVersion.getVersionString());\r
         }\r
         outState.putString(KEY_HOST_URL_TEXT, mHostBaseUrl);\r
 \r
@@ -524,8 +540,8 @@ implements  OnRemoteOperationListener, OnSslValidatorListener, OnFocusChangeList
                 getString(R.string.oauth2_redirect_uri),       \r
                 getString(R.string.oauth2_grant_type),\r
                 queryParameters);\r
-        //WebdavClient client = OwnCloudClientUtils.createOwnCloudClient(Uri.parse(getString(R.string.oauth2_url_endpoint_access)), getApplicationContext());\r
-        WebdavClient client = OwnCloudClientFactory.createOwnCloudClient(Uri.parse(mOAuthTokenEndpointText.getText().toString().trim()), getApplicationContext(), true);\r
+        //OwnCloudClient client = OwnCloudClientUtils.createOwnCloudClient(Uri.parse(getString(R.string.oauth2_url_endpoint_access)), getApplicationContext());\r
+        OwnCloudClient client = OwnCloudClientFactory.createOwnCloudClient(Uri.parse(mOAuthTokenEndpointText.getText().toString().trim()), getApplicationContext(), true);\r
         operation.execute(client, this, mHandler);\r
     }\r
 \r
@@ -588,8 +604,8 @@ implements  OnRemoteOperationListener, OnSslValidatorListener, OnFocusChangeList
             mServerStatusText = R.string.auth_testing_connection;\r
             mServerStatusIcon = R.drawable.progress_small;\r
             showServerStatus();\r
-            mOcServerChkOperation = new  OwnCloudServerCheckOperation(uri, this);\r
-            WebdavClient client = OwnCloudClientFactory.createOwnCloudClient(Uri.parse(uri), this, true);\r
+            mOcServerChkOperation = new  GetRemoteStatusOperation(uri, this);\r
+            OwnCloudClient client = OwnCloudClientFactory.createOwnCloudClient(Uri.parse(uri), this, true);\r
             mOperationThread = mOcServerChkOperation.execute(client, this, mHandler);\r
         } else {\r
             mServerStatusText = 0;\r
@@ -716,7 +732,7 @@ implements  OnRemoteOperationListener, OnSslValidatorListener, OnFocusChangeList
 \r
         /// test credentials accessing the root folder\r
         mAuthCheckOperation = new  ExistenceCheckRemoteOperation("", this, false);\r
-        WebdavClient client = OwnCloudClientFactory.createOwnCloudClient(Uri.parse(mHostBaseUrl + webdav_path), this, true);\r
+        OwnCloudClient client = OwnCloudClientFactory.createOwnCloudClient(Uri.parse(mHostBaseUrl + webdav_path), this, true);\r
         client.setBasicCredentials(username, password);\r
         mOperationThread = mAuthCheckOperation.execute(client, this, mHandler);\r
     }\r
@@ -765,7 +781,7 @@ implements  OnRemoteOperationListener, OnSslValidatorListener, OnFocusChangeList
 \r
         /// test credentials accessing the root folder\r
         mAuthCheckOperation = new  ExistenceCheckRemoteOperation("", this, false);\r
-        WebdavClient client = OwnCloudClientFactory.createOwnCloudClient(Uri.parse(mHostBaseUrl + webdav_path), this, false);\r
+        OwnCloudClient client = OwnCloudClientFactory.createOwnCloudClient(Uri.parse(mHostBaseUrl + webdav_path), this, false);\r
         mOperationThread = mAuthCheckOperation.execute(client, this, mHandler);\r
       \r
     }\r
@@ -778,8 +794,8 @@ implements  OnRemoteOperationListener, OnSslValidatorListener, OnFocusChangeList
     @Override\r
     public void onRemoteOperationFinish(RemoteOperation operation, RemoteOperationResult result) {\r
 \r
-        if (operation instanceof OwnCloudServerCheckOperation) {\r
-            onOcServerCheckFinish((OwnCloudServerCheckOperation) operation, result);\r
+        if (operation instanceof GetRemoteStatusOperation) {\r
+            onOcServerCheckFinish((GetRemoteStatusOperation) operation, result);\r
 \r
         } else if (operation instanceof OAuth2GetAccessToken) {\r
             onGetOAuthAccessTokenFinish((OAuth2GetAccessToken)operation, result);\r
@@ -791,14 +807,15 @@ implements  OnRemoteOperationListener, OnSslValidatorListener, OnFocusChangeList
             } else {\r
                 onAuthorizationCheckFinish((ExistenceCheckRemoteOperation)operation, result);\r
             }\r
-        } else if (operation instanceof GetUserNameRemoteOperation) {\r
-            onGetUserNameFinish((GetUserNameRemoteOperation) operation, result);\r
+        } else if (operation instanceof GetRemoteUserNameOperation) {\r
+            onGetUserNameFinish((GetRemoteUserNameOperation) operation, result);\r
              \r
         }\r
         \r
     }\r
 \r
-    private void onGetUserNameFinish(GetUserNameRemoteOperation operation, RemoteOperationResult result) {\r
+    private void onGetUserNameFinish(GetRemoteUserNameOperation operation, RemoteOperationResult result) {\r
+        \r
         if (result.isSuccess()) {\r
             boolean success = false;\r
             String username = operation.getUserName();\r
@@ -822,6 +839,10 @@ implements  OnRemoteOperationListener, OnSslValidatorListener, OnFocusChangeList
             \r
             if (success)\r
                 finish();\r
+        } else {\r
+            updateStatusIconFailUserName();\r
+            showAuthStatus();\r
+            Log_OC.e(TAG, "Access to user name failed: " + result.getLogMessage());\r
         }\r
         \r
     }\r
@@ -861,7 +882,7 @@ implements  OnRemoteOperationListener, OnSslValidatorListener, OnFocusChangeList
      * @param operation     Server check performed.\r
      * @param result        Result of the check.\r
      */\r
-    private void onOcServerCheckFinish(OwnCloudServerCheckOperation operation, RemoteOperationResult result) {\r
+    private void onOcServerCheckFinish(GetRemoteStatusOperation operation, RemoteOperationResult result) {\r
         if (operation.equals(mOcServerChkOperation)) {\r
             /// save result state\r
             mServerIsChecked = true;\r
@@ -880,8 +901,7 @@ implements  OnRemoteOperationListener, OnSslValidatorListener, OnFocusChangeList
 \r
             /// very special case (TODO: move to a common place for all the remote operations)\r
             if (result.getCode() == ResultCode.SSL_RECOVERABLE_PEER_UNVERIFIED) {\r
-                mLastSslUntrustedServerResult = result;\r
-                showDialog(DIALOG_SSL_VALIDATOR); \r
+                showUntrustedCertDialog(result);\r
             }\r
 \r
             /// retrieve discovered version and normalize server URL\r
@@ -890,7 +910,7 @@ implements  OnRemoteOperationListener, OnSslValidatorListener, OnFocusChangeList
 \r
             /// allow or not the user try to access the server\r
             mOkButton.setEnabled(mServerIsValid);\r
-\r
+            \r
         }   // else nothing ; only the last check operation is considered; \r
         // multiple can be triggered if the user amends a URL before a previous check can be triggered\r
     }\r
@@ -1092,6 +1112,11 @@ implements  OnRemoteOperationListener, OnSslValidatorListener, OnFocusChangeList
     }\r
 \r
 \r
+    private void updateStatusIconFailUserName(){\r
+        mAuthStatusIcon = android.R.drawable.ic_secure;\r
+        mAuthStatusText = R.string.auth_fail_get_user_name;\r
+    }\r
+    \r
     /**\r
      * Processes the result of the request for and access token send \r
      * to an OAuth authorization server.\r
@@ -1115,7 +1140,7 @@ implements  OnRemoteOperationListener, OnSslValidatorListener, OnFocusChangeList
             mAuthToken = ((OAuth2GetAccessToken)operation).getResultTokenMap().get(OAuth2Constants.KEY_ACCESS_TOKEN);\r
             Log_OC.d(TAG, "Got ACCESS TOKEN: " + mAuthToken);\r
             mAuthCheckOperation = new ExistenceCheckRemoteOperation("", this, false);\r
-            WebdavClient client = OwnCloudClientFactory.createOwnCloudClient(Uri.parse(mHostBaseUrl + webdav_path), this, true);\r
+            OwnCloudClient client = OwnCloudClientFactory.createOwnCloudClient(Uri.parse(mHostBaseUrl + webdav_path), this, true);\r
             client.setBearerCredentials(mAuthToken);\r
             mAuthCheckOperation.execute(client, this, mHandler);\r
 \r
@@ -1180,8 +1205,7 @@ implements  OnRemoteOperationListener, OnSslValidatorListener, OnFocusChangeList
 \r
             // very special case (TODO: move to a common place for all the remote operations) (dangerous here?)\r
             if (result.getCode() == ResultCode.SSL_RECOVERABLE_PEER_UNVERIFIED) {\r
-                mLastSslUntrustedServerResult = result;\r
-                showDialog(DIALOG_SSL_VALIDATOR); \r
+                showUntrustedCertDialog(result);\r
             }\r
 \r
         } else {    // authorization fail due to client side - probably wrong credentials\r
@@ -1280,13 +1304,15 @@ implements  OnRemoteOperationListener, OnSslValidatorListener, OnFocusChangeList
             if (isOAuth || isSaml) {\r
                 mAccountMgr.setAuthToken(mAccount, mAuthTokenType, mAuthToken);\r
             }\r
-            /// add user data to the new account; TODO probably can be done in the last parameter addAccountExplicitly, or in KEY_USERDATA\r
-            mAccountMgr.setUserData(mAccount, OwnCloudAccount.Constants.KEY_OC_VERSION,    mDiscoveredVersion.toString());\r
-            mAccountMgr.setUserData(mAccount, OwnCloudAccount.Constants.KEY_OC_BASE_URL,   mHostBaseUrl);\r
+            /// add user data to the new account; TODO probably can be done in the last parameter addAccountExplicitly, or in KEY_USERDATA
+            mAccountMgr.setUserData(mAccount, Constants.KEY_OC_VERSION,         mDiscoveredVersion.getVersion());\r
+            mAccountMgr.setUserData(mAccount, Constants.KEY_OC_VERSION_STRING,  mDiscoveredVersion.getVersionString());\r
+            mAccountMgr.setUserData(mAccount, Constants.KEY_OC_BASE_URL,   mHostBaseUrl);\r
+            
             if (isSaml) {\r
-                mAccountMgr.setUserData(mAccount, OwnCloudAccount.Constants.KEY_SUPPORTS_SAML_WEB_SSO, "TRUE"); \r
+                mAccountMgr.setUserData(mAccount, Constants.KEY_SUPPORTS_SAML_WEB_SSO, "TRUE"); \r
             } else if (isOAuth) {\r
-                mAccountMgr.setUserData(mAccount, OwnCloudAccount.Constants.KEY_SUPPORTS_OAUTH2, "TRUE");  \r
+                mAccountMgr.setUserData(mAccount, Constants.KEY_SUPPORTS_OAUTH2, "TRUE");  \r
             }\r
     \r
             setAccountAuthenticatorResult(intent.getExtras());\r
@@ -1311,10 +1337,6 @@ implements  OnRemoteOperationListener, OnSslValidatorListener, OnFocusChangeList
         case DIALOG_CERT_NOT_SAVED:\r
         case DIALOG_OAUTH2_LOGIN_PROGRESS:\r
             break;\r
-        case DIALOG_SSL_VALIDATOR: {\r
-            ((SslValidatorDialog)dialog).updateResult(mLastSslUntrustedServerResult);\r
-            break;\r
-        }\r
         default:\r
             Log_OC.e(TAG, "Incorrect dialog called with id = " + id);\r
         }\r
@@ -1365,11 +1387,6 @@ implements  OnRemoteOperationListener, OnSslValidatorListener, OnFocusChangeList
             dialog = working_dialog;\r
             break;\r
         }\r
-        case DIALOG_SSL_VALIDATOR: {\r
-            /// TODO start to use new dialog interface, at least for this (it is a FragmentDialog already)\r
-            dialog = SslValidatorDialog.newInstance(this, mLastSslUntrustedServerResult, this);\r
-            break;\r
-        }\r
         case DIALOG_CERT_NOT_SAVED: {\r
             AlertDialog.Builder builder = new AlertDialog.Builder(this);\r
             builder.setMessage(getResources().getString(R.string.ssl_validator_not_saved));\r
@@ -1520,23 +1537,6 @@ implements  OnRemoteOperationListener, OnSslValidatorListener, OnFocusChangeList
     }\r
     \r
     /**\r
-     * Called from SslValidatorDialog when a new server certificate was correctly saved.\r
-     */\r
-    public void onSavedCertificate() {\r
-        checkOcServer();\r
-    }\r
-\r
-    /**\r
-     * Called from SslValidatorDialog when a new server certificate could not be saved \r
-     * when the user requested it.\r
-     */\r
-    @Override\r
-    public void onFailedSavingCertificate() {\r
-        showDialog(DIALOG_CERT_NOT_SAVED);\r
-    }\r
-\r
-\r
-    /**\r
      *  Called when the 'action' button in an IME is pressed ('enter' in software keyboard).\r
      * \r
      *  Used to trigger the authentication check when the user presses 'enter' after writing the password, \r
@@ -1591,14 +1591,14 @@ implements  OnRemoteOperationListener, OnSslValidatorListener, OnFocusChangeList
     }\r
 \r
 \r
-    public void onSamlDialogSuccess(String sessionCookie){\r
+    public void onSamlDialogSuccess(String sessionCookie) {\r
         mAuthToken = sessionCookie;\r
         \r
         if (sessionCookie != null && sessionCookie.length() > 0) {\r
             mAuthToken = sessionCookie;\r
 \r
-            GetUserNameRemoteOperation getUserOperation = new GetUserNameRemoteOperation();            \r
-            WebdavClient client = OwnCloudClientFactory.createOwnCloudClient(Uri.parse(mHostBaseUrl), getApplicationContext(), true);\r
+            GetRemoteUserNameOperation getUserOperation = new GetRemoteUserNameOperation();            \r
+            OwnCloudClient client = OwnCloudClientFactory.createOwnCloudClient(Uri.parse(mHostBaseUrl), getApplicationContext(), true);\r
             client.setSsoSessionCookie(mAuthToken);\r
             getUserOperation.execute(client, this, mHandler);\r
         }\r
@@ -1650,5 +1650,86 @@ implements  OnRemoteOperationListener, OnSslValidatorListener, OnFocusChangeList
         }\r
         return super.onTouchEvent(event);\r
     }\r
+\r
+\r
+    /**\r
+     * Show untrusted cert dialog \r
+     */\r
+    public void showUntrustedCertDialog(X509Certificate x509Certificate, SslError error, SslErrorHandler handler) {\r
+        // Show a dialog with the certificate info\r
+        SslUntrustedCertDialog dialog = null;\r
+        if (x509Certificate == null) {\r
+            dialog = SslUntrustedCertDialog.newInstanceForEmptySslError(error, handler);\r
+        } else {\r
+            dialog = SslUntrustedCertDialog.newInstanceForFullSslError(x509Certificate, error, handler);\r
+        }\r
+        FragmentManager fm = getSupportFragmentManager();\r
+        FragmentTransaction ft = fm.beginTransaction();\r
+        ft.addToBackStack(null);\r
+        dialog.show(ft, DIALOG_UNTRUSTED_CERT);\r
+    }\r
+    \r
+    /**\r
+     * Show untrusted cert dialog \r
+     */\r
+    public void showUntrustedCertDialog(RemoteOperationResult result) {\r
+        // Show a dialog with the certificate info\r
+        SslUntrustedCertDialog dialog = SslUntrustedCertDialog.newInstanceForFullSslError((CertificateCombinedException)result.getException());\r
+        FragmentManager fm = getSupportFragmentManager();\r
+        FragmentTransaction ft = fm.beginTransaction();\r
+        ft.addToBackStack(null);\r
+        dialog.show(ft, DIALOG_UNTRUSTED_CERT);\r
+        \r
+    }\r
     \r
+    /**\r
+     * Dismiss untrusted cert dialog\r
+     */\r
+    public void dismissUntrustedCertDialog(){\r
+        /*Fragment frag = getSupportFragmentManager().findFragmentByTag(DIALOG_UNTRUSTED_CERT);\r
+        if (frag != null) {\r
+            SslErrorViewAdapter dialog = (SslErrorViewAdapter) frag;\r
+            dialog.dismiss();\r
+        }\r
+        */\r
+    }\r
+    \r
+    /**\r
+     * Called from SslValidatorDialog when a new server certificate was correctly saved.\r
+     */\r
+    public void onSavedCertificate() {\r
+        Fragment fd = getSupportFragmentManager().findFragmentByTag(TAG_SAML_DIALOG);\r
+        if (fd == null) {\r
+            // if SAML dialog is not shown, the SslDialog was shown due to an SSL error in the server check\r
+            checkOcServer();\r
+        }\r
+    }\r
+\r
+    /**\r
+     * Called from SslValidatorDialog when a new server certificate could not be saved \r
+     * when the user requested it.\r
+     */\r
+    @Override\r
+    public void onFailedSavingCertificate() {\r
+        showDialog(DIALOG_CERT_NOT_SAVED);\r
+        cancelWebView();\r
+    }\r
+\r
+    @Override\r
+    public void onCancelCertificate() {\r
+        cancelWebView();\r
+    }\r
+    \r
+\r
+    public void cancelWebView() {\r
+        Fragment fd = getSupportFragmentManager().findFragmentByTag(TAG_SAML_DIALOG);\r
+        if (fd != null && fd instanceof SherlockDialogFragment) {\r
+            Dialog d = ((SherlockDialogFragment)fd).getDialog();\r
+            if (d != null && d.isShowing()) {\r
+                d.dismiss();\r
+            }\r
+        }\r
+        \r
+    }\r
+\r
 }\r
diff --git a/src/com/owncloud/android/authentication/OwnCloudAccount.java b/src/com/owncloud/android/authentication/OwnCloudAccount.java
new file mode 100644 (file)
index 0000000..51a9900
--- /dev/null
@@ -0,0 +1,75 @@
+/* ownCloud Android client application
+ *   Copyright (C) 2014 ownCloud Inc.
+ *
+ *   This program is free software: you can redistribute it and/or modify
+ *   it under the terms of the GNU General Public License version 2,
+ *   as published by the Free Software Foundation.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+package com.owncloud.android.authentication;
+
+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 {
+
+       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];
+        }
+    };
+       
+}
index 442ec73..27e1f5b 100644 (file)
 
 package com.owncloud.android.authentication;
 
+import java.io.ByteArrayInputStream;
 import java.lang.ref.WeakReference;
+import java.security.cert.Certificate;
+import java.security.cert.CertificateException;
+import java.security.cert.CertificateFactory;
+import java.security.cert.X509Certificate;
 
+import com.owncloud.android.lib.common.network.NetworkUtils;
 import com.owncloud.android.utils.Log_OC;
 
+import android.content.Context;
 import android.graphics.Bitmap;
+import android.net.http.SslCertificate;
 import android.net.http.SslError;
+import android.os.Bundle;
 import android.os.Handler;
 import android.os.Message;
 import android.view.KeyEvent;
@@ -52,12 +61,14 @@ public class SsoWebViewClient extends WebViewClient {
         public void onSsoFinished(String sessionCookie);
     }
     
+    private Context mContext;
     private Handler mListenerHandler;
     private WeakReference<SsoWebViewClientListener> mListenerRef;
     private String mTargetUrl;
     private String mLastReloadedUrlAtError;
     
-    public SsoWebViewClient (Handler listenerHandler, SsoWebViewClientListener listener) {
+    public SsoWebViewClient (Context context, Handler listenerHandler, SsoWebViewClientListener listener) {
+        mContext = context;
         mListenerHandler = listenerHandler;
         mListenerRef = new WeakReference<SsoWebViewClient.SsoWebViewClientListener>(listener);
         mTargetUrl = "fake://url.to.be.set";
@@ -135,9 +146,50 @@ public class SsoWebViewClient extends WebViewClient {
     }
     
     @Override
-    public void onReceivedSslError (WebView view, SslErrorHandler handler, SslError error) {
+    public void onReceivedSslError (final WebView view, final SslErrorHandler handler, SslError error) {
         Log_OC.d(TAG, "onReceivedSslError : " + error);
-        handler.proceed();
+        // Test 1
+        X509Certificate x509Certificate = getX509CertificateFromError(error);
+        boolean isKnownServer = false;
+        
+        if (x509Certificate != null) {
+            Log_OC.d(TAG, "------>>>>> x509Certificate " + x509Certificate.toString());
+            
+            try {
+                isKnownServer = NetworkUtils.isCertInKnownServersStore((Certificate) x509Certificate, mContext);
+            } catch (Exception e) {
+                Log_OC.e(TAG, "Exception: " + e.getMessage());
+            }
+        }
+        
+         if (isKnownServer) {
+             handler.proceed();
+         } else {
+             ((AuthenticatorActivity)mContext).showUntrustedCertDialog(x509Certificate, error, handler);
+         }
+    }
+    
+    /**
+     * Obtain the X509Certificate from SslError
+     * @param   error     SslError
+     * @return  X509Certificate from error
+     */
+    public X509Certificate getX509CertificateFromError (SslError error) {
+        Bundle bundle = SslCertificate.saveState(error.getCertificate());
+        X509Certificate x509Certificate;
+        byte[] bytes = bundle.getByteArray("x509-certificate");
+        if (bytes == null) {
+            x509Certificate = null;
+        } else {
+            try {
+                CertificateFactory certFactory = CertificateFactory.getInstance("X.509");
+                Certificate cert = certFactory.generateCertificate(new ByteArrayInputStream(bytes));
+                x509Certificate = (X509Certificate) cert;
+            } catch (CertificateException e) {
+                x509Certificate = null;
+            }
+        }        
+        return x509Certificate;
     }
     
     @Override
index 042709a..f132d96 100644 (file)
@@ -27,6 +27,9 @@ import java.util.Vector;
 
 import com.owncloud.android.MainApp;
 import com.owncloud.android.db.ProviderMeta.ProviderTableMeta;
+import com.owncloud.android.lib.resources.shares.OCShare;
+import com.owncloud.android.lib.resources.shares.ShareType;
+import com.owncloud.android.lib.resources.files.FileUtils;
 import com.owncloud.android.utils.FileStorageUtils;
 import com.owncloud.android.utils.Log_OC;
 
@@ -181,7 +184,9 @@ public class FileDataStorageManager {
         cv.put(ProviderTableMeta.FILE_LAST_SYNC_DATE_FOR_DATA, file.getLastSyncDateForData());
         cv.put(ProviderTableMeta.FILE_KEEP_IN_SYNC, file.keepInSync() ? 1 : 0);
         cv.put(ProviderTableMeta.FILE_ETAG, file.getEtag());
-
+        cv.put(ProviderTableMeta.FILE_SHARE_BY_LINK, file.isShareByLink() ? 1 : 0);
+        cv.put(ProviderTableMeta.FILE_PUBLIC_LINK, file.getPublicLink());
+        
         boolean sameRemotePath = fileExists(file.getRemotePath());
         if (sameRemotePath ||
                 fileExists(file.getFileId())        ) {           // for renamed files; no more delete and create
@@ -232,11 +237,11 @@ public class FileDataStorageManager {
             }            
         }
 
-        if (file.isFolder()) {
-            updateFolderSize(file.getFileId());
-        } else {
-            updateFolderSize(file.getParentId());
-        }
+//        if (file.isFolder()) {
+//            updateFolderSize(file.getFileId());
+//        } else {
+//            updateFolderSize(file.getParentId());
+//        }
         
         return overriden;
     }
@@ -278,6 +283,8 @@ public class FileDataStorageManager {
             cv.put(ProviderTableMeta.FILE_LAST_SYNC_DATE_FOR_DATA, file.getLastSyncDateForData());
             cv.put(ProviderTableMeta.FILE_KEEP_IN_SYNC, file.keepInSync() ? 1 : 0);
             cv.put(ProviderTableMeta.FILE_ETAG, file.getEtag());
+            cv.put(ProviderTableMeta.FILE_SHARE_BY_LINK, file.isShareByLink() ? 1 : 0);
+            cv.put(ProviderTableMeta.FILE_PUBLIC_LINK, file.getPublicLink());
 
             boolean existsByPath = fileExists(file.getRemotePath());
             if (existsByPath || fileExists(file.getFileId())) {
@@ -333,6 +340,9 @@ public class FileDataStorageManager {
         cv.put(ProviderTableMeta.FILE_LAST_SYNC_DATE_FOR_DATA, folder.getLastSyncDateForData());
         cv.put(ProviderTableMeta.FILE_KEEP_IN_SYNC, folder.keepInSync() ? 1 : 0);
         cv.put(ProviderTableMeta.FILE_ETAG, folder.getEtag());
+        cv.put(ProviderTableMeta.FILE_SHARE_BY_LINK, folder.isShareByLink() ? 1 : 0);
+        cv.put(ProviderTableMeta.FILE_PUBLIC_LINK, folder.getPublicLink());
+        
         operations.add(ContentProviderOperation.newUpdate(ProviderTableMeta.CONTENT_URI).
                 withValues(cv).
                 withSelection(  ProviderTableMeta._ID + "=?", 
@@ -378,38 +388,38 @@ public class FileDataStorageManager {
             }
         }
         
-        updateFolderSize(folder.getFileId());
+        //updateFolderSize(folder.getFileId());
         
     }
 
 
-    /**
-     * 
-     * @param id
-     */
-    private void updateFolderSize(long id) {
-        if (id > FileDataStorageManager.ROOT_PARENT_ID) {
-            Log_OC.d(TAG, "Updating size of " + id);
-            if (getContentResolver() != null) {
-                getContentResolver().update(ProviderTableMeta.CONTENT_URI_DIR, 
-                        new ContentValues(),    // won't be used, but cannot be null; crashes in KLP
-                        ProviderTableMeta._ID + "=?",
-                        new String[] { String.valueOf(id) });
-            } else {
-                try {
-                    getContentProviderClient().update(ProviderTableMeta.CONTENT_URI_DIR, 
-                            new ContentValues(),    // won't be used, but cannot be null; crashes in KLP
-                            ProviderTableMeta._ID + "=?",
-                            new String[] { String.valueOf(id) });
-                    
-                } catch (RemoteException e) {
-                    Log_OC.e(TAG, "Exception in update of folder size through compatibility patch " + e.getMessage());
-                }
-            }
-        } else {
-            Log_OC.e(TAG,  "not updating size for folder " + id);
-        }
-    }
+//    /**
+//     * 
+//     * @param id
+//     */
+//    private void updateFolderSize(long id) {
+//        if (id > FileDataStorageManager.ROOT_PARENT_ID) {
+//            Log_OC.d(TAG, "Updating size of " + id);
+//            if (getContentResolver() != null) {
+//                getContentResolver().update(ProviderTableMeta.CONTENT_URI_DIR, 
+//                        new ContentValues(),    // won't be used, but cannot be null; crashes in KLP
+//                        ProviderTableMeta._ID + "=?",
+//                        new String[] { String.valueOf(id) });
+//            } else {
+//                try {
+//                    getContentProviderClient().update(ProviderTableMeta.CONTENT_URI_DIR, 
+//                            new ContentValues(),    // won't be used, but cannot be null; crashes in KLP
+//                            ProviderTableMeta._ID + "=?",
+//                            new String[] { String.valueOf(id) });
+//                    
+//                } catch (RemoteException e) {
+//                    Log_OC.e(TAG, "Exception in update of folder size through compatibility patch " + e.getMessage());
+//                }
+//            }
+//        } else {
+//            Log_OC.e(TAG,  "not updating size for folder " + id);
+//        }
+//    }
     
 
     public void removeFile(OCFile file, boolean removeDBData, boolean removeLocalCopy) {
@@ -432,7 +442,7 @@ public class FileDataStorageManager {
                     } else {
                         getContentResolver().delete(file_uri, where, whereArgs);
                     }
-                    updateFolderSize(file.getParentId());
+                    //updateFolderSize(file.getParentId());
                 }
                 if (removeLocalCopy && file.isDown() && file.getStoragePath() != null) {
                     boolean success = new File(file.getStoragePath()).delete();
@@ -472,7 +482,7 @@ public class FileDataStorageManager {
         } else {
             getContentResolver().delete(folder_uri, where, whereArgs); 
         }
-        updateFolderSize(folder.getParentId());
+        //updateFolderSize(folder.getParentId());
     }
 
     private void removeLocalFolder(File folder) {
@@ -663,6 +673,32 @@ public class FileDataStorageManager {
         }
         return c;
     }
+    
+    private Cursor getShareCursorForValue(String key, String value) {
+        Cursor c = null;
+        if (getContentResolver() != null) {
+            c = getContentResolver()
+                    .query(ProviderTableMeta.CONTENT_URI_SHARE,
+                            null,
+                            key + "=? AND "
+                                    + ProviderTableMeta.OCSHARES_ACCOUNT_OWNER
+                                    + "=?",
+                                    new String[] { value, mAccount.name }, null);
+        } else {
+            try {
+                c = getContentProviderClient().query(
+                        ProviderTableMeta.CONTENT_URI_SHARE,
+                        null,
+                        key + "=? AND " + ProviderTableMeta.OCSHARES_ACCOUNT_OWNER
+                        + "=?", new String[] { value, mAccount.name },
+                        null);
+            } catch (RemoteException e) {
+                Log_OC.e(TAG, "Could not get file details: " + e.getMessage());
+                c = null;
+            }
+        }
+        return c;
+    }
 
     private OCFile createFileInstance(Cursor c) {
         OCFile file = null;
@@ -701,9 +737,568 @@ public class FileDataStorageManager {
             file.setKeepInSync(c.getInt(
                     c.getColumnIndex(ProviderTableMeta.FILE_KEEP_IN_SYNC)) == 1 ? true : false);
             file.setEtag(c.getString(c.getColumnIndex(ProviderTableMeta.FILE_ETAG)));
+            file.setShareByLink(c.getInt(
+                    c.getColumnIndex(ProviderTableMeta.FILE_SHARE_BY_LINK)) == 1 ? true : false);
+            file.setPublicLink(c.getString(c.getColumnIndex(ProviderTableMeta.FILE_PUBLIC_LINK)));
                     
         }
         return file;
     }
+    
+    /**
+     * Returns if the file/folder is shared by link or not
+     * @param path  Path of the file/folder
+     * @return
+     */
+    public boolean isShareByLink(String path) {
+        Cursor c = getCursorForValue(ProviderTableMeta.FILE_STORAGE_PATH, path);
+        OCFile file = null;
+        if (c.moveToFirst()) {
+            file = createFileInstance(c);
+        }
+        c.close();
+        return file.isShareByLink();
+    }
+    
+    /**
+     * Returns the public link of the file/folder
+     * @param path  Path of the file/folder
+     * @return
+     */
+    public String getPublicLink(String path) {
+        Cursor c = getCursorForValue(ProviderTableMeta.FILE_STORAGE_PATH, path);
+        OCFile file = null;
+        if (c.moveToFirst()) {
+            file = createFileInstance(c);
+        }
+        c.close();
+        return file.getPublicLink();
+    }
+    
+    
+    // Methods for Shares
+    public boolean saveShare(OCShare share) {
+        boolean overriden = false;
+        ContentValues cv = new ContentValues();
+        cv.put(ProviderTableMeta.OCSHARES_FILE_SOURCE, share.getFileSource());
+        cv.put(ProviderTableMeta.OCSHARES_ITEM_SOURCE, share.getItemSource());
+        cv.put(ProviderTableMeta.OCSHARES_SHARE_TYPE, share.getShareType().getValue());
+        cv.put(ProviderTableMeta.OCSHARES_SHARE_WITH, share.getShareWith());
+        cv.put(ProviderTableMeta.OCSHARES_PATH, share.getPath());
+        cv.put(ProviderTableMeta.OCSHARES_PERMISSIONS, share.getPermissions());
+        cv.put(ProviderTableMeta.OCSHARES_SHARED_DATE, share.getSharedDate());
+        cv.put(ProviderTableMeta.OCSHARES_EXPIRATION_DATE, share.getExpirationDate());
+        cv.put(ProviderTableMeta.OCSHARES_TOKEN, share.getToken());
+        cv.put(ProviderTableMeta.OCSHARES_SHARE_WITH_DISPLAY_NAME, share.getSharedWithDisplayName());
+        cv.put(ProviderTableMeta.OCSHARES_IS_DIRECTORY, share.isFolder() ? 1 : 0);
+        cv.put(ProviderTableMeta.OCSHARES_USER_ID, share.getUserId());
+        cv.put(ProviderTableMeta.OCSHARES_ID_REMOTE_SHARED, share.getIdRemoteShared());
+        cv.put(ProviderTableMeta.OCSHARES_ACCOUNT_OWNER, mAccount.name);
+        
+        if (shareExists(share.getIdRemoteShared())) {           // for renamed files; no more delete and create
+
+            overriden = true;
+            if (getContentResolver() != null) {
+                getContentResolver().update(ProviderTableMeta.CONTENT_URI_SHARE, cv,
+                        ProviderTableMeta.OCSHARES_ID_REMOTE_SHARED + "=?",
+                        new String[] { String.valueOf(share.getIdRemoteShared()) });
+            } else {
+                try {
+                    getContentProviderClient().update(ProviderTableMeta.CONTENT_URI_SHARE,
+                            cv, ProviderTableMeta.OCSHARES_ID_REMOTE_SHARED + "=?",
+                            new String[] { String.valueOf(share.getIdRemoteShared()) });
+                } catch (RemoteException e) {
+                    Log_OC.e(TAG,
+                            "Fail to insert insert file to database "
+                                    + e.getMessage());
+                }
+            }
+        } else {
+            Uri result_uri = null;
+            if (getContentResolver() != null) {
+                result_uri = getContentResolver().insert(
+                        ProviderTableMeta.CONTENT_URI_SHARE, cv);
+            } else {
+                try {
+                    result_uri = getContentProviderClient().insert(
+                            ProviderTableMeta.CONTENT_URI_SHARE, cv);
+                } catch (RemoteException e) {
+                    Log_OC.e(TAG,
+                            "Fail to insert insert file to database "
+                                    + e.getMessage());
+                }
+            }
+            if (result_uri != null) {
+                long new_id = Long.parseLong(result_uri.getPathSegments()
+                        .get(1));
+                share.setId(new_id);
+            }            
+        }
+
+        return overriden;
+    }
+
+    private OCShare getShareById(long id) {
+        Cursor c = getShareCursorForValue(ProviderTableMeta._ID, String.valueOf(id));
+        OCShare share = null;
+        if (c.moveToFirst()) {
+            share = createShareInstance(c);
+        }
+        c.close();
+        return share;
+    }
+
+    private OCShare getShareByRemoteId(long remoteId) {
+        Cursor c = getShareCursorForValue(ProviderTableMeta.OCSHARES_ID_REMOTE_SHARED, String.valueOf(remoteId));
+        OCShare share = null;
+        if (c.moveToFirst()) {
+            share = createShareInstance(c);
+        }
+        c.close();
+        return share;
+    }
+
+    public OCShare getFirstShareByPathAndType(String path, ShareType type) {
+        Cursor c = null;
+        if (getContentResolver() != null) {
+            c = getContentResolver().query(
+                    ProviderTableMeta.CONTENT_URI_SHARE,
+                    null,
+                    ProviderTableMeta.OCSHARES_PATH + "=? AND "
+                            + ProviderTableMeta.OCSHARES_SHARE_TYPE + "=? AND "
+                            + ProviderTableMeta.OCSHARES_ACCOUNT_OWNER + "=?",
+                    new String[] { path, Integer.toString(type.getValue()), mAccount.name },
+                    null);
+        } else {
+            try {
+                c = getContentProviderClient().query(
+                        ProviderTableMeta.CONTENT_URI_SHARE,
+                        null,
+                        ProviderTableMeta.OCSHARES_PATH + "=? AND "
+                                + ProviderTableMeta.OCSHARES_SHARE_TYPE + "=? AND "
+                                + ProviderTableMeta.OCSHARES_ACCOUNT_OWNER + "=?",
+                        new String[] { path, Integer.toString(type.getValue()), mAccount.name }, 
+                        null);
+
+            } catch (RemoteException e) {
+                Log_OC.e(TAG, "Could not get file details: " + e.getMessage());
+                c = null;
+            }
+        }
+        OCShare share = null;
+        if (c.moveToFirst()) {
+            share = createShareInstance(c);
+        }
+        c.close();
+        return share;
+    }
+    
+    private OCShare createShareInstance(Cursor c) {
+        OCShare share = null;
+        if (c != null) {
+            share = new OCShare(c.getString(c
+                    .getColumnIndex(ProviderTableMeta.OCSHARES_PATH)));
+            share.setId(c.getLong(c.getColumnIndex(ProviderTableMeta._ID)));
+            share.setFileSource(c.getLong(c
+                    .getColumnIndex(ProviderTableMeta.OCSHARES_ITEM_SOURCE)));
+            share.setShareType(ShareType.fromValue(c.getInt(c
+                    .getColumnIndex(ProviderTableMeta.OCSHARES_SHARE_TYPE))));
+            share.setPermissions(c.getInt(c
+                    .getColumnIndex(ProviderTableMeta.OCSHARES_PERMISSIONS)));
+            share.setSharedDate(c.getLong(c
+                    .getColumnIndex(ProviderTableMeta.OCSHARES_SHARED_DATE)));
+            share.setExpirationDate(c.getLong(c
+                    .getColumnIndex(ProviderTableMeta.OCSHARES_EXPIRATION_DATE)));
+            share.setToken(c.getString(c
+                    .getColumnIndex(ProviderTableMeta.OCSHARES_TOKEN)));
+            share.setSharedWithDisplayName(c.getString(c
+                    .getColumnIndex(ProviderTableMeta.OCSHARES_SHARE_WITH_DISPLAY_NAME)));
+            share.setIsFolder(c.getInt(
+                    c.getColumnIndex(ProviderTableMeta.OCSHARES_IS_DIRECTORY)) == 1 ? true : false);
+            share.setUserId(c.getLong(c.getColumnIndex(ProviderTableMeta.OCSHARES_USER_ID)));
+            share.setIdRemoteShared(c.getLong(c.getColumnIndex(ProviderTableMeta.OCSHARES_ID_REMOTE_SHARED)));
+                    
+        }
+        return share;
+    }
+
+    private boolean shareExists(String cmp_key, String value) {
+        Cursor c;
+        if (getContentResolver() != null) {
+            c = getContentResolver()
+                    .query(ProviderTableMeta.CONTENT_URI_SHARE,
+                            null,
+                            cmp_key + "=? AND "
+                                    + ProviderTableMeta.OCSHARES_ACCOUNT_OWNER
+                                    + "=?",
+                                    new String[] { value, mAccount.name }, null);
+        } else {
+            try {
+                c = getContentProviderClient().query(
+                        ProviderTableMeta.CONTENT_URI_SHARE,
+                        null,
+                        cmp_key + "=? AND "
+                                + ProviderTableMeta.OCSHARES_ACCOUNT_OWNER + "=?",
+                                new String[] { value, mAccount.name }, null);
+            } catch (RemoteException e) {
+                Log_OC.e(TAG,
+                        "Couldn't determine file existance, assuming non existance: "
+                                + e.getMessage());
+                return false;
+            }
+        }
+        boolean retval = c.moveToFirst();
+        c.close();
+        return retval;
+    }
+    
+    private boolean shareExists(long remoteId) {
+        return shareExists(ProviderTableMeta.OCSHARES_ID_REMOTE_SHARED, String.valueOf(remoteId));
+    }
+
+    private void cleanSharedFiles() {
+        ContentValues cv = new ContentValues();
+        cv.put(ProviderTableMeta.FILE_SHARE_BY_LINK, false);
+        cv.put(ProviderTableMeta.FILE_PUBLIC_LINK, "");
+        String where = ProviderTableMeta.FILE_ACCOUNT_OWNER + "=?";
+        String [] whereArgs = new String[]{mAccount.name};
+        
+        if (getContentResolver() != null) {
+            getContentResolver().update(ProviderTableMeta.CONTENT_URI, cv, where, whereArgs);
+
+        } else {
+            try {
+                getContentProviderClient().update(ProviderTableMeta.CONTENT_URI, cv, where, whereArgs);
+                
+            } catch (RemoteException e) {
+                Log_OC.e(TAG, "Exception in cleanSharedFiles" + e.getMessage());
+            }
+        }
+    }
+
+    private void cleanSharedFilesInFolder(OCFile folder) {
+        ContentValues cv = new ContentValues();
+        cv.put(ProviderTableMeta.FILE_SHARE_BY_LINK, false);
+        cv.put(ProviderTableMeta.FILE_PUBLIC_LINK, "");
+        String where = ProviderTableMeta.FILE_ACCOUNT_OWNER + "=? AND " + ProviderTableMeta.FILE_PARENT + "=?";
+        String [] whereArgs = new String[] { mAccount.name , String.valueOf(folder.getFileId()) };
+        
+        if (getContentResolver() != null) {
+            getContentResolver().update(ProviderTableMeta.CONTENT_URI, cv, where, whereArgs);
+
+        } else {
+            try {
+                getContentProviderClient().update(ProviderTableMeta.CONTENT_URI, cv, where, whereArgs);
+                
+            } catch (RemoteException e) {
+                Log_OC.e(TAG, "Exception in cleanSharedFilesInFolder " + e.getMessage());
+            }
+        }
+    }
+
+    private void cleanShares() {
+        String where = ProviderTableMeta.OCSHARES_ACCOUNT_OWNER + "=?";
+        String [] whereArgs = new String[]{mAccount.name};
+        
+        if (getContentResolver() != null) {
+            getContentResolver().delete(ProviderTableMeta.CONTENT_URI_SHARE, where, whereArgs);
+
+        } else {
+            try {
+                getContentProviderClient().delete(ProviderTableMeta.CONTENT_URI_SHARE, where, whereArgs);
+                
+            } catch (RemoteException e) {
+                Log_OC.e(TAG, "Exception in cleanShares" + e.getMessage());
+            }
+        }
+    }
+    
+    public void saveShares(Collection<OCShare> shares) {
+        cleanShares();
+        if (shares != null) {
+            ArrayList<ContentProviderOperation> operations = new ArrayList<ContentProviderOperation>(shares.size());
+
+            // prepare operations to insert or update files to save in the given folder
+            for (OCShare share : shares) {
+                ContentValues cv = new ContentValues();
+                cv.put(ProviderTableMeta.OCSHARES_FILE_SOURCE, share.getFileSource());
+                cv.put(ProviderTableMeta.OCSHARES_ITEM_SOURCE, share.getItemSource());
+                cv.put(ProviderTableMeta.OCSHARES_SHARE_TYPE, share.getShareType().getValue());
+                cv.put(ProviderTableMeta.OCSHARES_SHARE_WITH, share.getShareWith());
+                cv.put(ProviderTableMeta.OCSHARES_PATH, share.getPath());
+                cv.put(ProviderTableMeta.OCSHARES_PERMISSIONS, share.getPermissions());
+                cv.put(ProviderTableMeta.OCSHARES_SHARED_DATE, share.getSharedDate());
+                cv.put(ProviderTableMeta.OCSHARES_EXPIRATION_DATE, share.getExpirationDate());
+                cv.put(ProviderTableMeta.OCSHARES_TOKEN, share.getToken());
+                cv.put(ProviderTableMeta.OCSHARES_SHARE_WITH_DISPLAY_NAME, share.getSharedWithDisplayName());
+                cv.put(ProviderTableMeta.OCSHARES_IS_DIRECTORY, share.isFolder() ? 1 : 0);
+                cv.put(ProviderTableMeta.OCSHARES_USER_ID, share.getUserId());
+                cv.put(ProviderTableMeta.OCSHARES_ID_REMOTE_SHARED, share.getIdRemoteShared());
+                cv.put(ProviderTableMeta.OCSHARES_ACCOUNT_OWNER, mAccount.name);
+
+                if (shareExists(share.getIdRemoteShared())) {
+                    // updating an existing file
+                    operations.add(ContentProviderOperation.newUpdate(ProviderTableMeta.CONTENT_URI_SHARE).
+                            withValues(cv).
+                            withSelection(  ProviderTableMeta.OCSHARES_ID_REMOTE_SHARED + "=?", 
+                                    new String[] { String.valueOf(share.getIdRemoteShared()) })
+                                    .build());
+
+                } else {
+                    // adding a new file
+                    operations.add(ContentProviderOperation.newInsert(ProviderTableMeta.CONTENT_URI_SHARE).withValues(cv).build());
+                }
+            }
+            
+            // apply operations in batch
+            if (operations.size() > 0) {
+                @SuppressWarnings("unused")
+                ContentProviderResult[] results = null;
+                Log_OC.d(TAG, "Sending " + operations.size() + " operations to FileContentProvider");
+                try {
+                    if (getContentResolver() != null) {
+                        results = getContentResolver().applyBatch(MainApp.getAuthority(), operations);
+    
+                    } else {
+                        results = getContentProviderClient().applyBatch(operations);
+                    }
+    
+                } catch (OperationApplicationException e) {
+                    Log_OC.e(TAG, "Exception in batch of operations " + e.getMessage());
+    
+                } catch (RemoteException e) {
+                    Log_OC.e(TAG, "Exception in batch of operations  " + e.getMessage());
+                }
+            }
+        }
+        
+    }
+    
+    public void updateSharedFiles(Collection<OCFile> sharedFiles) {
+        cleanSharedFiles();
+        
+        if (sharedFiles != null) {
+            ArrayList<ContentProviderOperation> operations = new ArrayList<ContentProviderOperation>(sharedFiles.size());
+
+            // prepare operations to insert or update files to save in the given folder
+            for (OCFile file : sharedFiles) {
+                ContentValues cv = new ContentValues();
+                cv.put(ProviderTableMeta.FILE_MODIFIED, file.getModificationTimestamp());
+                cv.put(ProviderTableMeta.FILE_MODIFIED_AT_LAST_SYNC_FOR_DATA, file.getModificationTimestampAtLastSyncForData());
+                cv.put(ProviderTableMeta.FILE_CREATION, file.getCreationTimestamp());
+                cv.put(ProviderTableMeta.FILE_CONTENT_LENGTH, file.getFileLength());
+                cv.put(ProviderTableMeta.FILE_CONTENT_TYPE, file.getMimetype());
+                cv.put(ProviderTableMeta.FILE_NAME, file.getFileName());
+                cv.put(ProviderTableMeta.FILE_PARENT, file.getParentId());
+                cv.put(ProviderTableMeta.FILE_PATH, file.getRemotePath());
+                if (!file.isFolder()) {
+                    cv.put(ProviderTableMeta.FILE_STORAGE_PATH, file.getStoragePath());
+                }
+                cv.put(ProviderTableMeta.FILE_ACCOUNT_OWNER, mAccount.name);
+                cv.put(ProviderTableMeta.FILE_LAST_SYNC_DATE, file.getLastSyncDateForProperties());
+                cv.put(ProviderTableMeta.FILE_LAST_SYNC_DATE_FOR_DATA, file.getLastSyncDateForData());
+                cv.put(ProviderTableMeta.FILE_KEEP_IN_SYNC, file.keepInSync() ? 1 : 0);
+                cv.put(ProviderTableMeta.FILE_ETAG, file.getEtag());
+                cv.put(ProviderTableMeta.FILE_SHARE_BY_LINK, file.isShareByLink() ? 1 : 0);
+                cv.put(ProviderTableMeta.FILE_PUBLIC_LINK, file.getPublicLink());
+
+                boolean existsByPath = fileExists(file.getRemotePath());
+                if (existsByPath || fileExists(file.getFileId())) {
+                    // updating an existing file
+                    operations.add(ContentProviderOperation.newUpdate(ProviderTableMeta.CONTENT_URI).
+                            withValues(cv).
+                            withSelection(  ProviderTableMeta._ID + "=?", 
+                                    new String[] { String.valueOf(file.getFileId()) })
+                                    .build());
+
+                } else {
+                    // adding a new file
+                    operations.add(ContentProviderOperation.newInsert(ProviderTableMeta.CONTENT_URI).withValues(cv).build());
+                }
+            }
+            
+            // apply operations in batch
+            if (operations.size() > 0) {
+                @SuppressWarnings("unused")
+                ContentProviderResult[] results = null;
+                Log_OC.d(TAG, "Sending " + operations.size() + " operations to FileContentProvider");
+                try {
+                    if (getContentResolver() != null) {
+                        results = getContentResolver().applyBatch(MainApp.getAuthority(), operations);
+    
+                    } else {
+                        results = getContentProviderClient().applyBatch(operations);
+                    }
+    
+                } catch (OperationApplicationException e) {
+                    Log_OC.e(TAG, "Exception in batch of operations " + e.getMessage());
+    
+                } catch (RemoteException e) {
+                    Log_OC.e(TAG, "Exception in batch of operations  " + e.getMessage());
+                }
+            }
+        }
+        
+    } 
+    
+    public void removeShare(OCShare share){
+        Uri share_uri = ProviderTableMeta.CONTENT_URI_SHARE;
+        String where = ProviderTableMeta.OCSHARES_ACCOUNT_OWNER + "=?" + " AND " + ProviderTableMeta.FILE_PATH + "=?";
+        String [] whereArgs = new String[]{mAccount.name, share.getPath()};
+        if (getContentProviderClient() != null) {
+            try {
+                getContentProviderClient().delete(share_uri, where, whereArgs);
+            } catch (RemoteException e) {
+                e.printStackTrace();
+            }
+        } else {
+            getContentResolver().delete(share_uri, where, whereArgs); 
+        }
+    }
+    
+    public void saveSharesDB(ArrayList<OCShare> shares) {
+        saveShares(shares);
+
+        ArrayList<OCFile> sharedFiles = new ArrayList<OCFile>();
+
+        for (OCShare share : shares) {
+            // Get the path
+            String path = share.getPath();
+            if (share.isFolder()) {
+                path = path + FileUtils.PATH_SEPARATOR;
+            }           
+
+            // Update OCFile with data from share: ShareByLink  ¿and publicLink?
+            OCFile file = getFileByPath(path);
+            if (file != null) {
+                if (share.getShareType().equals(ShareType.PUBLIC_LINK)) {
+                    file.setShareByLink(true);
+                    sharedFiles.add(file);
+                }
+            } 
+        }
+        
+        updateSharedFiles(sharedFiles);
+    }
+
+    
+    public void saveSharesInFolder(ArrayList<OCShare> shares, OCFile folder) {
+        cleanSharedFilesInFolder(folder);
+        ArrayList<ContentProviderOperation> operations = new ArrayList<ContentProviderOperation>();
+        operations = prepareRemoveSharesInFolder(folder, operations);
+        
+        if (shares != null) {
+            // prepare operations to insert or update files to save in the given folder
+            for (OCShare share : shares) {
+                ContentValues cv = new ContentValues();
+                cv.put(ProviderTableMeta.OCSHARES_FILE_SOURCE, share.getFileSource());
+                cv.put(ProviderTableMeta.OCSHARES_ITEM_SOURCE, share.getItemSource());
+                cv.put(ProviderTableMeta.OCSHARES_SHARE_TYPE, share.getShareType().getValue());
+                cv.put(ProviderTableMeta.OCSHARES_SHARE_WITH, share.getShareWith());
+                cv.put(ProviderTableMeta.OCSHARES_PATH, share.getPath());
+                cv.put(ProviderTableMeta.OCSHARES_PERMISSIONS, share.getPermissions());
+                cv.put(ProviderTableMeta.OCSHARES_SHARED_DATE, share.getSharedDate());
+                cv.put(ProviderTableMeta.OCSHARES_EXPIRATION_DATE, share.getExpirationDate());
+                cv.put(ProviderTableMeta.OCSHARES_TOKEN, share.getToken());
+                cv.put(ProviderTableMeta.OCSHARES_SHARE_WITH_DISPLAY_NAME, share.getSharedWithDisplayName());
+                cv.put(ProviderTableMeta.OCSHARES_IS_DIRECTORY, share.isFolder() ? 1 : 0);
+                cv.put(ProviderTableMeta.OCSHARES_USER_ID, share.getUserId());
+                cv.put(ProviderTableMeta.OCSHARES_ID_REMOTE_SHARED, share.getIdRemoteShared());
+                cv.put(ProviderTableMeta.OCSHARES_ACCOUNT_OWNER, mAccount.name);
+
+                /*
+                if (shareExists(share.getIdRemoteShared())) {
+                    // updating an existing share resource
+                    operations.add(ContentProviderOperation.newUpdate(ProviderTableMeta.CONTENT_URI_SHARE).
+                            withValues(cv).
+                            withSelection(  ProviderTableMeta.OCSHARES_ID_REMOTE_SHARED + "=?", 
+                                    new String[] { String.valueOf(share.getIdRemoteShared()) })
+                                    .build());
+
+                } else {
+                */
+                // adding a new share resource
+                operations.add(ContentProviderOperation.newInsert(ProviderTableMeta.CONTENT_URI_SHARE).withValues(cv).build());
+                //}
+            }
+        }
+            
+        // apply operations in batch
+        if (operations.size() > 0) {
+            @SuppressWarnings("unused")
+            ContentProviderResult[] results = null;
+            Log_OC.d(TAG, "Sending " + operations.size() + " operations to FileContentProvider");
+            try {
+                if (getContentResolver() != null) {
+                    results = getContentResolver().applyBatch(MainApp.getAuthority(), operations);
+
+                } else {
+                    results = getContentProviderClient().applyBatch(operations);
+                }
+
+            } catch (OperationApplicationException e) {
+                Log_OC.e(TAG, "Exception in batch of operations " + e.getMessage());
+
+            } catch (RemoteException e) {
+                Log_OC.e(TAG, "Exception in batch of operations  " + e.getMessage());
+            }
+        }
+        //}
+        
+    }
 
+    private ArrayList<ContentProviderOperation> prepareRemoveSharesInFolder(OCFile folder, ArrayList<ContentProviderOperation> preparedOperations) {
+        if (folder != null) {
+            String where = ProviderTableMeta.OCSHARES_PATH + "=?" + " AND " + ProviderTableMeta.OCSHARES_ACCOUNT_OWNER + "=?";
+            String [] whereArgs = new String[]{ "", mAccount.name };
+            
+            Vector<OCFile> files = getFolderContent(folder);
+            
+            for (OCFile file : files) {
+                whereArgs[0] = file.getRemotePath();
+                preparedOperations.add(ContentProviderOperation.newDelete(ProviderTableMeta.CONTENT_URI_SHARE)
+                        .withSelection(where, whereArgs)
+                        .build());
+            }
+        }
+        return preparedOperations;
+        
+        /*
+        if (operations.size() > 0) {
+            try {
+                if (getContentResolver() != null) {
+                    getContentResolver().applyBatch(MainApp.getAuthority(), operations);
+
+                } else {
+                    getContentProviderClient().applyBatch(operations);
+                }
+
+            } catch (OperationApplicationException e) {
+                Log_OC.e(TAG, "Exception in batch of operations " + e.getMessage());
+
+            } catch (RemoteException e) {
+                Log_OC.e(TAG, "Exception in batch of operations  " + e.getMessage());
+            }
+        }            
+        */
+            
+            /*
+            if (getContentResolver() != null) {
+                
+                getContentResolver().delete(ProviderTableMeta.CONTENT_URI_SHARE, 
+                                            where,
+                                            whereArgs);
+            } else {
+                try {
+                    getContentProviderClient().delete(  ProviderTableMeta.CONTENT_URI_SHARE, 
+                                                        where,
+                                                        whereArgs);
+
+                } catch (RemoteException e) {
+                    Log_OC.e(TAG, "Exception deleting shares in a folder " + e.getMessage());
+                }
+            }
+            */
+        //}
+    }
 }
index a6e6a54..82c341c 100644 (file)
@@ -61,6 +61,9 @@ public class OCFile implements Parcelable, Comparable<OCFile> {
     private boolean mKeepInSync;
 
     private String mEtag;
+    
+    private boolean mShareByLink;
+    private String mPublicLink;
 
 
     /**
@@ -99,6 +102,8 @@ public class OCFile implements Parcelable, Comparable<OCFile> {
         mLastSyncDateForProperties = source.readLong();
         mLastSyncDateForData = source.readLong();
         mEtag = source.readString();
+        mShareByLink = source.readInt() == 1;
+        mPublicLink = source.readString();
     }
 
     @Override
@@ -117,6 +122,8 @@ public class OCFile implements Parcelable, Comparable<OCFile> {
         dest.writeLong(mLastSyncDateForProperties);
         dest.writeLong(mLastSyncDateForData);
         dest.writeString(mEtag);
+        dest.writeInt(mShareByLink ? 1 : 0);
+        dest.writeString(mPublicLink);
     }
     
     /**
@@ -325,6 +332,8 @@ public class OCFile implements Parcelable, Comparable<OCFile> {
         mKeepInSync = false;
         mNeedsUpdating = false;
         mEtag = null;
+        mShareByLink = false;
+        mPublicLink = null;
     }
 
     /**
@@ -445,7 +454,7 @@ public class OCFile implements Parcelable, Comparable<OCFile> {
 
     @Override
     public String toString() {
-        String asString = "[id=%s, name=%s, mime=%s, downloaded=%s, local=%s, remote=%s, parentId=%s, keepInSinc=%s etag=%s]";
+        String asString = "[id=%s, name=%s, mime=%s, downloaded=%s, local=%s, remote=%s, parentId=%s, keepInSync=%s etag=%s]";
         asString = String.format(asString, Long.valueOf(mId), getFileName(), mMimeType, isDown(), mLocalPath, mRemotePath, Long.valueOf(mParentId), Boolean.valueOf(mKeepInSync), mEtag);
         return asString;
     }
@@ -458,6 +467,23 @@ public class OCFile implements Parcelable, Comparable<OCFile> {
         this.mEtag = etag;
     }
     
+    
+    public boolean isShareByLink() {
+        return mShareByLink;
+    }
+
+    public void setShareByLink(boolean shareByLink) {
+        this.mShareByLink = shareByLink;
+    }
+
+    public String getPublicLink() {
+        return mPublicLink;
+    }
+
+    public void setPublicLink(String publicLink) {
+        this.mPublicLink = publicLink;
+    }
+
     public long getLocalModificationTimestamp() {
         if (mLocalPath != null && mLocalPath.length() > 0) {
             File f = new File(mLocalPath);
index 8701ebd..2101a68 100644 (file)
@@ -30,28 +30,28 @@ import android.provider.BaseColumns;
  */\r
 public class ProviderMeta {\r
 \r
-    /* These constants are now in MainApp\r
-        public static final String AUTHORITY_FILES = "org.owncloud";\r
-        public static final String DB_FILE = "owncloud.db";\r
-    */\r
     public static final String DB_NAME = "filelist";\r
-    public static final int DB_VERSION = 5;\r
+    public static final int DB_VERSION = 6;\r
 \r
     private ProviderMeta() {\r
     }\r
 \r
     static public class ProviderTableMeta implements BaseColumns {\r
-        public static final String DB_NAME = "filelist";\r
+        public static final String FILE_TABLE_NAME = "filelist";\r
+        public static final String OCSHARES_TABLE_NAME = "ocshares";\r
         public static final Uri CONTENT_URI = Uri.parse("content://"\r
                 + MainApp.getAuthority() + "/");\r
         public static final Uri CONTENT_URI_FILE = Uri.parse("content://"\r
                 + MainApp.getAuthority() + "/file");\r
         public static final Uri CONTENT_URI_DIR = Uri.parse("content://"\r
                 + MainApp.getAuthority() + "/dir");\r
+        public static final Uri CONTENT_URI_SHARE = Uri.parse("content://"\r
+                + MainApp.getAuthority() + "/shares");\r
 \r
         public static final String CONTENT_TYPE = "vnd.android.cursor.dir/vnd.owncloud.file";\r
         public static final String CONTENT_TYPE_ITEM = "vnd.android.cursor.item/vnd.owncloud.file";\r
 \r
+        // Columns of filelist table\r
         public static final String FILE_PARENT = "parent";\r
         public static final String FILE_NAME = "filename";\r
         public static final String FILE_CREATION = "created";\r
@@ -66,9 +66,31 @@ public class ProviderMeta {
         public static final String FILE_LAST_SYNC_DATE_FOR_DATA = "last_sync_date_for_data";\r
         public static final String FILE_KEEP_IN_SYNC = "keep_in_sync";\r
         public static final String FILE_ETAG = "etag";\r
+        public static final String FILE_SHARE_BY_LINK = "share_by_link";\r
+        public static final String FILE_PUBLIC_LINK = "public_link";\r
 \r
-        public static final String DEFAULT_SORT_ORDER = FILE_NAME\r
+        public static final String FILE_DEFAULT_SORT_ORDER = FILE_NAME\r
                 + " collate nocase asc";\r
+        \r
+        // Columns of ocshares table\r
+        public static final String OCSHARES_FILE_SOURCE = "file_source";\r
+        public static final String OCSHARES_ITEM_SOURCE = "item_source";\r
+        public static final String OCSHARES_SHARE_TYPE = "share_type";\r
+        public static final String OCSHARES_SHARE_WITH = "shate_with";\r
+        public static final String OCSHARES_PATH = "path";\r
+        public static final String OCSHARES_PERMISSIONS = "permissions";\r
+        public static final String OCSHARES_SHARED_DATE = "shared_date";\r
+        public static final String OCSHARES_EXPIRATION_DATE = "expiration_date";\r
+        public static final String OCSHARES_TOKEN = "token";\r
+        public static final String OCSHARES_SHARE_WITH_DISPLAY_NAME = "shared_with_display_name";\r
+        public static final String OCSHARES_IS_DIRECTORY = "is_directory";\r
+        public static final String OCSHARES_USER_ID = "user_id";\r
+        public static final String OCSHARES_ID_REMOTE_SHARED = "id_remote_shared";\r
+        public static final String OCSHARES_ACCOUNT_OWNER = "owner_share";\r
+        \r
+        public static final String OCSHARES_DEFAULT_SORT_ORDER = OCSHARES_FILE_SOURCE \r
+                + " collate nocase asc";\r
+        \r
 \r
     }\r
 }\r
diff --git a/src/com/owncloud/android/files/FileHandler.java b/src/com/owncloud/android/files/FileHandler.java
deleted file mode 100644 (file)
index 2eb754d..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
-/* ownCloud Android client application
- *   Copyright (C) 2012-2013 ownCloud Inc.
- *
- *   This program is free software: you can redistribute it and/or modify
- *   it under the terms of the GNU General Public License version 2,
- *   as published by the Free Software Foundation.
- *
- *   This program is distributed in the hope that it will be useful,
- *   but WITHOUT ANY WARRANTY; without even the implied warranty of
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *   GNU General Public License for more details.
- *
- *   You should have received a copy of the GNU General Public License
- *   along with this program.  If not, see <http://www.gnu.org/licenses/>.
- *
- */
-
-package com.owncloud.android.files;
-
-import com.owncloud.android.datamodel.OCFile;
-
-public interface FileHandler {
-
-    /**
-     * TODO
-     */
-    public void openFile(OCFile file);
-
-    
-}
diff --git a/src/com/owncloud/android/files/FileOperationsHelper.java b/src/com/owncloud/android/files/FileOperationsHelper.java
new file mode 100644 (file)
index 0000000..5b74dc8
--- /dev/null
@@ -0,0 +1,188 @@
+/* ownCloud Android client application
+ *   Copyright (C) 2012-2014 ownCloud Inc.
+ *
+ *   This program is free software: you can redistribute it and/or modify
+ *   it under the terms of the GNU General Public License version 2,
+ *   as published by the Free Software Foundation.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+package com.owncloud.android.files;
+
+import org.apache.http.protocol.HTTP;
+
+import android.accounts.AccountManager;
+import android.content.Intent;
+import android.net.Uri;
+import android.support.v4.app.DialogFragment;
+import android.webkit.MimeTypeMap;
+import android.widget.Toast;
+
+import com.owncloud.android.R;
+import com.owncloud.android.datamodel.OCFile;
+
+import com.owncloud.android.lib.common.accounts.AccountUtils.Constants;
+import com.owncloud.android.lib.common.network.WebdavUtils;
+import com.owncloud.android.lib.resources.status.OwnCloudVersion;
+import com.owncloud.android.services.OperationsService;
+import com.owncloud.android.ui.activity.FileActivity;
+import com.owncloud.android.ui.dialog.ShareLinkToDialog;
+import com.owncloud.android.utils.Log_OC;
+
+/**
+ * 
+ * @author masensio
+ * @author David A. Velasco
+ */
+public class FileOperationsHelper {
+
+    private static final String TAG = FileOperationsHelper.class.getName();
+    
+    private static final String FTAG_CHOOSER_DIALOG = "CHOOSER_DIALOG"; 
+
+    
+    public void openFile(OCFile file, FileActivity callerActivity) {
+        if (file != null) {
+            String storagePath = file.getStoragePath();
+            String encodedStoragePath = WebdavUtils.encodePath(storagePath);
+            
+            Intent intentForSavedMimeType = new Intent(Intent.ACTION_VIEW);
+            intentForSavedMimeType.setDataAndType(Uri.parse("file://"+ encodedStoragePath), file.getMimetype());
+            intentForSavedMimeType.setFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION | Intent.FLAG_GRANT_WRITE_URI_PERMISSION);
+            
+            Intent intentForGuessedMimeType = null;
+            if (storagePath.lastIndexOf('.') >= 0) {
+                String guessedMimeType = MimeTypeMap.getSingleton().getMimeTypeFromExtension(storagePath.substring(storagePath.lastIndexOf('.') + 1));
+                if (guessedMimeType != null && !guessedMimeType.equals(file.getMimetype())) {
+                    intentForGuessedMimeType = new Intent(Intent.ACTION_VIEW);
+                    intentForGuessedMimeType.setDataAndType(Uri.parse("file://"+ encodedStoragePath), guessedMimeType);
+                    intentForGuessedMimeType.setFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION | Intent.FLAG_GRANT_WRITE_URI_PERMISSION);
+                }
+            }
+            
+            Intent chooserIntent = null;
+            if (intentForGuessedMimeType != null) {
+                chooserIntent = Intent.createChooser(intentForGuessedMimeType, callerActivity.getString(R.string.actionbar_open_with));
+            } else {
+                chooserIntent = Intent.createChooser(intentForSavedMimeType, callerActivity.getString(R.string.actionbar_open_with));
+            }
+            
+            callerActivity.startActivity(chooserIntent);
+            
+        } else {
+            Log_OC.wtf(TAG, "Trying to open a NULL OCFile");
+        }
+    }
+    
+
+    public void shareFileWithLink(OCFile file, FileActivity callerActivity) {
+        
+        if (isSharedSupported(callerActivity)) {
+            if (file != null) {
+                String link = "https://fake.url";
+                Intent intent = createShareWithLinkIntent(link);
+                String[] packagesToExclude = new String[] { callerActivity.getPackageName() };
+                DialogFragment chooserDialog = ShareLinkToDialog.newInstance(intent, packagesToExclude, file);
+                chooserDialog.show(callerActivity.getSupportFragmentManager(), FTAG_CHOOSER_DIALOG);
+                
+            } else {
+                Log_OC.wtf(TAG, "Trying to share a NULL OCFile");
+            }
+            
+        } else {
+            // Show a Message
+            Toast t = Toast.makeText(callerActivity, callerActivity.getString(R.string.share_link_no_support_share_api), Toast.LENGTH_LONG);
+            t.show();
+        }
+    }
+    
+    
+    public void shareFileWithLinkToApp(OCFile file, Intent sendIntent, FileActivity callerActivity) {
+        
+        if (file != null) {
+            callerActivity.showLoadingDialog();
+            
+            Intent service = new Intent(callerActivity, OperationsService.class);
+            service.setAction(OperationsService.ACTION_CREATE_SHARE);
+            service.putExtra(OperationsService.EXTRA_ACCOUNT, callerActivity.getAccount());
+            service.putExtra(OperationsService.EXTRA_REMOTE_PATH, file.getRemotePath());
+            service.putExtra(OperationsService.EXTRA_SEND_INTENT, sendIntent);
+            callerActivity.startService(service);
+            
+        } else {
+            Log_OC.wtf(TAG, "Trying to open a NULL OCFile");
+        }
+    }
+    
+    
+    private Intent createShareWithLinkIntent(String link) {
+        Intent intentToShareLink = new Intent(Intent.ACTION_SEND);
+        intentToShareLink.putExtra(Intent.EXTRA_TEXT, link);
+        intentToShareLink.setType(HTTP.PLAIN_TEXT_TYPE);
+        return intentToShareLink; 
+    }
+    
+    
+    /**
+     *  @return 'True' if the server supports the Share API
+     */
+    public boolean isSharedSupported(FileActivity callerActivity) {
+        if (callerActivity.getAccount() != null) {
+            AccountManager accountManager = AccountManager.get(callerActivity);
+
+            String version = accountManager.getUserData(callerActivity.getAccount(), Constants.KEY_OC_VERSION);
+            String versionString = accountManager.getUserData(callerActivity.getAccount(), Constants.KEY_OC_VERSION_STRING);
+            return (new OwnCloudVersion(version, versionString)).isSharedSupported();
+            //return Boolean.parseBoolean(accountManager.getUserData(callerActivity.getAccount(), OwnCloudAccount.Constants.KEY_SUPPORTS_SHARE_API));
+        }
+        return false;
+    }
+    
+    
+    public void unshareFileWithLink(OCFile file, FileActivity callerActivity) {
+        
+        if (isSharedSupported(callerActivity)) {
+            // Unshare the file
+            Intent service = new Intent(callerActivity, OperationsService.class);
+            service.setAction(OperationsService.ACTION_UNSHARE);
+            service.putExtra(OperationsService.EXTRA_ACCOUNT, callerActivity.getAccount());
+            service.putExtra(OperationsService.EXTRA_REMOTE_PATH, file.getRemotePath());
+            callerActivity.startService(service);
+            
+            callerActivity.showLoadingDialog();
+            
+        } else {
+            // Show a Message
+            Toast t = Toast.makeText(callerActivity, callerActivity.getString(R.string.share_link_no_support_share_api), Toast.LENGTH_LONG);
+            t.show();
+            
+        }
+    }
+    
+    public void sendDownloadedFile(OCFile file, FileActivity callerActivity) {
+        if (file != null) {
+            Intent sendIntent = new Intent(android.content.Intent.ACTION_SEND);
+            // set MimeType
+            sendIntent.setType(file.getMimetype());
+            sendIntent.putExtra(Intent.EXTRA_STREAM, Uri.parse("file://" + file.getStoragePath()));
+            sendIntent.putExtra(Intent.ACTION_SEND, true);      // Send Action
+            
+            // Show dialog, without the own app
+            String[] packagesToExclude = new String[] { callerActivity.getPackageName() };
+            DialogFragment chooserDialog = ShareLinkToDialog.newInstance(sendIntent, packagesToExclude, file);
+            chooserDialog.show(callerActivity.getSupportFragmentManager(), FTAG_CHOOSER_DIALOG);
+
+        } else {
+            Log_OC.wtf(TAG, "Trying to send a NULL OCFile");
+        }
+    }
+
+}
index 68c97e4..d5a42b5 100644 (file)
@@ -22,9 +22,9 @@ import java.io.File;
 
 import com.owncloud.android.datamodel.FileDataStorageManager;
 import com.owncloud.android.datamodel.OCFile;
-import com.owncloud.android.oc_framework.operations.RemoteOperationResult;
+import com.owncloud.android.lib.common.operations.RemoteOperationResult;
 import com.owncloud.android.operations.SynchronizeFileOperation;
-import com.owncloud.android.oc_framework.operations.RemoteOperationResult.ResultCode;
+import com.owncloud.android.lib.common.operations.RemoteOperationResult.ResultCode;
 import com.owncloud.android.ui.activity.ConflictsResolveActivity;
 import com.owncloud.android.utils.Log_OC;
 
index 5d2a824..e59e37d 100644 (file)
@@ -33,12 +33,13 @@ import com.owncloud.android.authentication.AuthenticatorActivity;
 import com.owncloud.android.datamodel.FileDataStorageManager;
 import com.owncloud.android.datamodel.OCFile;
 
-import com.owncloud.android.oc_framework.network.webdav.OnDatatransferProgressListener;
-import com.owncloud.android.oc_framework.network.webdav.OwnCloudClientFactory;
-import com.owncloud.android.oc_framework.network.webdav.WebdavClient;
+import com.owncloud.android.lib.common.network.OnDatatransferProgressListener;
+import com.owncloud.android.lib.common.OwnCloudClientFactory;
+import com.owncloud.android.lib.common.OwnCloudClient;
 import com.owncloud.android.operations.DownloadFileOperation;
-import com.owncloud.android.oc_framework.operations.RemoteOperationResult;
-import com.owncloud.android.oc_framework.operations.RemoteOperationResult.ResultCode;
+import com.owncloud.android.lib.common.operations.RemoteOperationResult;
+import com.owncloud.android.lib.common.operations.RemoteOperationResult.ResultCode;
+import com.owncloud.android.lib.resources.files.FileUtils;
 import com.owncloud.android.ui.activity.FileActivity;
 import com.owncloud.android.ui.activity.FileDisplayActivity;
 import com.owncloud.android.ui.preview.PreviewImageActivity;
@@ -79,7 +80,7 @@ public class FileDownloader extends Service implements OnDatatransferProgressLis
     private Looper mServiceLooper;
     private ServiceHandler mServiceHandler;
     private IBinder mBinder;
-    private WebdavClient mDownloadClient = null;
+    private OwnCloudClient mDownloadClient = null;
     private Account mLastAccount = null;
     private FileDataStorageManager mStorageManager;
     
@@ -282,13 +283,6 @@ public class FileDownloader extends Service implements OnDatatransferProgressLis
             }
         }
 
-
-        @Override
-        public void onTransferProgress(long progressRate) {
-            // old way, should not be in use any more
-        }
-
-
         @Override
         public void onTransferProgress(long progressRate, long totalTransferredSoFar, long totalToTransfer,
                 String fileName) {
@@ -388,7 +382,7 @@ public class FileDownloader extends Service implements OnDatatransferProgressLis
      * Updates the OC File after a successful download.
      */
     private void saveDownloadedFile() {
-        OCFile file = mCurrentDownload.getFile();
+        OCFile file = mStorageManager.getFileById(mCurrentDownload.getFile().getFileId());
         long syncDate = System.currentTimeMillis();
         file.setLastSyncDateForProperties(syncDate);
         file.setLastSyncDateForData(syncDate);
@@ -437,10 +431,11 @@ public class FileDownloader extends Service implements OnDatatransferProgressLis
      * Callback method to update the progress bar in the status notification.
      */
     @Override
-    public void onTransferProgress(long progressRate, long totalTransferredSoFar, long totalToTransfer, String fileName) {
+    public void onTransferProgress(long progressRate, long totalTransferredSoFar, long totalToTransfer, String filePath) {
         int percent = (int)(100.0*((double)totalTransferredSoFar)/((double)totalToTransfer));
         if (percent != mLastPercent) {
             mNotification.contentView.setProgressBar(R.id.status_progress, 100, percent, totalToTransfer < 0);
+            String fileName = filePath.substring(filePath.lastIndexOf(FileUtils.PATH_SEPARATOR) + 1);
             String text = String.format(getString(R.string.downloader_download_in_progress_content), percent, fileName);
             mNotification.contentView.setTextViewText(R.id.status_text, text);
             mNotificationManager.notify(R.string.downloader_download_in_progress_ticker, mNotification);
@@ -450,15 +445,6 @@ public class FileDownloader extends Service implements OnDatatransferProgressLis
     
     
     /**
-     * Callback method to update the progress bar in the status notification (old version)
-     */
-    @Override
-    public void onTransferProgress(long progressRate) {
-        // NOTHING TO DO HERE ANYMORE
-    }
-    
-
-    /**
      * Updates the status notification with the result of a download operation.
      * 
      * @param downloadResult    Result of the download operation.
index fa1fec2..c675389 100644 (file)
@@ -22,6 +22,7 @@ import java.io.File;
 import java.util.HashMap;
 import java.util.Map;
 
+import com.owncloud.android.MainApp;
 import com.owncloud.android.datamodel.FileDataStorageManager;
 import com.owncloud.android.datamodel.OCFile;
 import com.owncloud.android.db.ProviderMeta.ProviderTableMeta;
@@ -141,7 +142,7 @@ public class FileObserverService extends Service {
                 null);
         if (c == null || !c.moveToFirst()) return;
         AccountManager acm = AccountManager.get(this);
-        Account[] accounts = acm.getAccounts();
+        Account[] accounts = acm.getAccountsByType(MainApp.getAccountType());
         do {
             Account account = null;
             for (Account a : accounts)
index 3595263..2f96356 100644 (file)
@@ -34,18 +34,19 @@ import com.owncloud.android.datamodel.FileDataStorageManager;
 import com.owncloud.android.datamodel.OCFile;
 import com.owncloud.android.db.DbHandler;
 import com.owncloud.android.operations.CreateFolderOperation;
-import com.owncloud.android.oc_framework.operations.RemoteFile;
-import com.owncloud.android.oc_framework.operations.RemoteOperation;
-import com.owncloud.android.oc_framework.operations.RemoteOperationResult;
+import com.owncloud.android.lib.resources.files.RemoteFile;
+import com.owncloud.android.lib.common.operations.RemoteOperation;
+import com.owncloud.android.lib.common.operations.RemoteOperationResult;
 import com.owncloud.android.operations.UploadFileOperation;
-import com.owncloud.android.oc_framework.operations.RemoteOperationResult.ResultCode;
-import com.owncloud.android.oc_framework.operations.remote.ExistenceCheckRemoteOperation;
-import com.owncloud.android.oc_framework.operations.remote.ReadRemoteFileOperation;
-import com.owncloud.android.oc_framework.utils.OwnCloudVersion;
-import com.owncloud.android.oc_framework.network.webdav.OnDatatransferProgressListener;
-import com.owncloud.android.oc_framework.accounts.OwnCloudAccount;
-import com.owncloud.android.oc_framework.network.webdav.OwnCloudClientFactory;
-import com.owncloud.android.oc_framework.network.webdav.WebdavClient;
+import com.owncloud.android.lib.common.operations.RemoteOperationResult.ResultCode;
+import com.owncloud.android.lib.resources.files.ExistenceCheckRemoteOperation;
+import com.owncloud.android.lib.resources.files.ReadRemoteFileOperation;
+import com.owncloud.android.lib.resources.files.FileUtils;
+import com.owncloud.android.lib.resources.status.OwnCloudVersion;
+import com.owncloud.android.lib.common.accounts.AccountUtils.Constants;
+import com.owncloud.android.lib.common.network.OnDatatransferProgressListener;
+import com.owncloud.android.lib.common.OwnCloudClientFactory;
+import com.owncloud.android.lib.common.OwnCloudClient;
 import com.owncloud.android.ui.activity.FailedUploadActivity;
 import com.owncloud.android.ui.activity.FileActivity;
 import com.owncloud.android.ui.activity.FileDisplayActivity;
@@ -108,7 +109,7 @@ public class FileUploader extends Service implements OnDatatransferProgressListe
     private Looper mServiceLooper;
     private ServiceHandler mServiceHandler;
     private IBinder mBinder;
-    private WebdavClient mUploadClient = null;
+    private OwnCloudClient mUploadClient = null;
     private Account mLastAccount = null;
     private FileDataStorageManager mStorageManager;
 
@@ -252,7 +253,11 @@ public class FileUploader extends Service implements OnDatatransferProgressListe
             }
         }
 
-        OwnCloudVersion ocv = new OwnCloudVersion(AccountManager.get(this).getUserData(account, OwnCloudAccount.Constants.KEY_OC_VERSION));
+        AccountManager aMgr = AccountManager.get(this);
+        String version = aMgr.getUserData(account, Constants.KEY_OC_VERSION);
+        String versionString = aMgr.getUserData(account, Constants.KEY_OC_VERSION_STRING);
+        OwnCloudVersion ocv = new OwnCloudVersion(version, versionString);
+        
         boolean chunked = FileUploader.chunkedUploadIsSupported(ocv);
         AbstractList<String> requestedUploads = new Vector<String>();
         String uploadKey = null;
@@ -417,12 +422,6 @@ public class FileUploader extends Service implements OnDatatransferProgressListe
 
 
         @Override
-        public void onTransferProgress(long progressRate) {
-            // old way, should not be in use any more
-        }
-
-
-        @Override
         public void onTransferProgress(long progressRate, long totalTransferredSoFar, long totalToTransfer,
                 String fileName) {
             String key = buildRemoteName(mCurrentUpload.getAccount(), mCurrentUpload.getFile());
@@ -602,6 +601,9 @@ public class FileUploader extends Service implements OnDatatransferProgressListe
      */
     private void saveUploadedFile() {
         OCFile file = mCurrentUpload.getFile();
+        if (file.fileExists()) {
+            file = mStorageManager.getFileById(file.getFileId());
+        }
         long syncDate = System.currentTimeMillis();
         file.setLastSyncDateForData(syncDate);
 
@@ -610,7 +612,7 @@ public class FileUploader extends Service implements OnDatatransferProgressListe
         ReadRemoteFileOperation operation = new ReadRemoteFileOperation(mCurrentUpload.getRemotePath());
         RemoteOperationResult result = operation.execute(mUploadClient);
         if (result.isSuccess()) {
-            updateOCFile(file, result.getData().get(0));
+            updateOCFile(file, (RemoteFile) result.getData().get(0));
             file.setLastSyncDateForProperties(syncDate);
         }
         
@@ -706,10 +708,11 @@ public class FileUploader extends Service implements OnDatatransferProgressListe
      * Callback method to update the progress bar in the status notification
      */
     @Override
-    public void onTransferProgress(long progressRate, long totalTransferredSoFar, long totalToTransfer, String fileName) {
+    public void onTransferProgress(long progressRate, long totalTransferredSoFar, long totalToTransfer, String filePath) {
         int percent = (int) (100.0 * ((double) totalTransferredSoFar) / ((double) totalToTransfer));
         if (percent != mLastPercent) {
             mNotification.contentView.setProgressBar(R.id.status_progress, 100, percent, false);
+            String fileName = filePath.substring(filePath.lastIndexOf(FileUtils.PATH_SEPARATOR) + 1);
             String text = String.format(getString(R.string.uploader_upload_in_progress_content), percent, fileName);
             mNotification.contentView.setTextViewText(R.id.status_text, text);
             mNotificationManager.notify(R.string.uploader_upload_in_progress_ticker, mNotification);
@@ -718,15 +721,6 @@ public class FileUploader extends Service implements OnDatatransferProgressListe
     }
 
     /**
-     * Callback method to update the progress bar in the status notification
-     * (old version)
-     */
-    @Override
-    public void onTransferProgress(long progressRate) {
-        // NOTHING TO DO HERE ANYMORE
-    }
-
-    /**
      * Updates the status notification with the result of an upload operation.
      * 
      * @param uploadResult Result of the upload operation.
index 1cf1f84..19e9ddc 100644 (file)
@@ -19,11 +19,11 @@ package com.owncloud.android.operations;
 
 import com.owncloud.android.datamodel.FileDataStorageManager;
 import com.owncloud.android.datamodel.OCFile;
-import com.owncloud.android.oc_framework.network.webdav.WebdavClient;
-import com.owncloud.android.oc_framework.operations.remote.CreateRemoteFolderOperation;
-import com.owncloud.android.oc_framework.operations.OnRemoteOperationListener;
-import com.owncloud.android.oc_framework.operations.RemoteOperation;
-import com.owncloud.android.oc_framework.operations.RemoteOperationResult;
+import com.owncloud.android.lib.common.OwnCloudClient;
+import com.owncloud.android.lib.resources.files.CreateRemoteFolderOperation;
+import com.owncloud.android.lib.common.operations.OnRemoteOperationListener;
+import com.owncloud.android.lib.common.operations.RemoteOperation;
+import com.owncloud.android.lib.common.operations.RemoteOperationResult;
 import com.owncloud.android.utils.FileStorageUtils;
 import com.owncloud.android.utils.Log_OC;
 
@@ -58,7 +58,7 @@ public class CreateFolderOperation extends RemoteOperation implements OnRemoteOp
 
 
     @Override
-    protected RemoteOperationResult run(WebdavClient client) {
+    protected RemoteOperationResult run(OwnCloudClient client) {
         CreateRemoteFolderOperation operation = new CreateRemoteFolderOperation(mRemotePath, mCreateFullPath);
         RemoteOperationResult result =  operation.execute(client);
         
diff --git a/src/com/owncloud/android/operations/CreateShareOperation.java b/src/com/owncloud/android/operations/CreateShareOperation.java
new file mode 100644 (file)
index 0000000..7277b3a
--- /dev/null
@@ -0,0 +1,127 @@
+/* ownCloud Android client application
+ *   Copyright (C) 2014 ownCloud Inc.
+ *
+ *   This program is free software: you can redistribute it and/or modify
+ *   it under the terms of the GNU General Public License version 2,
+ *   as published by the Free Software Foundation.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+package com.owncloud.android.operations;
+
+/**
+ * Creates a new share from a given file
+ * 
+ * @author masensio
+ *
+ */
+
+import android.content.Intent;
+
+import com.owncloud.android.datamodel.FileDataStorageManager;
+import com.owncloud.android.datamodel.OCFile;
+import com.owncloud.android.lib.common.OwnCloudClient;
+import com.owncloud.android.lib.resources.shares.OCShare;
+import com.owncloud.android.lib.common.operations.RemoteOperationResult;
+import com.owncloud.android.lib.resources.shares.ShareType;
+import com.owncloud.android.lib.resources.shares.CreateRemoteShareOperation;
+import com.owncloud.android.lib.resources.files.FileUtils;
+import com.owncloud.android.operations.common.SyncOperation;
+import com.owncloud.android.utils.Log_OC;
+
+public class CreateShareOperation extends SyncOperation {
+
+    private static final String TAG = CreateShareOperation.class.getSimpleName();
+
+    protected FileDataStorageManager mStorageManager;
+
+    private String mPath;
+    private ShareType mShareType;
+    private String mShareWith;
+    private boolean mPublicUpload;
+    private String mPassword;
+    private int mPermissions;
+    private Intent mSendIntent;
+
+    /**
+     * Constructor
+     * @param path          Full path of the file/folder being shared. Mandatory argument
+     * @param shareType     \910\92 = user, \911\92 = group, \913\92 = Public link. Mandatory argument
+     * @param shareWith     User/group ID with who the file should be shared.  This is mandatory for shareType of 0 or 1
+     * @param publicUpload  If \91false\92 (default) public cannot upload to a public shared folder. 
+     *                      If \91true\92 public can upload to a shared folder. Only available for public link shares
+     * @param password      Password to protect a public link share. Only available for public link shares
+     * @param permissions   1 - Read only \96 Default for \93public\94 shares
+     *                      2 - Update
+     *                      4 - Create
+     *                      8 - Delete
+     *                      16- Re-share
+     *                      31- All above \96 Default for \93private\94 shares
+     *                      For user or group shares.
+     *                      To obtain combinations, add the desired values together.  
+     *                      For instance, for \93Re-Share\94\93delete\94\93read\94\93update\94, add 16+8+2+1 = 27.
+     */
+    public CreateShareOperation(String path, ShareType shareType, String shareWith, boolean publicUpload, 
+            String password, int permissions, Intent sendIntent) {
+
+        mPath = path;
+        mShareType = shareType;
+        mShareWith = shareWith;
+        mPublicUpload = publicUpload;
+        mPassword = password;
+        mPermissions = permissions;
+        mSendIntent = sendIntent;
+    }
+
+    @Override
+    protected RemoteOperationResult run(OwnCloudClient client) {
+        CreateRemoteShareOperation operation = new CreateRemoteShareOperation(mPath, mShareType, mShareWith, mPublicUpload, mPassword, mPermissions);
+        RemoteOperationResult result = operation.execute(client);
+
+        if (result.isSuccess()) {
+
+            if (result.getData().size() > 0) {
+                OCShare share = (OCShare) result.getData().get(0);
+
+                // Update DB with the response
+                share.setPath(mPath);
+                if (mPath.endsWith(FileUtils.PATH_SEPARATOR)) {
+                    share.setIsFolder(true);
+                } else {
+                    share.setIsFolder(false);
+                }
+                share.setPermissions(mPermissions);
+                
+                getStorageManager().saveShare(share);
+                
+                // Update OCFile with data from share: ShareByLink  and publicLink
+                OCFile file = getStorageManager().getFileByPath(mPath);
+                if (file!=null) {
+                    mSendIntent.putExtra(Intent.EXTRA_TEXT, share.getShareLink());
+                    file.setPublicLink(share.getShareLink());
+                    file.setShareByLink(true);
+                    getStorageManager().saveFile(file);
+                    Log_OC.d(TAG, "Public Link = " + file.getPublicLink());
+
+                }
+            }
+        }
+
+
+        return result;
+    }
+    
+    
+    public Intent getSendIntent() {
+        return mSendIntent;
+    }
+
+}
index 8d89f63..c672d57 100644 (file)
@@ -23,12 +23,11 @@ import java.util.Iterator;
 import java.util.Set;
 
 import com.owncloud.android.datamodel.OCFile;
-import com.owncloud.android.oc_framework.network.webdav.OnDatatransferProgressListener;
-import com.owncloud.android.oc_framework.network.webdav.WebdavClient;
-import com.owncloud.android.oc_framework.operations.RemoteFile;
-import com.owncloud.android.oc_framework.operations.RemoteOperation;
-import com.owncloud.android.oc_framework.operations.RemoteOperationResult;
-import com.owncloud.android.oc_framework.operations.remote.DownloadRemoteFileOperation;
+import com.owncloud.android.lib.common.network.OnDatatransferProgressListener;
+import com.owncloud.android.lib.common.OwnCloudClient;
+import com.owncloud.android.lib.common.operations.RemoteOperation;
+import com.owncloud.android.lib.common.operations.RemoteOperationResult;
+import com.owncloud.android.lib.resources.files.DownloadRemoteFileOperation;
 import com.owncloud.android.utils.FileStorageUtils;
 import com.owncloud.android.utils.Log_OC;
 
@@ -119,7 +118,7 @@ public class DownloadFileOperation extends RemoteOperation {
     }
 
     @Override
-    protected RemoteOperationResult run(WebdavClient client) {
+    protected RemoteOperationResult run(OwnCloudClient client) {
         RemoteOperationResult result = null;
         File newFile = null;
         boolean moved = true;
@@ -128,10 +127,9 @@ public class DownloadFileOperation extends RemoteOperation {
         File tmpFile = new File(getTmpPath());
         
         String tmpFolder =  getTmpFolder();
-        RemoteFile remoteFile = FileStorageUtils.fillRemoteFile(mFile);
         
         /// perform the download
-        mDownloadOperation = new DownloadRemoteFileOperation(remoteFile, tmpFolder);
+        mDownloadOperation = new DownloadRemoteFileOperation(mFile.getRemotePath(), tmpFolder);
         Iterator<OnDatatransferProgressListener> listener = mDataTransferListeners.iterator();
         while (listener.hasNext()) {
             mDownloadOperation.addDatatransferProgressListener(listener.next());
@@ -139,6 +137,7 @@ public class DownloadFileOperation extends RemoteOperation {
         result = mDownloadOperation.execute(client);
         
         if (result.isSuccess()) {
+            mModificationTimestamp = mDownloadOperation.getModificationTimestamp();
             newFile = new File(getSavePath());
             newFile.getParentFile().mkdirs();
             moved = tmpFile.renameTo(newFile);
diff --git a/src/com/owncloud/android/operations/GetSharesForFileOperation.java b/src/com/owncloud/android/operations/GetSharesForFileOperation.java
new file mode 100644 (file)
index 0000000..3ffb0a5
--- /dev/null
@@ -0,0 +1,79 @@
+/* ownCloud Android client application
+ *   Copyright (C) 2012-2013 ownCloud Inc.
+ *
+ *   This program is free software: you can redistribute it and/or modify
+ *   it under the terms of the GNU General Public License version 2,
+ *   as published by the Free Software Foundation.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+
+package com.owncloud.android.operations;
+
+import java.util.ArrayList;
+
+import com.owncloud.android.lib.common.OwnCloudClient;
+import com.owncloud.android.lib.resources.shares.OCShare;
+import com.owncloud.android.lib.common.operations.RemoteOperationResult;
+import com.owncloud.android.lib.resources.shares.GetRemoteSharesForFileOperation;
+import com.owncloud.android.operations.common.SyncOperation;
+import com.owncloud.android.utils.Log_OC;
+
+/**
+ * Provide a list shares for a specific file.  
+ * 
+ * @author masensio
+ *
+ */
+public class GetSharesForFileOperation extends SyncOperation {
+    
+    private static final String TAG = GetSharesForFileOperation.class.getSimpleName();
+    
+    private String mPath;
+    private boolean mReshares;
+    private boolean mSubfiles;
+
+    /**
+     * Constructor
+     * 
+     * @param path      Path to file or folder
+     * @param reshares  If set to \91false\92 (default), only shares from the current user are returned
+     *                  If set to \91true\92, all shares from the given file are returned
+     * @param subfiles  If set to \91false\92 (default), lists only the folder being shared
+     *                  If set to \91true\92, all shared files within the folder are returned.
+     */
+    public GetSharesForFileOperation(String path, boolean reshares, boolean subfiles) {
+        mPath = path;
+        mReshares = reshares;
+        mSubfiles = subfiles;
+    }
+
+    @Override
+    protected RemoteOperationResult run(OwnCloudClient client) {
+        GetRemoteSharesForFileOperation operation = new GetRemoteSharesForFileOperation(mPath, mReshares, mSubfiles);
+        RemoteOperationResult result = operation.execute(client);
+
+        if (result.isSuccess()) {
+
+            // Update DB with the response
+            Log_OC.d(TAG, "File = " + mPath + " Share list size  " + result.getData().size());
+            ArrayList<OCShare> shares = new ArrayList<OCShare>();
+            for(Object obj: result.getData()) {
+                shares.add((OCShare) obj);
+            }
+
+            getStorageManager().saveSharesDB(shares);
+        }
+
+        return result;
+    }
+
+}
diff --git a/src/com/owncloud/android/operations/GetSharesOperation.java b/src/com/owncloud/android/operations/GetSharesOperation.java
new file mode 100644 (file)
index 0000000..c9cce40
--- /dev/null
@@ -0,0 +1,61 @@
+/* ownCloud Android client application
+ *   Copyright (C) 2012-2014 ownCloud Inc.
+ *
+ *   This program is free software: you can redistribute it and/or modify
+ *   it under the terms of the GNU General Public License version 2,
+ *   as published by the Free Software Foundation.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+package com.owncloud.android.operations;
+
+import java.util.ArrayList;
+
+import com.owncloud.android.lib.common.OwnCloudClient;
+import com.owncloud.android.lib.common.operations.RemoteOperationResult;
+import com.owncloud.android.lib.resources.shares.OCShare;
+import com.owncloud.android.lib.resources.shares.GetRemoteSharesOperation;
+import com.owncloud.android.operations.common.SyncOperation;
+import com.owncloud.android.utils.Log_OC;
+
+/**
+ * Access to remote operation to get the share files/folders
+ * Save the data in Database
+ * 
+ * @author masensio
+ * @author David A. Velasco
+ */
+
+public class GetSharesOperation extends SyncOperation {
+
+    private static final String TAG = GetSharesOperation.class.getSimpleName();
+
+    @Override
+    protected RemoteOperationResult run(OwnCloudClient client) {
+        GetRemoteSharesOperation operation = new GetRemoteSharesOperation();
+        RemoteOperationResult result = operation.execute(client);
+
+        if (result.isSuccess()) {
+
+            // Update DB with the response
+            Log_OC.d(TAG, "Share list size = " + result.getData().size());
+            ArrayList<OCShare> shares = new ArrayList<OCShare>();
+            for(Object obj: result.getData()) {
+                shares.add((OCShare) obj);
+            }
+
+            getStorageManager().saveSharesDB(shares);
+        }
+
+        return result;
+    }
+
+}
index d392645..e2d72c5 100644 (file)
@@ -9,10 +9,10 @@ import org.json.JSONException;
 import org.json.JSONObject;
 
 import com.owncloud.android.authentication.OAuth2Constants;
-import com.owncloud.android.oc_framework.network.webdav.WebdavClient;
-import com.owncloud.android.oc_framework.operations.RemoteOperation;
-import com.owncloud.android.oc_framework.operations.RemoteOperationResult;
-import com.owncloud.android.oc_framework.operations.RemoteOperationResult.ResultCode;
+import com.owncloud.android.lib.common.OwnCloudClient;
+import com.owncloud.android.lib.common.operations.RemoteOperation;
+import com.owncloud.android.lib.common.operations.RemoteOperationResult;
+import com.owncloud.android.lib.common.operations.RemoteOperationResult.ResultCode;
 import com.owncloud.android.utils.Log_OC;
 
 
@@ -48,7 +48,7 @@ public class OAuth2GetAccessToken extends RemoteOperation {
     }
     
     @Override
-    protected RemoteOperationResult run(WebdavClient client) {
+    protected RemoteOperationResult run(OwnCloudClient client) {
         RemoteOperationResult result = null;
         PostMethod postMethod = null;
         
@@ -70,7 +70,7 @@ public class OAuth2GetAccessToken extends RemoteOperation {
                 nameValuePairs[3] = new NameValuePair(OAuth2Constants.KEY_CLIENT_ID, mClientId);
                 //nameValuePairs[4] = new NameValuePair(OAuth2Constants.KEY_SCOPE, mOAuth2ParsedAuthorizationResponse.get(OAuth2Constants.KEY_SCOPE));         
                 
-                postMethod = new PostMethod(client.getBaseUri().toString());
+                postMethod = new PostMethod(client.getWebdavUri().toString());
                 postMethod.setRequestBody(nameValuePairs);
                 int status = client.executeMethod(postMethod);
                 
@@ -99,16 +99,16 @@ public class OAuth2GetAccessToken extends RemoteOperation {
                 postMethod.releaseConnection();    // let the connection available for other methods
             
             if (result.isSuccess()) {
-                Log_OC.i(TAG, "OAuth2 TOKEN REQUEST with auth code " + mOAuth2ParsedAuthorizationResponse.get("code") + " to " + client.getBaseUri() + ": " + result.getLogMessage());
+                Log_OC.i(TAG, "OAuth2 TOKEN REQUEST with auth code " + mOAuth2ParsedAuthorizationResponse.get("code") + " to " + client.getWebdavUri() + ": " + result.getLogMessage());
             
             } else if (result.getException() != null) {
-                Log_OC.e(TAG, "OAuth2 TOKEN REQUEST with auth code " + mOAuth2ParsedAuthorizationResponse.get("code") + " to " + client.getBaseUri() + ": " + result.getLogMessage(), result.getException());
+                Log_OC.e(TAG, "OAuth2 TOKEN REQUEST with auth code " + mOAuth2ParsedAuthorizationResponse.get("code") + " to " + client.getWebdavUri() + ": " + result.getLogMessage(), result.getException());
                 
             } else if (result.getCode() == ResultCode.OAUTH2_ERROR) {
-                Log_OC.e(TAG, "OAuth2 TOKEN REQUEST with auth code " + mOAuth2ParsedAuthorizationResponse.get("code") + " to " + client.getBaseUri() + ": " + ((mResultTokenMap != null) ? mResultTokenMap.get(OAuth2Constants.KEY_ERROR) : "NULL"));
+                Log_OC.e(TAG, "OAuth2 TOKEN REQUEST with auth code " + mOAuth2ParsedAuthorizationResponse.get("code") + " to " + client.getWebdavUri() + ": " + ((mResultTokenMap != null) ? mResultTokenMap.get(OAuth2Constants.KEY_ERROR) : "NULL"));
                     
             } else {
-                Log_OC.e(TAG, "OAuth2 TOKEN REQUEST with auth code " + mOAuth2ParsedAuthorizationResponse.get("code") + " to " + client.getBaseUri() + ": " + result.getLogMessage());
+                Log_OC.e(TAG, "OAuth2 TOKEN REQUEST with auth code " + mOAuth2ParsedAuthorizationResponse.get("code") + " to " + client.getWebdavUri() + ": " + result.getLogMessage());
             }
         }
         
diff --git a/src/com/owncloud/android/operations/OwnCloudServerCheckOperation.java b/src/com/owncloud/android/operations/OwnCloudServerCheckOperation.java
deleted file mode 100644 (file)
index 8209685..0000000
+++ /dev/null
@@ -1,139 +0,0 @@
-/* ownCloud Android client application
- *   Copyright (C) 2012-2013 ownCloud Inc.
- *
- *   This program is free software: you can redistribute it and/or modify
- *   it under the terms of the GNU General Public License version 2,
- *   as published by the Free Software Foundation.
- *
- *   This program is distributed in the hope that it will be useful,
- *   but WITHOUT ANY WARRANTY; without even the implied warranty of
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *   GNU General Public License for more details.
- *
- *   You should have received a copy of the GNU General Public License
- *   along with this program.  If not, see <http://www.gnu.org/licenses/>.
- *
- */
-
-package com.owncloud.android.operations;
-
-import org.apache.commons.httpclient.HttpStatus;
-import org.apache.commons.httpclient.methods.GetMethod;
-import org.json.JSONException;
-import org.json.JSONObject;
-
-import com.owncloud.android.authentication.AccountUtils;
-import com.owncloud.android.oc_framework.network.webdav.WebdavClient;
-import com.owncloud.android.oc_framework.operations.RemoteOperation;
-import com.owncloud.android.oc_framework.operations.RemoteOperationResult;
-import com.owncloud.android.oc_framework.utils.OwnCloudVersion;
-import com.owncloud.android.utils.Log_OC;
-
-import android.content.Context;
-import android.net.ConnectivityManager;
-import android.net.Uri;
-
-public class OwnCloudServerCheckOperation extends RemoteOperation {
-    
-    /** Maximum time to wait for a response from the server when the connection is being tested, in MILLISECONDs.  */
-    public static final int TRY_CONNECTION_TIMEOUT = 5000;
-    
-    private static final String TAG = OwnCloudServerCheckOperation.class.getSimpleName();
-    
-    private String mUrl;
-    private RemoteOperationResult mLatestResult;
-    private Context mContext;
-    private OwnCloudVersion mOCVersion;
-
-    public OwnCloudServerCheckOperation(String url, Context context) {
-        mUrl = url;
-        mContext = context;
-        mOCVersion = null;
-    }
-    
-    public OwnCloudVersion getDiscoveredVersion() {
-        return mOCVersion;
-    }
-
-    private boolean tryConnection(WebdavClient wc, String urlSt) {
-        boolean retval = false;
-        GetMethod get = null;
-        try {
-            get = new GetMethod(urlSt);
-            int status = wc.executeMethod(get, TRY_CONNECTION_TIMEOUT, TRY_CONNECTION_TIMEOUT);
-            String response = get.getResponseBodyAsString();
-            if (status == HttpStatus.SC_OK) {
-                JSONObject json = new JSONObject(response);
-                if (!json.getBoolean("installed")) {
-                    mLatestResult = new RemoteOperationResult(RemoteOperationResult.ResultCode.INSTANCE_NOT_CONFIGURED);
-                } else {
-                    mOCVersion = new OwnCloudVersion(json.getString("version"));
-                    if (!mOCVersion.isVersionValid()) {
-                        mLatestResult = new RemoteOperationResult(RemoteOperationResult.ResultCode.BAD_OC_VERSION);
-                        
-                    } else {
-                        mLatestResult = new RemoteOperationResult(urlSt.startsWith("https://") ? 
-                                                                    RemoteOperationResult.ResultCode.OK_SSL : 
-                                                                    RemoteOperationResult.ResultCode.OK_NO_SSL
-                            );
-
-                        retval = true;
-                    }
-                }
-                
-            } else {
-                mLatestResult = new RemoteOperationResult(false, status, get.getResponseHeaders());
-            }
-
-        } catch (JSONException e) {
-            mLatestResult = new RemoteOperationResult(RemoteOperationResult.ResultCode.INSTANCE_NOT_CONFIGURED);
-            
-        } catch (Exception e) {
-            mLatestResult = new RemoteOperationResult(e);
-            
-        } finally {
-            if (get != null)
-                get.releaseConnection();
-        }
-        
-        if (mLatestResult.isSuccess()) {
-            Log_OC.i(TAG, "Connection check at " + urlSt + ": " + mLatestResult.getLogMessage());
-            
-        } else if (mLatestResult.getException() != null) {
-            Log_OC.e(TAG, "Connection check at " + urlSt + ": " + mLatestResult.getLogMessage(), mLatestResult.getException());
-            
-        } else {
-            Log_OC.e(TAG, "Connection check at " + urlSt + ": " + mLatestResult.getLogMessage());
-        }
-
-        return retval;
-    }
-
-    private boolean isOnline() {
-        ConnectivityManager cm = (ConnectivityManager) mContext
-                .getSystemService(Context.CONNECTIVITY_SERVICE);
-        return cm != null && cm.getActiveNetworkInfo() != null
-                && cm.getActiveNetworkInfo().isConnectedOrConnecting();
-    }
-
-       @Override
-       protected RemoteOperationResult run(WebdavClient client) {
-        if (!isOnline()) {
-               return new RemoteOperationResult(RemoteOperationResult.ResultCode.NO_NETWORK_CONNECTION);
-        }
-        if (mUrl.startsWith("http://") || mUrl.startsWith("https://")) {
-            tryConnection(client, mUrl + AccountUtils.STATUS_PATH);
-            
-        } else {
-            client.setBaseUri(Uri.parse("https://" + mUrl + AccountUtils.STATUS_PATH));
-            boolean httpsSuccess = tryConnection(client, "https://" + mUrl + AccountUtils.STATUS_PATH); 
-            if (!httpsSuccess && !mLatestResult.isSslRecoverableException()) {
-                Log_OC.d(TAG, "establishing secure connection failed, trying non secure connection");
-                client.setBaseUri(Uri.parse("http://" + mUrl + AccountUtils.STATUS_PATH));
-                tryConnection(client, "http://" + mUrl + AccountUtils.STATUS_PATH);
-            }
-        }
-        return mLatestResult;
-       }
-       
-}
index 0ab8ac3..ff673ca 100644 (file)
@@ -19,11 +19,11 @@ package com.owncloud.android.operations;
 
 import com.owncloud.android.datamodel.FileDataStorageManager;
 import com.owncloud.android.datamodel.OCFile;
-import com.owncloud.android.oc_framework.network.webdav.WebdavClient;
-import com.owncloud.android.oc_framework.operations.RemoteOperation;
-import com.owncloud.android.oc_framework.operations.RemoteOperationResult;
-import com.owncloud.android.oc_framework.operations.RemoteOperationResult.ResultCode;
-import com.owncloud.android.oc_framework.operations.remote.RemoveRemoteFileOperation;
+import com.owncloud.android.lib.common.OwnCloudClient;
+import com.owncloud.android.lib.common.operations.RemoteOperation;
+import com.owncloud.android.lib.common.operations.RemoteOperationResult;
+import com.owncloud.android.lib.common.operations.RemoteOperationResult.ResultCode;
+import com.owncloud.android.lib.resources.files.RemoveRemoteFileOperation;
 
 
 /**
@@ -69,7 +69,7 @@ public class RemoveFileOperation extends RemoteOperation {
      * @param   client      Client object to communicate with the remote ownCloud server.
      */
     @Override
-    protected RemoteOperationResult run(WebdavClient client) {
+    protected RemoteOperationResult run(OwnCloudClient client) {
         RemoteOperationResult result = null;
         
         RemoveRemoteFileOperation operation = new RemoveRemoteFileOperation(mFileToRemove.getRemotePath());
index be6cdcc..a007af2 100644 (file)
@@ -22,11 +22,11 @@ import java.io.IOException;
 
 import com.owncloud.android.datamodel.FileDataStorageManager;
 import com.owncloud.android.datamodel.OCFile;
-import com.owncloud.android.oc_framework.network.webdav.WebdavClient;
-import com.owncloud.android.oc_framework.operations.RemoteOperation;
-import com.owncloud.android.oc_framework.operations.RemoteOperationResult;
-import com.owncloud.android.oc_framework.operations.RemoteOperationResult.ResultCode;
-import com.owncloud.android.oc_framework.operations.remote.RenameRemoteFileOperation;
+import com.owncloud.android.lib.common.OwnCloudClient;
+import com.owncloud.android.lib.common.operations.RemoteOperation;
+import com.owncloud.android.lib.common.operations.RemoteOperationResult;
+import com.owncloud.android.lib.common.operations.RemoteOperationResult.ResultCode;
+import com.owncloud.android.lib.resources.files.RenameRemoteFileOperation;
 import com.owncloud.android.utils.FileStorageUtils;
 import com.owncloud.android.utils.Log_OC;
 
@@ -77,7 +77,7 @@ public class RenameFileOperation extends RemoteOperation {
      * @param   client      Client object to communicate with the remote ownCloud server.
      */
     @Override
-    protected RemoteOperationResult run(WebdavClient client) {
+    protected RemoteOperationResult run(OwnCloudClient client) {
         RemoteOperationResult result = null;
         
         // check if the new name is valid in the local file system
index 71d7f72..7189167 100644 (file)
@@ -22,11 +22,12 @@ import com.owncloud.android.datamodel.FileDataStorageManager;
 import com.owncloud.android.datamodel.OCFile;
 import com.owncloud.android.files.services.FileDownloader;
 import com.owncloud.android.files.services.FileUploader;
-import com.owncloud.android.oc_framework.network.webdav.WebdavClient;
-import com.owncloud.android.oc_framework.operations.RemoteOperation;
-import com.owncloud.android.oc_framework.operations.RemoteOperationResult;
-import com.owncloud.android.oc_framework.operations.RemoteOperationResult.ResultCode;
-import com.owncloud.android.oc_framework.operations.remote.ReadRemoteFileOperation;
+import com.owncloud.android.lib.common.OwnCloudClient;
+import com.owncloud.android.lib.resources.files.RemoteFile;
+import com.owncloud.android.lib.common.operations.RemoteOperation;
+import com.owncloud.android.lib.common.operations.RemoteOperationResult;
+import com.owncloud.android.lib.common.operations.RemoteOperationResult.ResultCode;
+import com.owncloud.android.lib.resources.files.ReadRemoteFileOperation;
 import com.owncloud.android.utils.FileStorageUtils;
 import com.owncloud.android.utils.Log_OC;
 
@@ -72,7 +73,7 @@ public class SynchronizeFileOperation extends RemoteOperation {
 
 
     @Override
-    protected RemoteOperationResult run(WebdavClient client) {
+    protected RemoteOperationResult run(OwnCloudClient client) {
 
         RemoteOperationResult result = null;
         mTransferWasRequested = false;
@@ -89,12 +90,12 @@ public class SynchronizeFileOperation extends RemoteOperation {
                 ReadRemoteFileOperation operation = new ReadRemoteFileOperation(remotePath);
                 result = operation.execute(client);
                 if (result.isSuccess()){
-                    mServerFile = FileStorageUtils.fillOCFile(result.getData().get(0));
+                    mServerFile = FileStorageUtils.fillOCFile((RemoteFile) result.getData().get(0));
                     mServerFile.setLastSyncDateForProperties(System.currentTimeMillis());
                 }
             }
 
-            if (result.isSuccess()) {   
+            if (mServerFile != null) {   
 
                 /// check changes in server and local file
                 boolean serverChanged = false;
index ff387c0..5d95707 100644 (file)
@@ -33,17 +33,23 @@ import org.apache.http.HttpStatus;
 import android.accounts.Account;
 import android.content.Context;
 import android.content.Intent;
+//import android.support.v4.content.LocalBroadcastManager;
 
 import com.owncloud.android.datamodel.FileDataStorageManager;
 import com.owncloud.android.datamodel.OCFile;
-import com.owncloud.android.oc_framework.network.webdav.WebdavClient;
-import com.owncloud.android.oc_framework.operations.RemoteOperation;
-import com.owncloud.android.oc_framework.operations.RemoteOperationResult;
-import com.owncloud.android.oc_framework.operations.RemoteOperationResult.ResultCode;
-import com.owncloud.android.oc_framework.operations.remote.ReadRemoteFileOperation;
-import com.owncloud.android.oc_framework.operations.remote.ReadRemoteFolderOperation;
-import com.owncloud.android.oc_framework.operations.RemoteFile;
-import com.owncloud.android.syncadapter.FileSyncService;
+
+import com.owncloud.android.lib.common.OwnCloudClient;
+import com.owncloud.android.lib.resources.shares.OCShare;
+import com.owncloud.android.lib.common.operations.RemoteOperation;
+import com.owncloud.android.lib.common.operations.RemoteOperationResult;
+import com.owncloud.android.lib.common.operations.RemoteOperationResult.ResultCode;
+import com.owncloud.android.lib.resources.shares.GetRemoteSharesForFileOperation;
+import com.owncloud.android.lib.resources.files.FileUtils;
+import com.owncloud.android.lib.resources.files.ReadRemoteFileOperation;
+import com.owncloud.android.lib.resources.files.ReadRemoteFolderOperation;
+import com.owncloud.android.lib.resources.files.RemoteFile;
+
+import com.owncloud.android.syncadapter.FileSyncAdapter;
 import com.owncloud.android.utils.FileStorageUtils;
 import com.owncloud.android.utils.Log_OC;
 
@@ -64,6 +70,8 @@ public class SynchronizeFolderOperation extends RemoteOperation {
 
     private static final String TAG = SynchronizeFolderOperation.class.getSimpleName();
 
+    public static final String EVENT_SINGLE_FOLDER_CONTENTS_SYNCED  = SynchronizeFolderOperation.class.getName() + ".EVENT_SINGLE_FOLDER_CONTENTS_SYNCED";
+    public static final String EVENT_SINGLE_FOLDER_SHARES_SYNCED    = SynchronizeFolderOperation.class.getName() + ".EVENT_SINGLE_FOLDER_SHARES_SYNCED";
     
     /** Time stamp for the synchronization process in progress */
     private long mCurrentSyncTime;
@@ -95,9 +103,12 @@ public class SynchronizeFolderOperation extends RemoteOperation {
     /** 'True' means that this operation is part of a full account synchronization */ 
     private boolean mSyncFullAccount;
 
+    /** 'True' means that Share resources bound to the files into the folder should be refreshed also */
+    private boolean mIsShareSupported;
+    
     /** 'True' means that the remote folder changed from last synchronization and should be fetched */
     private boolean mRemoteFolderChanged;
-    
+
     
     /**
      * Creates a new instance of {@link SynchronizeFolderOperation}.
@@ -114,12 +125,14 @@ public class SynchronizeFolderOperation extends RemoteOperation {
     public SynchronizeFolderOperation(  OCFile folder, 
                                         long currentSyncTime, 
                                         boolean syncFullAccount,
+                                        boolean isShareSupported,
                                         FileDataStorageManager dataStorageManager, 
                                         Account account, 
                                         Context context ) {
         mLocalFolder = folder;
         mCurrentSyncTime = currentSyncTime;
         mSyncFullAccount = syncFullAccount;
+        mIsShareSupported = isShareSupported;
         mStorageManager = dataStorageManager;
         mAccount = account;
         mContext = context;
@@ -155,12 +168,16 @@ public class SynchronizeFolderOperation extends RemoteOperation {
      * {@inheritDoc}
      */
     @Override
-    protected RemoteOperationResult run(WebdavClient client) {
+    protected RemoteOperationResult run(OwnCloudClient client) {
         RemoteOperationResult result = null;
         mFailsInFavouritesFound = 0;
         mConflictsFound = 0;
         mForgottenLocalFiles.clear();
         
+        if (FileUtils.PATH_SEPARATOR.equals(mLocalFolder.getRemotePath()) && !mSyncFullAccount) {
+            updateOCVersion(client);
+        }
+        
         result = checkForChanges(client);
         
         if (result.isSuccess()) {
@@ -172,51 +189,72 @@ public class SynchronizeFolderOperation extends RemoteOperation {
         }
         
         if (!mSyncFullAccount) {            
-            sendStickyBroadcast(false, mLocalFolder.getRemotePath(), result);
+            sendLocalBroadcast(EVENT_SINGLE_FOLDER_CONTENTS_SYNCED, mLocalFolder.getRemotePath(), result);
         }
-
+        
+        if (result.isSuccess() && mIsShareSupported) {
+            RemoteOperationResult shareResult = refreshSharesForFolder(client);
+            if (shareResult.getCode() != ResultCode.FILE_NOT_FOUND) {
+                result = shareResult;
+            } // else , keep the previous result ; being conservative for servers where Sharing API is supported, but disabled
+        }
+        
+        if (!mSyncFullAccount) {            
+            sendLocalBroadcast(EVENT_SINGLE_FOLDER_SHARES_SYNCED, mLocalFolder.getRemotePath(), result);
+        }
+        
         return result;
         
     }
 
 
-    private RemoteOperationResult checkForChanges(WebdavClient client) {
+    private void updateOCVersion(OwnCloudClient client) {
+        UpdateOCVersionOperation update = new UpdateOCVersionOperation(mAccount, mContext);
+        RemoteOperationResult result = update.execute(client);
+        if (result.isSuccess()) {
+            mIsShareSupported = update.getOCVersion().isSharedSupported();
+        }
+    }
+
+    
+    private RemoteOperationResult checkForChanges(OwnCloudClient client) {
         mRemoteFolderChanged = false;
         RemoteOperationResult result = null;
         String remotePath = null;
 
-            remotePath = mLocalFolder.getRemotePath();
-            Log_OC.d(TAG, "Checking changes in " + mAccount.name + remotePath);
-
-            // remote request 
-            ReadRemoteFileOperation operation = new ReadRemoteFileOperation(remotePath);
-            result = operation.execute(client);
-            if (result.isSuccess()){
-                OCFile remoteFolder = FileStorageUtils.fillOCFile(result.getData().get(0));
-                
-             // check if remote and local folder are different
-              mRemoteFolderChanged = !(remoteFolder.getEtag().equalsIgnoreCase(mLocalFolder.getEtag()));
-              
-              result = new RemoteOperationResult(ResultCode.OK);
-
-              Log_OC.i(TAG, "Checked " + mAccount.name + remotePath + " : " + (mRemoteFolderChanged ? "changed" : "not changed"));
+        remotePath = mLocalFolder.getRemotePath();
+        Log_OC.d(TAG, "Checking changes in " + mAccount.name + remotePath);
+        
+        // remote request 
+        ReadRemoteFileOperation operation = new ReadRemoteFileOperation(remotePath);
+        result = operation.execute(client);
+        if (result.isSuccess()){
+            OCFile remoteFolder = FileStorageUtils.fillOCFile((RemoteFile) result.getData().get(0));
+            
+            // check if remote and local folder are different
+            mRemoteFolderChanged = !(remoteFolder.getEtag().equalsIgnoreCase(mLocalFolder.getEtag()));
+          
+            result = new RemoteOperationResult(ResultCode.OK);
+        
+            Log_OC.i(TAG, "Checked " + mAccount.name + remotePath + " : " + (mRemoteFolderChanged ? "changed" : "not changed"));
+            
+        } else {
+            // check failed
+            if (result.getCode() == ResultCode.FILE_NOT_FOUND) {
+                removeLocalFolder();
+            }
+            if (result.isException()) {
+                Log_OC.e(TAG, "Checked " + mAccount.name + remotePath  + " : " + result.getLogMessage(), result.getException());
             } else {
-                // check failed
-                if (result.getCode() == ResultCode.FILE_NOT_FOUND) {
-                    removeLocalFolder();
-                }
-                if (result.isException()) {
-                    Log_OC.e(TAG, "Checked " + mAccount.name + remotePath  + " : " + result.getLogMessage(), result.getException());
-                } else {
-                    Log_OC.e(TAG, "Checked " + mAccount.name + remotePath + " : " + result.getLogMessage());
-                }
+                Log_OC.e(TAG, "Checked " + mAccount.name + remotePath + " : " + result.getLogMessage());
             }
-            
+        }
+        
         return result;
     }
 
 
-    private RemoteOperationResult fetchAndSyncRemoteFolder(WebdavClient client) {
+    private RemoteOperationResult fetchAndSyncRemoteFolder(OwnCloudClient client) {
         String remotePath = mLocalFolder.getRemotePath();
         ReadRemoteFolderOperation operation = new ReadRemoteFolderOperation(remotePath);
         RemoteOperationResult result = operation.execute(client);
@@ -256,12 +294,12 @@ public class SynchronizeFolderOperation extends RemoteOperation {
      *                          retrieved.  
      *  @return                 'True' when any change was made in the local data, 'false' otherwise.
      */
-    private void synchronizeData(ArrayList<RemoteFile> folderAndFiles, WebdavClient client) {
+    private void synchronizeData(ArrayList<Object> folderAndFiles, OwnCloudClient client) {
         // get 'fresh data' from the database
         mLocalFolder = mStorageManager.getFileByPath(mLocalFolder.getRemotePath());
         
         // parse data from remote folder 
-        OCFile remoteFolder = fillOCFile(folderAndFiles.get(0));
+        OCFile remoteFolder = fillOCFile((RemoteFile)folderAndFiles.get(0));
         remoteFolder.setParentId(mLocalFolder.getParentId());
         remoteFolder.setFileId(mLocalFolder.getFileId());
         
@@ -281,7 +319,7 @@ public class SynchronizeFolderOperation extends RemoteOperation {
         OCFile remoteFile = null, localFile = null;
         for (int i=1; i<folderAndFiles.size(); i++) {
             /// new OCFile instance with the data from the server
-            remoteFile = fillOCFile(folderAndFiles.get(i));
+            remoteFile = fillOCFile((RemoteFile)folderAndFiles.get(i));
             remoteFile.setParentId(mLocalFolder.getFileId());
 
             /// retrieve local data for the read file 
@@ -330,13 +368,7 @@ public class SynchronizeFolderOperation extends RemoteOperation {
         // request for the synchronization of file contents AFTER saving current remote properties
         startContentSynchronizations(filesToSyncContents, client);
 
-        // removal of obsolete files
-        //removeObsoleteFiles();
-       
-        // must be done AFTER saving all the children information, so that eTag is not updated in the database in case of unexpected exceptions
-        //mStorageManager.saveFile(remoteFolder);
         mChildren = updatedFiles;
-        
     }
 
     /**
@@ -348,7 +380,7 @@ public class SynchronizeFolderOperation extends RemoteOperation {
      * @param filesToSyncContents       Synchronization operations to execute.
      * @param client                    Interface to the remote ownCloud server.
      */
-    private void startContentSynchronizations(List<SynchronizeFileOperation> filesToSyncContents, WebdavClient client) {
+    private void startContentSynchronizations(List<SynchronizeFileOperation> filesToSyncContents, OwnCloudClient client) {
         RemoteOperationResult contentsResult = null;
         for (SynchronizeFileOperation op: filesToSyncContents) {
             contentsResult = op.execute(client);   // returns without waiting for upload or download finishes
@@ -451,6 +483,27 @@ public class SynchronizeFolderOperation extends RemoteOperation {
             }
         }
     }
+    
+    
+    private RemoteOperationResult refreshSharesForFolder(OwnCloudClient client) {
+        RemoteOperationResult result = null;
+        
+        // remote request 
+        GetRemoteSharesForFileOperation operation = new GetRemoteSharesForFileOperation(mLocalFolder.getRemotePath(), false, true);
+        result = operation.execute(client);
+        
+        if (result.isSuccess()) {
+            // update local database
+            ArrayList<OCShare> shares = new ArrayList<OCShare>();
+            for(Object obj: result.getData()) {
+                shares.add((OCShare) obj);
+            }
+            mStorageManager.saveSharesInFolder(shares, mLocalFolder);
+        }
+
+        return result;
+    }
+    
 
     /**
      * Scans the default location for saving local copies of files searching for
@@ -473,20 +526,20 @@ public class SynchronizeFolderOperation extends RemoteOperation {
     /**
      * Sends a message to any application component interested in the progress of the synchronization.
      * 
-     * @param inProgress        'True' when the synchronization progress is not finished.
+     * @param event
      * @param dirRemotePath     Remote path of a folder that was just synchronized (with or without success)
+     * @param result
      */
-    private void sendStickyBroadcast(boolean inProgress, String dirRemotePath, RemoteOperationResult result) {
-        Intent i = new Intent(FileSyncService.getSyncMessage());
-        i.putExtra(FileSyncService.IN_PROGRESS, inProgress);
-        i.putExtra(FileSyncService.ACCOUNT_NAME, mAccount.name);
+    private void sendLocalBroadcast(String event, String dirRemotePath, RemoteOperationResult result) {
+        Log_OC.d(TAG, "Send broadcast " + event);
+        Intent intent = new Intent(event);
+        intent.putExtra(FileSyncAdapter.EXTRA_ACCOUNT_NAME, mAccount.name);
         if (dirRemotePath != null) {
-            i.putExtra(FileSyncService.SYNC_FOLDER_REMOTE_PATH, dirRemotePath);
-        }
-        if (result != null) {
-            i.putExtra(FileSyncService.SYNC_RESULT, result);
+            intent.putExtra(FileSyncAdapter.EXTRA_FOLDER_PATH, dirRemotePath);
         }
-        mContext.sendStickyBroadcast(i);
+        intent.putExtra(FileSyncAdapter.EXTRA_RESULT, result);
+        mContext.sendStickyBroadcast(intent);
+        //LocalBroadcastManager.getInstance(mContext).sendBroadcast(intent);
     }
 
 
diff --git a/src/com/owncloud/android/operations/UnshareLinkOperation.java b/src/com/owncloud/android/operations/UnshareLinkOperation.java
new file mode 100644 (file)
index 0000000..77ca822
--- /dev/null
@@ -0,0 +1,96 @@
+/* ownCloud Android client application
+ *   Copyright (C) 2014 ownCloud Inc.
+ *
+ *   This program is free software: you can redistribute it and/or modify
+ *   it under the terms of the GNU General Public License version 2,
+ *   as published by the Free Software Foundation.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+package com.owncloud.android.operations;
+
+import android.content.Context;
+
+import com.owncloud.android.datamodel.OCFile;
+
+import com.owncloud.android.lib.common.OwnCloudClient;
+import com.owncloud.android.lib.common.operations.RemoteOperationResult;
+import com.owncloud.android.lib.common.operations.RemoteOperationResult.ResultCode;
+import com.owncloud.android.lib.resources.files.ExistenceCheckRemoteOperation;
+import com.owncloud.android.lib.resources.shares.OCShare;
+import com.owncloud.android.lib.resources.shares.RemoveRemoteShareOperation;
+import com.owncloud.android.lib.resources.shares.ShareType;
+
+import com.owncloud.android.operations.common.SyncOperation;
+import com.owncloud.android.utils.Log_OC;
+
+/**
+ * Unshare file/folder
+ * Save the data in Database
+ * 
+ * @author masensio
+ */
+public class UnshareLinkOperation extends SyncOperation {
+
+    private static final String TAG = UnshareLinkOperation.class.getSimpleName();
+    
+    private String mRemotePath;
+    private Context mContext;
+    
+    
+    public UnshareLinkOperation(String remotePath, Context context) {
+        mRemotePath = remotePath;
+        mContext = context;
+    }
+
+    @Override
+    protected RemoteOperationResult run(OwnCloudClient client) {
+        RemoteOperationResult result  = null;
+        
+        // Get Share for a file
+        OCShare share = getStorageManager().getFirstShareByPathAndType(mRemotePath, ShareType.PUBLIC_LINK);
+        
+        if (share != null) {
+            RemoveRemoteShareOperation operation = new RemoveRemoteShareOperation((int) share.getIdRemoteShared());
+            result = operation.execute(client);
+
+            if (result.isSuccess() || result.getCode() == ResultCode.SHARE_NOT_FOUND) {
+                Log_OC.d(TAG, "Share id = " + share.getIdRemoteShared() + " deleted");
+
+                OCFile file = getStorageManager().getFileByPath(mRemotePath);
+                file.setShareByLink(false);
+                file.setPublicLink("");
+                getStorageManager().saveFile(file);
+                getStorageManager().removeShare(share);
+                
+                if (result.getCode() == ResultCode.SHARE_NOT_FOUND) {
+                    if (existsFile(client, file.getRemotePath())) {
+                        result = new RemoteOperationResult(ResultCode.OK);
+                    } else {
+                        getStorageManager().removeFile(file, true, true);
+                    }
+                }
+            } 
+                
+        } else {
+            result = new RemoteOperationResult(ResultCode.SHARE_NOT_FOUND);
+        }
+
+        return result;
+    }
+    
+    private boolean existsFile(OwnCloudClient client, String remotePath){
+        ExistenceCheckRemoteOperation existsOperation = new ExistenceCheckRemoteOperation(remotePath, mContext, false);
+        RemoteOperationResult result = existsOperation.execute(client);
+        return result.isSuccess();
+    }
+
+}
index 7e33060..c878ede 100644 (file)
@@ -23,12 +23,12 @@ import org.json.JSONException;
 import org.json.JSONObject;
 
 import com.owncloud.android.authentication.AccountUtils;
-import com.owncloud.android.oc_framework.accounts.OwnCloudAccount;
-import com.owncloud.android.oc_framework.network.webdav.WebdavClient;
-import com.owncloud.android.oc_framework.operations.RemoteOperation;
-import com.owncloud.android.oc_framework.operations.RemoteOperationResult;
-import com.owncloud.android.oc_framework.operations.RemoteOperationResult.ResultCode;
-import com.owncloud.android.oc_framework.utils.OwnCloudVersion;
+import com.owncloud.android.lib.common.OwnCloudClient;
+import com.owncloud.android.lib.common.accounts.AccountUtils.Constants;
+import com.owncloud.android.lib.common.operations.RemoteOperation;
+import com.owncloud.android.lib.common.operations.RemoteOperationResult;
+import com.owncloud.android.lib.common.operations.RemoteOperationResult.ResultCode;
+import com.owncloud.android.lib.resources.status.OwnCloudVersion;
 import com.owncloud.android.utils.Log_OC;
 
 import android.accounts.Account;
@@ -47,18 +47,20 @@ public class UpdateOCVersionOperation extends RemoteOperation {
 
     private Account mAccount;
     private Context mContext;
+    private OwnCloudVersion mOwnCloudVersion;
     
     
     public UpdateOCVersionOperation(Account account, Context context) {
         mAccount = account;
         mContext = context;
+        mOwnCloudVersion = null;
     }
     
     
     @Override
-    protected RemoteOperationResult run(WebdavClient client) {
+    protected RemoteOperationResult run(OwnCloudClient client) {
         AccountManager accountMngr = AccountManager.get(mContext); 
-        String statUrl = accountMngr.getUserData(mAccount, OwnCloudAccount.Constants.KEY_OC_BASE_URL);
+        String statUrl = accountMngr.getUserData(mAccount, Constants.KEY_OC_BASE_URL);
         statUrl += AccountUtils.STATUS_PATH;
         RemoteOperationResult result = null;
         GetMethod get = null;
@@ -74,10 +76,15 @@ public class UpdateOCVersionOperation extends RemoteOperation {
                 if (response != null) {
                     JSONObject json = new JSONObject(response);
                     if (json != null && json.getString("version") != null) {
-                        OwnCloudVersion ocver = new OwnCloudVersion(json.getString("version"));
-                        if (ocver.isVersionValid()) {
-                            accountMngr.setUserData(mAccount, OwnCloudAccount.Constants.KEY_OC_VERSION, ocver.toString());
-                            Log_OC.d(TAG, "Got new OC version " + ocver.toString());
+
+                        String version = json.getString("version");
+                        String versionstring = json.getString("versionstring");
+                        mOwnCloudVersion = new OwnCloudVersion(version, versionstring);
+                        if (mOwnCloudVersion.isVersionValid()) {
+                            accountMngr.setUserData(mAccount, Constants.KEY_OC_VERSION, mOwnCloudVersion.getVersion());
+                            accountMngr.setUserData(mAccount, Constants.KEY_OC_VERSION_STRING, mOwnCloudVersion.getVersionString());
+                            Log_OC.d(TAG, "Got new OC version " + mOwnCloudVersion.toString());
+
                             result = new RemoteOperationResult(ResultCode.OK);
                             
                         } else {
@@ -90,15 +97,15 @@ public class UpdateOCVersionOperation extends RemoteOperation {
                     result = new RemoteOperationResult(RemoteOperationResult.ResultCode.INSTANCE_NOT_CONFIGURED);
                 }
             }
-            Log_OC.i(TAG, "Check for update of ownCloud server version at " + client.getBaseUri() + ": " + result.getLogMessage());
+            Log_OC.i(TAG, "Check for update of ownCloud server version at " + client.getWebdavUri() + ": " + result.getLogMessage());
             
         } catch (JSONException e) {
             result = new RemoteOperationResult(RemoteOperationResult.ResultCode.INSTANCE_NOT_CONFIGURED);
-            Log_OC.e(TAG, "Check for update of ownCloud server version at " + client.getBaseUri() + ": " + result.getLogMessage(), e);
+            Log_OC.e(TAG, "Check for update of ownCloud server version at " + client.getWebdavUri() + ": " + result.getLogMessage(), e);
                 
         } catch (Exception e) {
             result = new RemoteOperationResult(e);
-            Log_OC.e(TAG, "Check for update of ownCloud server version at " + client.getBaseUri() + ": " + result.getLogMessage(), e);
+            Log_OC.e(TAG, "Check for update of ownCloud server version at " + client.getWebdavUri() + ": " + result.getLogMessage(), e);
             
         } finally {
             if (get != null) 
@@ -107,4 +114,9 @@ public class UpdateOCVersionOperation extends RemoteOperation {
         return result;
     }
 
+
+    public OwnCloudVersion getOCVersion() {
+        return mOwnCloudVersion;
+    }
+
 }
index 9ceb975..85e84b7 100644 (file)
@@ -33,16 +33,16 @@ import org.apache.commons.httpclient.methods.RequestEntity;
 
 import com.owncloud.android.datamodel.OCFile;
 import com.owncloud.android.files.services.FileUploader;
-import com.owncloud.android.oc_framework.network.ProgressiveDataTransferer;
-import com.owncloud.android.oc_framework.network.webdav.OnDatatransferProgressListener;
-import com.owncloud.android.oc_framework.network.webdav.WebdavClient;
-import com.owncloud.android.oc_framework.operations.OperationCancelledException;
-import com.owncloud.android.oc_framework.operations.RemoteOperation;
-import com.owncloud.android.oc_framework.operations.RemoteOperationResult;
-import com.owncloud.android.oc_framework.operations.RemoteOperationResult.ResultCode;
-import com.owncloud.android.oc_framework.operations.remote.ChunkedUploadRemoteFileOperation;
-import com.owncloud.android.oc_framework.operations.remote.ExistenceCheckRemoteOperation;
-import com.owncloud.android.oc_framework.operations.remote.UploadRemoteFileOperation;
+import com.owncloud.android.lib.common.network.ProgressiveDataTransferer;
+import com.owncloud.android.lib.common.network.OnDatatransferProgressListener;
+import com.owncloud.android.lib.common.OwnCloudClient;
+import com.owncloud.android.lib.common.operations.OperationCancelledException;
+import com.owncloud.android.lib.common.operations.RemoteOperation;
+import com.owncloud.android.lib.common.operations.RemoteOperationResult;
+import com.owncloud.android.lib.common.operations.RemoteOperationResult.ResultCode;
+import com.owncloud.android.lib.resources.files.ChunkedUploadRemoteFileOperation;
+import com.owncloud.android.lib.resources.files.ExistenceCheckRemoteOperation;
+import com.owncloud.android.lib.resources.files.UploadRemoteFileOperation;
 import com.owncloud.android.utils.FileStorageUtils;
 import com.owncloud.android.utils.Log_OC;
 
@@ -186,7 +186,7 @@ public class UploadFileOperation extends RemoteOperation {
     }
 
     @Override
-    protected RemoteOperationResult run(WebdavClient client) {
+    protected RemoteOperationResult run(OwnCloudClient client) {
         RemoteOperationResult result = null;
         boolean localCopyPassed = false, nameCheckPassed = false;
         File temporalFile = null, originalFile = new File(mOriginalStoragePath), expectedFile = null;
@@ -376,7 +376,7 @@ public class UploadFileOperation extends RemoteOperation {
      * @param string
      * @return
      */
-    private String getAvailableRemotePath(WebdavClient wc, String remotePath) throws Exception {
+    private String getAvailableRemotePath(OwnCloudClient wc, String remotePath) throws Exception {
         boolean check = existsFile(wc, remotePath);
         if (!check) {
             return remotePath;
@@ -408,7 +408,7 @@ public class UploadFileOperation extends RemoteOperation {
         }
     }
 
-    private boolean existsFile(WebdavClient client, String remotePath){
+    private boolean existsFile(OwnCloudClient client, String remotePath){
         ExistenceCheckRemoteOperation existsOperation = new ExistenceCheckRemoteOperation(remotePath, mContext, false);
         RemoteOperationResult result = existsOperation.execute(client);
         return result.isSuccess();
diff --git a/src/com/owncloud/android/operations/common/SyncOperation.java b/src/com/owncloud/android/operations/common/SyncOperation.java
new file mode 100644 (file)
index 0000000..e16530d
--- /dev/null
@@ -0,0 +1,129 @@
+/* ownCloud Android client application
+ *   Copyright (C) 2012-2014 ownCloud Inc.
+ *
+ *   This program is free software: you can redistribute it and/or modify
+ *   it under the terms of the GNU General Public License version 2,
+ *   as published by the Free Software Foundation.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+package com.owncloud.android.operations.common;
+
+import com.owncloud.android.datamodel.FileDataStorageManager;
+import com.owncloud.android.lib.common.OwnCloudClient;
+import com.owncloud.android.lib.common.operations.OnRemoteOperationListener;
+import com.owncloud.android.lib.common.operations.RemoteOperation;
+import com.owncloud.android.lib.common.operations.RemoteOperationResult;
+
+import android.app.Activity;
+import android.content.Context;
+import android.os.Handler;
+
+
+/**
+ * Operation which execution involves both interactions with an ownCloud server and
+ * with local data in the device.
+ * 
+ * Provides methods to execute the operation both synchronously or asynchronously.
+ * 
+ * @author David A. Velasco 
+ */
+public abstract class SyncOperation extends RemoteOperation {
+       
+    //private static final String TAG = SyncOperation.class.getSimpleName();
+
+    private FileDataStorageManager mStorageManager;
+    
+    public FileDataStorageManager getStorageManager() {
+        return mStorageManager;
+    }
+       
+
+    /**
+     * Synchronously executes the operation on the received ownCloud account.
+     * 
+     * Do not call this method from the main thread.
+     * 
+     * This method should be used whenever an ownCloud account is available, instead of {@link #execute(OwnCloudClient)}. 
+     * 
+     * @param account   ownCloud account in remote ownCloud server to reach during the execution of the operation.
+     * @param context   Android context for the component calling the method.
+     * @return          Result of the operation.
+     */
+    public RemoteOperationResult execute(FileDataStorageManager storageManager, Context context) {
+        if (storageManager == null) {
+            throw new IllegalArgumentException("Trying to execute a sync operation with a NULL storage manager");
+        }
+        if (storageManager.getAccount() == null) {
+            throw new IllegalArgumentException("Trying to execute a sync operation with a storage manager for a NULL account");
+        }
+        mStorageManager = storageManager;
+        return super.execute(mStorageManager.getAccount(), context);
+    }
+    
+       
+       /**
+        * Synchronously executes the remote operation
+        * 
+     * Do not call this method from the main thread.
+     * 
+        * @param client        Client object to reach an ownCloud server during the execution of the operation.
+        * @return                      Result of the operation.
+        */
+       public RemoteOperationResult execute(OwnCloudClient client, FileDataStorageManager storageManager) {
+        if (storageManager == null)
+            throw new IllegalArgumentException("Trying to execute a sync operation with a NULL storage manager");
+        mStorageManager = storageManager;
+               return super.execute(client);
+       }
+
+       
+    /**
+     * Asynchronously executes the remote operation
+     * 
+     * This method should be used whenever an ownCloud account is available, instead of {@link #execute(OwnCloudClient)}. 
+     * 
+     * @param account           ownCloud account in remote ownCloud server to reach during the execution of the operation.
+     * @param context           Android context for the component calling the method.
+     * @param listener          Listener to be notified about the execution of the operation.
+     * @param listenerHandler   Handler associated to the thread where the methods of the listener objects must be called.
+     * @return                  Thread were the remote operation is executed.
+     */
+    public Thread execute(FileDataStorageManager storageManager, Context context, OnRemoteOperationListener listener, Handler listenerHandler, Activity callerActivity) {
+        if (storageManager == null) {
+            throw new IllegalArgumentException("Trying to execute a sync operation with a NULL storage manager");
+        }
+        if (storageManager.getAccount() == null) {
+            throw new IllegalArgumentException("Trying to execute a sync operation with a storage manager for a NULL account");
+        }
+        mStorageManager = storageManager;
+        return super.execute(storageManager.getAccount(), context, listener, listenerHandler, callerActivity);
+    }
+
+    
+       /**
+        * Asynchronously executes the remote operation
+        * 
+        * @param client                        Client object to reach an ownCloud server during the execution of the operation.
+        * @param listener                      Listener to be notified about the execution of the operation.
+        * @param listenerHandler       Handler associated to the thread where the methods of the listener objects must be called.
+        * @return                                      Thread were the remote operation is executed.
+        */
+       public Thread execute(OwnCloudClient client, FileDataStorageManager storageManager, OnRemoteOperationListener listener, Handler listenerHandler) {
+        if (storageManager == null) {
+            throw new IllegalArgumentException("Trying to execute a sync operation with a NULL storage manager");
+        }
+        mStorageManager = storageManager;
+        return super.execute(client, listener, listenerHandler);
+       }
+
+       
+}
index 9e7cd3f..54e67a2 100644 (file)
@@ -22,9 +22,9 @@ import java.util.ArrayList;
 import java.util.HashMap;
 
 import com.owncloud.android.R;
-import com.owncloud.android.datamodel.FileDataStorageManager;
 import com.owncloud.android.db.ProviderMeta;
 import com.owncloud.android.db.ProviderMeta.ProviderTableMeta;
+import com.owncloud.android.lib.resources.shares.ShareType;
 import com.owncloud.android.utils.Log_OC;
 
 
@@ -56,44 +56,85 @@ public class FileContentProvider extends ContentProvider {
 
     private DataBaseHelper mDbHelper;
 
-    private static HashMap<String, String> mProjectionMap;
+    // Projection for filelist table
+    private static HashMap<String, String> mFileProjectionMap;
     static {
-        mProjectionMap = new HashMap<String, String>();
-        mProjectionMap.put(ProviderTableMeta._ID, ProviderTableMeta._ID);
-        mProjectionMap.put(ProviderTableMeta.FILE_PARENT,
+        mFileProjectionMap = new HashMap<String, String>();
+        mFileProjectionMap.put(ProviderTableMeta._ID, ProviderTableMeta._ID);
+        mFileProjectionMap.put(ProviderTableMeta.FILE_PARENT,
                 ProviderTableMeta.FILE_PARENT);
-        mProjectionMap.put(ProviderTableMeta.FILE_PATH,
+        mFileProjectionMap.put(ProviderTableMeta.FILE_PATH,
                 ProviderTableMeta.FILE_PATH);
-        mProjectionMap.put(ProviderTableMeta.FILE_NAME,
+        mFileProjectionMap.put(ProviderTableMeta.FILE_NAME,
                 ProviderTableMeta.FILE_NAME);
-        mProjectionMap.put(ProviderTableMeta.FILE_CREATION,
+        mFileProjectionMap.put(ProviderTableMeta.FILE_CREATION,
                 ProviderTableMeta.FILE_CREATION);
-        mProjectionMap.put(ProviderTableMeta.FILE_MODIFIED,
+        mFileProjectionMap.put(ProviderTableMeta.FILE_MODIFIED,
                 ProviderTableMeta.FILE_MODIFIED);
-        mProjectionMap.put(ProviderTableMeta.FILE_MODIFIED_AT_LAST_SYNC_FOR_DATA,
+        mFileProjectionMap.put(ProviderTableMeta.FILE_MODIFIED_AT_LAST_SYNC_FOR_DATA,
                 ProviderTableMeta.FILE_MODIFIED_AT_LAST_SYNC_FOR_DATA);
-        mProjectionMap.put(ProviderTableMeta.FILE_CONTENT_LENGTH,
+        mFileProjectionMap.put(ProviderTableMeta.FILE_CONTENT_LENGTH,
                 ProviderTableMeta.FILE_CONTENT_LENGTH);
-        mProjectionMap.put(ProviderTableMeta.FILE_CONTENT_TYPE,
+        mFileProjectionMap.put(ProviderTableMeta.FILE_CONTENT_TYPE,
                 ProviderTableMeta.FILE_CONTENT_TYPE);
-        mProjectionMap.put(ProviderTableMeta.FILE_STORAGE_PATH,
+        mFileProjectionMap.put(ProviderTableMeta.FILE_STORAGE_PATH,
                 ProviderTableMeta.FILE_STORAGE_PATH);
-        mProjectionMap.put(ProviderTableMeta.FILE_LAST_SYNC_DATE,
+        mFileProjectionMap.put(ProviderTableMeta.FILE_LAST_SYNC_DATE,
                 ProviderTableMeta.FILE_LAST_SYNC_DATE);
-        mProjectionMap.put(ProviderTableMeta.FILE_LAST_SYNC_DATE_FOR_DATA,
+        mFileProjectionMap.put(ProviderTableMeta.FILE_LAST_SYNC_DATE_FOR_DATA,
                 ProviderTableMeta.FILE_LAST_SYNC_DATE_FOR_DATA);
-        mProjectionMap.put(ProviderTableMeta.FILE_KEEP_IN_SYNC,
+        mFileProjectionMap.put(ProviderTableMeta.FILE_KEEP_IN_SYNC,
                 ProviderTableMeta.FILE_KEEP_IN_SYNC);
-        mProjectionMap.put(ProviderTableMeta.FILE_ACCOUNT_OWNER,
+        mFileProjectionMap.put(ProviderTableMeta.FILE_ACCOUNT_OWNER,
                 ProviderTableMeta.FILE_ACCOUNT_OWNER);
-        mProjectionMap.put(ProviderTableMeta.FILE_ETAG, 
+        mFileProjectionMap.put(ProviderTableMeta.FILE_ETAG, 
                 ProviderTableMeta.FILE_ETAG);
+        mFileProjectionMap.put(ProviderTableMeta.FILE_SHARE_BY_LINK,
+                ProviderTableMeta.FILE_SHARE_BY_LINK);
+        mFileProjectionMap.put(ProviderTableMeta.FILE_PUBLIC_LINK,
+                ProviderTableMeta.FILE_PUBLIC_LINK);
     }
 
     private static final int SINGLE_FILE = 1;
     private static final int DIRECTORY = 2;
     private static final int ROOT_DIRECTORY = 3;
-
+    private static final int SHARES = 4;
+    
+    // Projection for ocshares table
+    private static HashMap<String, String> mOCSharesProjectionMap;
+    static {
+        mOCSharesProjectionMap = new HashMap<String, String>();
+        mOCSharesProjectionMap.put(ProviderTableMeta._ID, ProviderTableMeta._ID);
+        mOCSharesProjectionMap.put(ProviderTableMeta.OCSHARES_FILE_SOURCE,
+                ProviderTableMeta.OCSHARES_FILE_SOURCE);
+        mOCSharesProjectionMap.put(ProviderTableMeta.OCSHARES_ITEM_SOURCE,
+                ProviderTableMeta.OCSHARES_ITEM_SOURCE);
+        mOCSharesProjectionMap.put(ProviderTableMeta.OCSHARES_SHARE_TYPE,
+                ProviderTableMeta.OCSHARES_SHARE_TYPE);
+        mOCSharesProjectionMap.put(ProviderTableMeta.OCSHARES_SHARE_WITH,
+                ProviderTableMeta.OCSHARES_SHARE_WITH);
+        mOCSharesProjectionMap.put(ProviderTableMeta.OCSHARES_PATH,
+                ProviderTableMeta.OCSHARES_PATH);
+        mOCSharesProjectionMap.put(ProviderTableMeta.OCSHARES_PERMISSIONS,
+                ProviderTableMeta.OCSHARES_PERMISSIONS);
+        mOCSharesProjectionMap.put(ProviderTableMeta.OCSHARES_SHARED_DATE,
+                ProviderTableMeta.OCSHARES_SHARED_DATE);
+        mOCSharesProjectionMap.put(ProviderTableMeta.OCSHARES_EXPIRATION_DATE,
+                ProviderTableMeta.OCSHARES_EXPIRATION_DATE);
+        mOCSharesProjectionMap.put(ProviderTableMeta.OCSHARES_TOKEN,
+                ProviderTableMeta.OCSHARES_TOKEN);
+        mOCSharesProjectionMap.put(ProviderTableMeta.OCSHARES_SHARE_WITH_DISPLAY_NAME,
+                ProviderTableMeta.OCSHARES_SHARE_WITH_DISPLAY_NAME);
+        mOCSharesProjectionMap.put(ProviderTableMeta.OCSHARES_IS_DIRECTORY,
+                ProviderTableMeta.OCSHARES_IS_DIRECTORY);
+        mOCSharesProjectionMap.put(ProviderTableMeta.OCSHARES_USER_ID,
+                ProviderTableMeta.OCSHARES_USER_ID);
+        mOCSharesProjectionMap.put(ProviderTableMeta.OCSHARES_ID_REMOTE_SHARED,
+                ProviderTableMeta.OCSHARES_ID_REMOTE_SHARED);
+        mOCSharesProjectionMap.put(ProviderTableMeta.OCSHARES_ACCOUNT_OWNER,
+                ProviderTableMeta.OCSHARES_ACCOUNT_OWNER);
+    }
+    
     private UriMatcher mUriMatcher;
     
     @Override
@@ -112,7 +153,6 @@ public class FileContentProvider extends ContentProvider {
         return count;
     }
     
-    
     private int delete(SQLiteDatabase db, Uri uri, String where, String[] whereArgs) {
         int count = 0;
         switch (mUriMatcher.match(uri)) {
@@ -124,7 +164,7 @@ public class FileContentProvider extends ContentProvider {
             }
             Log_OC.d(TAG, "Removing FILE " + remotePath);
             */
-            count = db.delete(ProviderTableMeta.DB_NAME,
+            count = db.delete(ProviderTableMeta.FILE_TABLE_NAME,
                     ProviderTableMeta._ID
                             + "="
                             + uri.getPathSegments().get(1)
@@ -168,7 +208,7 @@ public class FileContentProvider extends ContentProvider {
             }
             Log_OC.d(TAG, "Removing DIRECTORY " + folderName + " (or maybe not) ");
             */
-            count += db.delete(ProviderTableMeta.DB_NAME,
+            count += db.delete(ProviderTableMeta.FILE_TABLE_NAME,
                     ProviderTableMeta._ID
                     + "="
                     + uri.getPathSegments().get(1)
@@ -181,7 +221,10 @@ public class FileContentProvider extends ContentProvider {
             break;
         case ROOT_DIRECTORY:
             //Log_OC.d(TAG, "Removing ROOT!");
-            count = db.delete(ProviderTableMeta.DB_NAME, where, whereArgs);
+            count = db.delete(ProviderTableMeta.FILE_TABLE_NAME, where, whereArgs);
+            break;
+        case SHARES:
+            count = db.delete(ProviderTableMeta.OCSHARES_TABLE_NAME, where, whereArgs);
             break;
         default:
             //Log_OC.e(TAG, "Unknown uri " + uri);
@@ -221,37 +264,77 @@ public class FileContentProvider extends ContentProvider {
     }
     
     private Uri insert(SQLiteDatabase db, Uri uri, ContentValues values) {
-        if (mUriMatcher.match(uri) != SINGLE_FILE &&
-                mUriMatcher.match(uri) != ROOT_DIRECTORY) {
-            //Log_OC.e(TAG, "Inserting invalid URI: " + uri);
-            throw new IllegalArgumentException("Unknown uri id: " + uri);
-        }
+        switch (mUriMatcher.match(uri)){
+        case ROOT_DIRECTORY:
+        case SINGLE_FILE:
+            String remotePath = values.getAsString(ProviderTableMeta.FILE_PATH);
+            String accountName = values.getAsString(ProviderTableMeta.FILE_ACCOUNT_OWNER);
+            String[] projection = new String[] {ProviderTableMeta._ID, ProviderTableMeta.FILE_PATH, ProviderTableMeta.FILE_ACCOUNT_OWNER };
+            String where = ProviderTableMeta.FILE_PATH + "=? AND " + ProviderTableMeta.FILE_ACCOUNT_OWNER + "=?";
+            String[] whereArgs = new String[] {remotePath, accountName};
+            Cursor doubleCheck = query(db, uri, projection, where, whereArgs, null);
+            if (doubleCheck == null || !doubleCheck.moveToFirst()) {    // ugly patch; serious refactorization is needed to reduce work in FileDataStorageManager and bring it to FileContentProvider 
+                long rowId = db.insert(ProviderTableMeta.FILE_TABLE_NAME, null, values);
+                if (rowId > 0) {
+                    Uri insertedFileUri = ContentUris.withAppendedId(ProviderTableMeta.CONTENT_URI_FILE, rowId);
+                    //Log_OC.d(TAG, "Inserted " + values.getAsString(ProviderTableMeta.FILE_PATH) + " at provider " + this);
+                    return insertedFileUri;
+                } else {
+                    //Log_OC.d(TAG, "Error while inserting " + values.getAsString(ProviderTableMeta.FILE_PATH)  + " at provider " + this);
+                    throw new SQLException("ERROR " + uri);
+                }
+            } else {
+                // file is already inserted; race condition, let's avoid a duplicated entry
+                Uri insertedFileUri = ContentUris.withAppendedId(ProviderTableMeta.CONTENT_URI_FILE, doubleCheck.getLong(doubleCheck.getColumnIndex(ProviderTableMeta._ID)));
+                doubleCheck.close();
 
-        String remotePath = values.getAsString(ProviderTableMeta.FILE_PATH);
-        String accountName = values.getAsString(ProviderTableMeta.FILE_ACCOUNT_OWNER);
-        String[] projection = new String[] {ProviderTableMeta._ID, ProviderTableMeta.FILE_PATH, ProviderTableMeta.FILE_ACCOUNT_OWNER };
-        String where = ProviderTableMeta.FILE_PATH + "=? AND " + ProviderTableMeta.FILE_ACCOUNT_OWNER + "=?";
-        String[] whereArgs = new String[] {remotePath, accountName};
-        Cursor doubleCheck = query(db, uri, projection, where, whereArgs, null);
-        if (doubleCheck == null || !doubleCheck.moveToFirst()) {    // ugly patch; serious refactorization is needed to reduce work in FileDataStorageManager and bring it to FileContentProvider 
-            long rowId = db.insert(ProviderTableMeta.DB_NAME, null, values);
-            if (rowId > 0) {
-                Uri insertedFileUri = ContentUris.withAppendedId(ProviderTableMeta.CONTENT_URI_FILE, rowId);
-                //Log_OC.d(TAG, "Inserted " + values.getAsString(ProviderTableMeta.FILE_PATH) + " at provider " + this);
                 return insertedFileUri;
+            }
+            
+        case SHARES:
+            String path = values.getAsString(ProviderTableMeta.OCSHARES_PATH);
+            String accountNameShare= values.getAsString(ProviderTableMeta.OCSHARES_ACCOUNT_OWNER);
+            String[] projectionShare = new String[] {ProviderTableMeta._ID, ProviderTableMeta.OCSHARES_PATH, ProviderTableMeta.OCSHARES_ACCOUNT_OWNER };
+            String whereShare = ProviderTableMeta.OCSHARES_PATH + "=? AND " + ProviderTableMeta.OCSHARES_ACCOUNT_OWNER + "=?";
+            String[] whereArgsShare = new String[] {path, accountNameShare};
+            Uri insertedShareUri = null;
+            Cursor doubleCheckShare = query(db, uri, projectionShare, whereShare, whereArgsShare, null);
+            if (doubleCheckShare == null || !doubleCheckShare.moveToFirst()) {    // ugly patch; serious refactorization is needed to reduce work in FileDataStorageManager and bring it to FileContentProvider 
+                long rowId = db.insert(ProviderTableMeta.OCSHARES_TABLE_NAME, null, values);
+                if (rowId >0) {
+                    insertedShareUri = ContentUris.withAppendedId(ProviderTableMeta.CONTENT_URI_SHARE, rowId);
+                } else {
+                    throw new SQLException("ERROR " + uri);
+
+                }
             } else {
-                //Log_OC.d(TAG, "Error while inserting " + values.getAsString(ProviderTableMeta.FILE_PATH)  + " at provider " + this);
-                throw new SQLException("ERROR " + uri);
+                // file is already inserted; race condition, let's avoid a duplicated entry
+                insertedShareUri = ContentUris.withAppendedId(ProviderTableMeta.CONTENT_URI_SHARE, doubleCheckShare.getLong(doubleCheckShare.getColumnIndex(ProviderTableMeta._ID)));
+                doubleCheckShare.close();
             }
-        } else {
-            // file is already inserted; race condition, let's avoid a duplicated entry
-            Uri insertedFileUri = ContentUris.withAppendedId(ProviderTableMeta.CONTENT_URI_FILE, doubleCheck.getLong(doubleCheck.getColumnIndex(ProviderTableMeta._ID)));
-            doubleCheck.close();
-            return insertedFileUri;
+            updateFilesTableAccordingToShareInsertion(db, uri, values);
+            return insertedShareUri;
+            
+
+        default:
+            throw new IllegalArgumentException("Unknown uri id: " + uri);
         }
+        
     }
-
     
+    private void updateFilesTableAccordingToShareInsertion(SQLiteDatabase db, Uri uri, ContentValues shareValues) {
+        ContentValues fileValues = new ContentValues();
+        fileValues.put(ProviderTableMeta.FILE_SHARE_BY_LINK, 
+                            ShareType.PUBLIC_LINK.getValue() == shareValues.getAsInteger(ProviderTableMeta.OCSHARES_SHARE_TYPE)? 1 : 0);
+        String whereShare = ProviderTableMeta.FILE_PATH + "=? AND " + ProviderTableMeta.FILE_ACCOUNT_OWNER + "=?";
+        String[] whereArgsShare = new String[] {
+                shareValues.getAsString(ProviderTableMeta.OCSHARES_PATH), 
+                shareValues.getAsString(ProviderTableMeta.OCSHARES_ACCOUNT_OWNER)
+        };
+        db.update(ProviderTableMeta.FILE_TABLE_NAME, fileValues, whereShare, whereArgsShare);
+    }
+    
+
     @Override
     public boolean onCreate() {
         mDbHelper = new DataBaseHelper(getContext());
@@ -263,6 +346,8 @@ public class FileContentProvider extends ContentProvider {
         mUriMatcher.addURI(authority, "file/#", SINGLE_FILE);
         mUriMatcher.addURI(authority, "dir/", DIRECTORY);
         mUriMatcher.addURI(authority, "dir/#", DIRECTORY);
+        mUriMatcher.addURI(authority, "shares/", SHARES);
+        mUriMatcher.addURI(authority, "shares/#", SHARES);
         
         return true;
     }
@@ -285,8 +370,8 @@ public class FileContentProvider extends ContentProvider {
     private Cursor query(SQLiteDatabase db, Uri uri, String[] projection, String selection, String[] selectionArgs, String sortOrder) {
         SQLiteQueryBuilder sqlQuery = new SQLiteQueryBuilder();
 
-        sqlQuery.setTables(ProviderTableMeta.DB_NAME);
-        sqlQuery.setProjectionMap(mProjectionMap);
+        sqlQuery.setTables(ProviderTableMeta.FILE_TABLE_NAME);
+        sqlQuery.setProjectionMap(mFileProjectionMap);
 
         switch (mUriMatcher.match(uri)) {
         case ROOT_DIRECTORY:
@@ -302,13 +387,26 @@ public class FileContentProvider extends ContentProvider {
                         + uri.getPathSegments().get(1));
             }
             break;
+        case SHARES: 
+            sqlQuery.setTables(ProviderTableMeta.OCSHARES_TABLE_NAME);
+            sqlQuery.setProjectionMap(mOCSharesProjectionMap);
+            if (uri.getPathSegments().size() > 1) {
+                sqlQuery.appendWhere(ProviderTableMeta._ID + "="
+                        + uri.getPathSegments().get(1));
+            }
+            break;
         default:
             throw new IllegalArgumentException("Unknown uri id: " + uri);
         }
 
         String order;
         if (TextUtils.isEmpty(sortOrder)) {
-            order = ProviderTableMeta.DEFAULT_SORT_ORDER;
+            if (mUriMatcher.match(uri) == SHARES) {
+                order = ProviderTableMeta.OCSHARES_DEFAULT_SORT_ORDER;
+            } else {
+
+                order = ProviderTableMeta.FILE_DEFAULT_SORT_ORDER;
+            }
         } else {
             order = sortOrder;
         }
@@ -338,16 +436,19 @@ public class FileContentProvider extends ContentProvider {
     }
     
     
+
     private int update(SQLiteDatabase db, Uri uri, ContentValues values, String selection, String[] selectionArgs) {
         switch (mUriMatcher.match(uri)) {
             case DIRECTORY:
-                return updateFolderSize(db, selectionArgs[0]);
+                return  0; //updateFolderSize(db, selectionArgs[0]);
+            case SHARES:
+                return db.update(ProviderTableMeta.OCSHARES_TABLE_NAME, values, selection, selectionArgs);
             default:
-                return db.update(ProviderTableMeta.DB_NAME, values, selection, selectionArgs);
+                return db.update(ProviderTableMeta.FILE_TABLE_NAME, values, selection, selectionArgs);
         }
     }    
 
-    
+ /*   
     private int updateFolderSize(SQLiteDatabase db, String folderId) {
         int count = 0;
         String [] whereArgs = new String[] { folderId };
@@ -384,7 +485,7 @@ public class FileContentProvider extends ContentProvider {
             Log_OC.d("FileContentProvider", "Updating " + folderSize + " to " + childrenSize);
             ContentValues cv = new ContentValues();
             cv.put(ProviderTableMeta.FILE_CONTENT_LENGTH, childrenSize);
-            count = db.update(ProviderTableMeta.DB_NAME, cv, folderWhere, whereArgs);
+            count = db.update(ProviderTableMeta.FILE_TABLE_NAME, cv, folderWhere, whereArgs);
             
             // propagate update until root
             if (folderParentId > FileDataStorageManager.ROOT_PARENT_ID) {
@@ -398,7 +499,7 @@ public class FileContentProvider extends ContentProvider {
         }
         return count;
     }
-
+*/
     
     @Override
     public ContentProviderResult[] applyBatch (ArrayList<ContentProviderOperation> operations) throws OperationApplicationException {
@@ -433,7 +534,7 @@ public class FileContentProvider extends ContentProvider {
         public void onCreate(SQLiteDatabase db) {
             // files table
             Log_OC.i("SQL", "Entering in onCreate");
-            db.execSQL("CREATE TABLE " + ProviderTableMeta.DB_NAME + "("
+            db.execSQL("CREATE TABLE " + ProviderTableMeta.FILE_TABLE_NAME + "("
                     + ProviderTableMeta._ID + " INTEGER PRIMARY KEY, "
                     + ProviderTableMeta.FILE_NAME + " TEXT, "
                     + ProviderTableMeta.FILE_PATH + " TEXT, "
@@ -448,8 +549,28 @@ public class FileContentProvider extends ContentProvider {
                     + ProviderTableMeta.FILE_KEEP_IN_SYNC + " INTEGER, "
                     + ProviderTableMeta.FILE_LAST_SYNC_DATE_FOR_DATA + " INTEGER, "
                     + ProviderTableMeta.FILE_MODIFIED_AT_LAST_SYNC_FOR_DATA + " INTEGER, "
-                    + ProviderTableMeta.FILE_ETAG + " TEXT );"
+                    + ProviderTableMeta.FILE_ETAG + " TEXT, " 
+                    + ProviderTableMeta.FILE_SHARE_BY_LINK + " INTEGER, "
+                    + ProviderTableMeta.FILE_PUBLIC_LINK  + " TEXT );"
                     );
+            
+            // Create table ocshares
+            db.execSQL("CREATE TABLE " + ProviderTableMeta.OCSHARES_TABLE_NAME + "("
+                    + ProviderTableMeta._ID + " INTEGER PRIMARY KEY, "
+                    + ProviderTableMeta.OCSHARES_FILE_SOURCE + " INTEGER, "
+                    + ProviderTableMeta.OCSHARES_ITEM_SOURCE + " INTEGER, "
+                    + ProviderTableMeta.OCSHARES_SHARE_TYPE + " INTEGER, "
+                    + ProviderTableMeta.OCSHARES_SHARE_WITH + " TEXT, "
+                    + ProviderTableMeta.OCSHARES_PATH + " TEXT, "
+                    + ProviderTableMeta.OCSHARES_PERMISSIONS+ " INTEGER, "
+                    + ProviderTableMeta.OCSHARES_SHARED_DATE + " INTEGER, "
+                    + ProviderTableMeta.OCSHARES_EXPIRATION_DATE + " INTEGER, "
+                    + ProviderTableMeta.OCSHARES_TOKEN + " TEXT, "
+                    + ProviderTableMeta.OCSHARES_SHARE_WITH_DISPLAY_NAME + " TEXT, "
+                    + ProviderTableMeta.OCSHARES_IS_DIRECTORY + " INTEGER, "  // boolean
+                    + ProviderTableMeta.OCSHARES_USER_ID + " INTEGER, "
+                    + ProviderTableMeta.OCSHARES_ID_REMOTE_SHARED + " INTEGER," 
+                    + ProviderTableMeta.OCSHARES_ACCOUNT_OWNER + " TEXT );" );
         }
 
         @Override
@@ -458,7 +579,7 @@ public class FileContentProvider extends ContentProvider {
             boolean upgraded = false; 
             if (oldVersion == 1 && newVersion >= 2) {
                 Log_OC.i("SQL", "Entering in the #1 ADD in onUpgrade");
-                db.execSQL("ALTER TABLE " + ProviderTableMeta.DB_NAME +
+                db.execSQL("ALTER TABLE " + ProviderTableMeta.FILE_TABLE_NAME +
                            " ADD COLUMN " + ProviderTableMeta.FILE_KEEP_IN_SYNC  + " INTEGER " +
                            " DEFAULT 0");
                 upgraded = true;
@@ -467,12 +588,12 @@ public class FileContentProvider extends ContentProvider {
                 Log_OC.i("SQL", "Entering in the #2 ADD in onUpgrade");
                 db.beginTransaction();
                 try {
-                    db.execSQL("ALTER TABLE " + ProviderTableMeta.DB_NAME +
+                    db.execSQL("ALTER TABLE " + ProviderTableMeta.FILE_TABLE_NAME +
                                " ADD COLUMN " + ProviderTableMeta.FILE_LAST_SYNC_DATE_FOR_DATA  + " INTEGER " +
                                " DEFAULT 0");
                     
                     // assume there are not local changes pending to upload
-                    db.execSQL("UPDATE " + ProviderTableMeta.DB_NAME + 
+                    db.execSQL("UPDATE " + ProviderTableMeta.FILE_TABLE_NAME + 
                             " SET " + ProviderTableMeta.FILE_LAST_SYNC_DATE_FOR_DATA + " = " + System.currentTimeMillis() + 
                             " WHERE " + ProviderTableMeta.FILE_STORAGE_PATH + " IS NOT NULL");
                  
@@ -486,11 +607,11 @@ public class FileContentProvider extends ContentProvider {
                 Log_OC.i("SQL", "Entering in the #3 ADD in onUpgrade");
                 db.beginTransaction();
                 try {
-                    db .execSQL("ALTER TABLE " + ProviderTableMeta.DB_NAME +
+                    db .execSQL("ALTER TABLE " + ProviderTableMeta.FILE_TABLE_NAME +
                            " ADD COLUMN " + ProviderTableMeta.FILE_MODIFIED_AT_LAST_SYNC_FOR_DATA  + " INTEGER " +
                            " DEFAULT 0");
                 
-                    db.execSQL("UPDATE " + ProviderTableMeta.DB_NAME + 
+                    db.execSQL("UPDATE " + ProviderTableMeta.FILE_TABLE_NAME + 
                            " SET " + ProviderTableMeta.FILE_MODIFIED_AT_LAST_SYNC_FOR_DATA + " = " + ProviderTableMeta.FILE_MODIFIED + 
                            " WHERE " + ProviderTableMeta.FILE_STORAGE_PATH + " IS NOT NULL");
                 
@@ -507,7 +628,7 @@ public class FileContentProvider extends ContentProvider {
                 Log_OC.i("SQL", "Entering in the #4 ADD in onUpgrade");
                 db.beginTransaction();
                 try {
-                    db .execSQL("ALTER TABLE " + ProviderTableMeta.DB_NAME +
+                    db .execSQL("ALTER TABLE " + ProviderTableMeta.FILE_TABLE_NAME +
                             " ADD COLUMN " + ProviderTableMeta.FILE_ETAG + " TEXT " +
                             " DEFAULT NULL");
                     
@@ -519,6 +640,45 @@ public class FileContentProvider extends ContentProvider {
             }
             if (!upgraded)
                 Log_OC.i("SQL", "OUT of the ADD in onUpgrade; oldVersion == " + oldVersion + ", newVersion == " + newVersion);
+            
+            if (oldVersion < 6 && newVersion >= 6) {
+                Log_OC.i("SQL", "Entering in the #5 ADD in onUpgrade");
+                db.beginTransaction();
+                try {
+                    db .execSQL("ALTER TABLE " + ProviderTableMeta.FILE_TABLE_NAME +
+                            " ADD COLUMN " + ProviderTableMeta.FILE_SHARE_BY_LINK + " INTEGER " +
+                            " DEFAULT 0");
+                    
+                    db .execSQL("ALTER TABLE " + ProviderTableMeta.FILE_TABLE_NAME +
+                            " ADD COLUMN " + ProviderTableMeta.FILE_PUBLIC_LINK + " TEXT " +
+                            " DEFAULT NULL");
+                    
+                    // Create table ocshares
+                    db.execSQL("CREATE TABLE " + ProviderTableMeta.OCSHARES_TABLE_NAME + "("
+                            + ProviderTableMeta._ID + " INTEGER PRIMARY KEY, "
+                            + ProviderTableMeta.OCSHARES_FILE_SOURCE + " INTEGER, "
+                            + ProviderTableMeta.OCSHARES_ITEM_SOURCE + " INTEGER, "
+                            + ProviderTableMeta.OCSHARES_SHARE_TYPE + " INTEGER, "
+                            + ProviderTableMeta.OCSHARES_SHARE_WITH + " TEXT, "
+                            + ProviderTableMeta.OCSHARES_PATH + " TEXT, "
+                            + ProviderTableMeta.OCSHARES_PERMISSIONS+ " INTEGER, "
+                            + ProviderTableMeta.OCSHARES_SHARED_DATE + " INTEGER, "
+                            + ProviderTableMeta.OCSHARES_EXPIRATION_DATE + " INTEGER, "
+                            + ProviderTableMeta.OCSHARES_TOKEN + " TEXT, "
+                            + ProviderTableMeta.OCSHARES_SHARE_WITH_DISPLAY_NAME + " TEXT, "
+                            + ProviderTableMeta.OCSHARES_IS_DIRECTORY + " INTEGER, "  // boolean
+                            + ProviderTableMeta.OCSHARES_USER_ID + " INTEGER, "
+                            + ProviderTableMeta.OCSHARES_ID_REMOTE_SHARED + " INTEGER," 
+                            + ProviderTableMeta.OCSHARES_ACCOUNT_OWNER + " TEXT );" );
+                    
+                    upgraded = true;
+                    db.setTransactionSuccessful();
+                } finally {
+                    db.endTransaction();
+                }
+            }
+            if (!upgraded)
+                Log_OC.i("SQL", "OUT of the ADD in onUpgrade; oldVersion == " + oldVersion + ", newVersion == " + newVersion);
         }
     }
 
diff --git a/src/com/owncloud/android/services/OperationsService.java b/src/com/owncloud/android/services/OperationsService.java
new file mode 100644 (file)
index 0000000..80caea7
--- /dev/null
@@ -0,0 +1,403 @@
+/* ownCloud Android client application
+ *   Copyright (C) 2012-2013 ownCloud Inc.
+ *
+ *   This program is free software: you can redistribute it and/or modify
+ *   it under the terms of the GNU General Public License version 2,
+ *   as published by the Free Software Foundation.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+package com.owncloud.android.services;
+
+import java.io.IOException;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.Map;
+import java.util.concurrent.ConcurrentLinkedQueue;
+
+import com.owncloud.android.datamodel.FileDataStorageManager;
+import com.owncloud.android.lib.common.OwnCloudClientFactory;
+import com.owncloud.android.lib.common.OwnCloudClient;
+import com.owncloud.android.lib.common.operations.OnRemoteOperationListener;
+import com.owncloud.android.lib.common.operations.RemoteOperation;
+import com.owncloud.android.lib.common.operations.RemoteOperationResult;
+import com.owncloud.android.lib.resources.shares.ShareType;
+import com.owncloud.android.operations.common.SyncOperation;
+import com.owncloud.android.operations.CreateShareOperation;
+import com.owncloud.android.operations.UnshareLinkOperation;
+import com.owncloud.android.utils.Log_OC;
+
+import android.accounts.Account;
+import android.accounts.AccountsException;
+import android.app.Service;
+import android.content.Intent;
+import android.net.Uri;
+import android.os.Binder;
+import android.os.Handler;
+import android.os.HandlerThread;
+import android.os.IBinder;
+import android.os.Looper;
+import android.os.Message;
+import android.os.Process;
+//import android.support.v4.content.LocalBroadcastManager;
+import android.util.Pair;
+
+public class OperationsService extends Service {
+    
+    private static final String TAG = OperationsService.class.getSimpleName();
+    
+    public static final String EXTRA_ACCOUNT = "ACCOUNT";
+    public static final String EXTRA_SERVER_URL = "SERVER_URL";
+    public static final String EXTRA_REMOTE_PATH = "REMOTE_PATH";
+    public static final String EXTRA_SEND_INTENT = "SEND_INTENT";
+    public static final String EXTRA_RESULT = "RESULT";
+    
+    public static final String ACTION_CREATE_SHARE = "CREATE_SHARE";
+    public static final String ACTION_UNSHARE = "UNSHARE";
+    
+    public static final String ACTION_OPERATION_ADDED = OperationsService.class.getName() + ".OPERATION_ADDED";
+    public static final String ACTION_OPERATION_FINISHED = OperationsService.class.getName() + ".OPERATION_FINISHED";
+
+    private ConcurrentLinkedQueue<Pair<Target, RemoteOperation>> mPendingOperations = new ConcurrentLinkedQueue<Pair<Target, RemoteOperation>>();
+    
+    private static class Target {
+        public Uri mServerUrl = null;
+        public Account mAccount = null;
+        public Target(Account account, Uri serverUrl) {
+            mAccount = account;
+            mServerUrl = serverUrl;
+        }
+    }
+
+    private Looper mServiceLooper;
+    private ServiceHandler mServiceHandler;
+    private OperationsServiceBinder mBinder;
+    private OwnCloudClient mOwnCloudClient = null;
+    private Target mLastTarget = null;
+    private FileDataStorageManager mStorageManager;
+    private RemoteOperation mCurrentOperation = null;
+    
+    
+    /**
+     * Service initialization
+     */
+    @Override
+    public void onCreate() {
+        super.onCreate();
+        HandlerThread thread = new HandlerThread("Operations service thread", Process.THREAD_PRIORITY_BACKGROUND);
+        thread.start();
+        mServiceLooper = thread.getLooper();
+        mServiceHandler = new ServiceHandler(mServiceLooper, this);
+        mBinder = new OperationsServiceBinder();
+    }
+
+    /**
+     * Entry point to add a new operation to the queue of operations.
+     * 
+     * New operations are added calling to startService(), resulting in a call to this method. 
+     * This ensures the service will keep on working although the caller activity goes away.
+     * 
+     * IMPORTANT: the only operations performed here right now is {@link GetSharedFilesOperation}. The class
+     * is taking advantage of it due to time constraints.
+     */
+    @Override
+    public int onStartCommand(Intent intent, int flags, int startId) {
+        if (!intent.hasExtra(EXTRA_ACCOUNT) && !intent.hasExtra(EXTRA_SERVER_URL)) {
+            Log_OC.e(TAG, "Not enough information provided in intent");
+            return START_NOT_STICKY;
+        }
+        try {
+            Account account = intent.getParcelableExtra(EXTRA_ACCOUNT);
+            String serverUrl = intent.getStringExtra(EXTRA_SERVER_URL);
+            
+            Target target = new Target(account, (serverUrl == null) ? null : Uri.parse(serverUrl));
+            RemoteOperation operation = null;
+            
+            String action = intent.getAction();
+            if (action.equals(ACTION_CREATE_SHARE)) {  // Create Share
+                String remotePath = intent.getStringExtra(EXTRA_REMOTE_PATH);
+                Intent sendIntent = intent.getParcelableExtra(EXTRA_SEND_INTENT);
+                if (remotePath.length() > 0) {
+                    operation = new CreateShareOperation(remotePath, ShareType.PUBLIC_LINK, 
+                            "", false, "", 1, sendIntent);
+                }
+            } else if (action.equals(ACTION_UNSHARE)) {  // Unshare file
+                String remotePath = intent.getStringExtra(EXTRA_REMOTE_PATH);
+                if (remotePath.length() > 0) {
+                    operation = new UnshareLinkOperation(remotePath, this.getApplicationContext());
+                }
+            } else {
+                // nothing we are going to handle
+                return START_NOT_STICKY;
+            }
+            
+            mPendingOperations.add(new Pair<Target , RemoteOperation>(target, operation));
+            //sendBroadcastNewOperation(target, operation);
+            
+            Message msg = mServiceHandler.obtainMessage();
+            msg.arg1 = startId;
+            mServiceHandler.sendMessage(msg);
+            
+        } catch (IllegalArgumentException e) {
+            Log_OC.e(TAG, "Bad information provided in intent: " + e.getMessage());
+            return START_NOT_STICKY;
+        }
+        
+        return START_NOT_STICKY;
+    }
+
+    
+    /**
+     * Provides a binder object that clients can use to perform actions on the queue of operations, 
+     * except the addition of new operations. 
+     */
+    @Override
+    public IBinder onBind(Intent intent) {
+        return mBinder;
+    }
+
+    
+    /**
+     * Called when ALL the bound clients were unbound.
+     */
+    @Override
+    public boolean onUnbind(Intent intent) {
+        //((OperationsServiceBinder)mBinder).clearListeners();
+        return false;   // not accepting rebinding (default behaviour)
+    }
+
+    
+    /**
+     *  Binder to let client components to perform actions on the queue of operations.
+     * 
+     *  It provides by itself the available operations.
+     */
+    public class OperationsServiceBinder extends Binder /* implements OnRemoteOperationListener */ {
+        
+        /** 
+         * Map of listeners that will be reported about the end of operations from a {@link OperationsServiceBinder} instance 
+         */
+        private Map<OnRemoteOperationListener, Handler> mBoundListeners = new HashMap<OnRemoteOperationListener, Handler>();
+        
+        /**
+         * Cancels an operation
+         *
+         * TODO
+         */
+        public void cancel() {
+            // TODO
+        }
+        
+        
+        public void clearListeners() {
+            
+            mBoundListeners.clear();
+        }
+
+        
+        /**
+         * Adds a listener interested in being reported about the end of operations.
+         * 
+         * @param listener          Object to notify about the end of operations.    
+         * @param callbackHandler   {@link Handler} to access the listener without breaking Android threading protection.
+         */
+        public void addOperationListener (OnRemoteOperationListener listener, Handler callbackHandler) {
+            mBoundListeners.put(listener, callbackHandler);
+        }
+        
+        
+        /**
+         * Removes a listener from the list of objects interested in the being reported about the end of operations.
+         * 
+         * @param listener      Object to notify about progress of transfer.    
+         */
+        public void removeOperationListener (OnRemoteOperationListener listener) {
+            mBoundListeners.remove(listener);
+        }
+
+
+        /**
+         * TODO - IMPORTANT: update implementation when more operations are moved into the service 
+         * 
+         * @return  'True' when an operation that enforces the user to wait for completion is in process.
+         */
+        public boolean isPerformingBlockingOperation() {
+            return (!mPendingOperations.isEmpty());
+        }
+
+    }
+    
+    
+    /** 
+     * Operations worker. Performs the pending operations in the order they were requested. 
+     * 
+     * Created with the Looper of a new thread, started in {@link OperationsService#onCreate()}. 
+     */
+    private static class ServiceHandler extends Handler {
+        // don't make it a final class, and don't remove the static ; lint will warn about a possible memory leak
+        OperationsService mService;
+        public ServiceHandler(Looper looper, OperationsService service) {
+            super(looper);
+            if (service == null) {
+                throw new IllegalArgumentException("Received invalid NULL in parameter 'service'");
+            }
+            mService = service;
+        }
+
+        @Override
+        public void handleMessage(Message msg) {
+            mService.nextOperation();
+            mService.stopSelf(msg.arg1);
+        }
+    }
+    
+
+    /**
+     * Performs the next operation in the queue
+     */
+    private void nextOperation() {
+        
+        Pair<Target, RemoteOperation> next = null;
+        synchronized(mPendingOperations) {
+            next = mPendingOperations.peek();
+        }
+        
+        if (next != null) {
+            
+            mCurrentOperation = next.second;
+            RemoteOperationResult result = null;
+            try {
+                /// prepare client object to send the request to the ownCloud server
+                if (mLastTarget == null || !mLastTarget.equals(next.first)) {
+                    mLastTarget = next.first;
+                    if (mLastTarget.mAccount != null) {
+                        mOwnCloudClient = OwnCloudClientFactory.createOwnCloudClient(mLastTarget.mAccount, getApplicationContext());
+                        mStorageManager = new FileDataStorageManager(mLastTarget.mAccount, getContentResolver());
+                    } else {
+                        mOwnCloudClient = OwnCloudClientFactory.createOwnCloudClient(mLastTarget.mServerUrl, getApplicationContext(), true);    // this is not good enough
+                        mStorageManager = null;
+                    }
+                }
+
+                /// perform the operation
+                if (mCurrentOperation instanceof SyncOperation) {
+                    result = ((SyncOperation)mCurrentOperation).execute(mOwnCloudClient, mStorageManager);
+                } else {
+                    result = mCurrentOperation.execute(mOwnCloudClient);
+                }
+            
+            } catch (AccountsException e) {
+                if (mLastTarget.mAccount == null) {
+                    Log_OC.e(TAG, "Error while trying to get autorization for a NULL account", e);
+                } else {
+                    Log_OC.e(TAG, "Error while trying to get autorization for " + mLastTarget.mAccount.name, e);
+                }
+                result = new RemoteOperationResult(e);
+                
+            } catch (IOException e) {
+                if (mLastTarget.mAccount == null) {
+                    Log_OC.e(TAG, "Error while trying to get autorization for a NULL account", e);
+                } else {
+                    Log_OC.e(TAG, "Error while trying to get autorization for " + mLastTarget.mAccount.name, e);
+                }
+                result = new RemoteOperationResult(e);
+            } catch (Exception e) {
+                if (mLastTarget.mAccount == null) {
+                    Log_OC.e(TAG, "Unexpected error for a NULL account", e);
+                } else {
+                    Log_OC.e(TAG, "Unexpected error for " + mLastTarget.mAccount.name, e);
+                }
+                result = new RemoteOperationResult(e);
+            
+            } finally {
+                synchronized(mPendingOperations) {
+                    mPendingOperations.poll();
+                }
+            }
+            
+            //sendBroadcastOperationFinished(mLastTarget, mCurrentOperation, result);
+            callbackOperationListeners(mLastTarget, mCurrentOperation, result);
+        }
+    }
+
+
+    /**
+     * Sends a broadcast when a new operation is added to the queue.
+     * 
+     * Local broadcasts are only delivered to activities in the same process, but can't be done sticky :\
+     * 
+     * @param target            Account or URL pointing to an OC server.
+     * @param operation         Added operation.
+     */
+    private void sendBroadcastNewOperation(Target target, RemoteOperation operation) {
+        Intent intent = new Intent(ACTION_OPERATION_ADDED);
+        if (target.mAccount != null) {
+            intent.putExtra(EXTRA_ACCOUNT, target.mAccount);    
+        } else {
+            intent.putExtra(EXTRA_SERVER_URL, target.mServerUrl);    
+        }
+        //LocalBroadcastManager lbm = LocalBroadcastManager.getInstance(this);
+        //lbm.sendBroadcast(intent);
+        sendStickyBroadcast(intent);
+    }
+
+    
+    // TODO - maybe add a notification for real start of operations
+    
+    /**
+     * Sends a LOCAL broadcast when an operations finishes in order to the interested activities can update their view
+     * 
+     * Local broadcasts are only delivered to activities in the same process.
+     * 
+     * @param target            Account or URL pointing to an OC server.
+     * @param operation         Finished operation.
+     * @param result            Result of the operation.
+     */
+    private void sendBroadcastOperationFinished(Target target, RemoteOperation operation, RemoteOperationResult result) {
+        Intent intent = new Intent(ACTION_OPERATION_FINISHED);
+        intent.putExtra(EXTRA_RESULT, result);
+        if (target.mAccount != null) {
+            intent.putExtra(EXTRA_ACCOUNT, target.mAccount);    
+        } else {
+            intent.putExtra(EXTRA_SERVER_URL, target.mServerUrl);    
+        }
+        //LocalBroadcastManager lbm = LocalBroadcastManager.getInstance(this);
+        //lbm.sendBroadcast(intent);
+        sendStickyBroadcast(intent);
+    }
+
+    
+    /**
+     * Notifies the currently subscribed listeners about the end of an operation.
+     * 
+     * @param target            Account or URL pointing to an OC server.
+     * @param operation         Finished operation.
+     * @param result            Result of the operation.
+     */
+    private void callbackOperationListeners(Target target, final RemoteOperation operation, final RemoteOperationResult result) {
+        Iterator<OnRemoteOperationListener> listeners = mBinder.mBoundListeners.keySet().iterator();
+        while (listeners.hasNext()) {
+            final OnRemoteOperationListener listener = listeners.next();
+            final Handler handler = mBinder.mBoundListeners.get(listener);
+            if (handler != null) { 
+                handler.post(new Runnable() {
+                    @Override
+                    public void run() {
+                        listener.onRemoteOperationFinish(operation, result);
+                    }
+                });
+            }
+        }
+            
+    }
+    
+
+}
index 74d2686..a9defc0 100644 (file)
@@ -25,10 +25,10 @@ import org.apache.http.HttpResponse;
 import org.apache.http.client.ClientProtocolException;\r
 \r
 import com.owncloud.android.datamodel.FileDataStorageManager;\r
-import com.owncloud.android.oc_framework.accounts.AccountUtils;\r
-import com.owncloud.android.oc_framework.accounts.AccountUtils.AccountNotFoundException;\r
-import com.owncloud.android.oc_framework.network.webdav.OwnCloudClientFactory;\r
-import com.owncloud.android.oc_framework.network.webdav.WebdavClient;\r
+import com.owncloud.android.lib.common.accounts.AccountUtils;\r
+import com.owncloud.android.lib.common.accounts.AccountUtils.AccountNotFoundException;\r
+import com.owncloud.android.lib.common.OwnCloudClientFactory;\r
+import com.owncloud.android.lib.common.OwnCloudClient;\r
 \r
 \r
 import android.accounts.Account;\r
@@ -56,7 +56,7 @@ public abstract class AbstractOwnCloudSyncAdapter extends
     private ContentProviderClient mContentProviderClient;\r
     private FileDataStorageManager mStoreManager;\r
 \r
-    private WebdavClient mClient = null;\r
+    private OwnCloudClient mClient = null;\r
 \r
     public AbstractOwnCloudSyncAdapter(Context context, boolean autoInitialize) {\r
         super(context, autoInitialize);\r
@@ -105,7 +105,7 @@ public abstract class AbstractOwnCloudSyncAdapter extends
         mClient = OwnCloudClientFactory.createOwnCloudClient(account, getContext());\r
     }\r
     \r
-    protected WebdavClient getClient() {\r
+    protected OwnCloudClient getClient() {\r
         return mClient;\r
     }\r
     \r
index db7f4c2..3ba1676 100644 (file)
@@ -25,7 +25,7 @@ import org.apache.http.client.methods.HttpPut;
 import org.apache.http.entity.ByteArrayEntity;
 
 import com.owncloud.android.authentication.AccountUtils;
-import com.owncloud.android.oc_framework.accounts.OwnCloudAccount;
+import com.owncloud.android.lib.common.accounts.AccountUtils.Constants;
 
 
 import android.accounts.Account;
@@ -92,7 +92,7 @@ public class ContactSyncAdapter extends AbstractOwnCloudSyncAdapter {
         AccountManager am = getAccountManager();
         @SuppressWarnings("deprecation")
         String uri = am.getUserData(getAccount(),
-                OwnCloudAccount.Constants.KEY_OC_URL).replace(
+                Constants.KEY_OC_URL).replace(
                 AccountUtils.WEBDAV_PATH_2_0, AccountUtils.CARDDAV_PATH_2_0);
         uri += "/addressbooks/"
                 + getAccount().name.substring(0,
index 058cfbc..4f1cd68 100644 (file)
@@ -30,10 +30,10 @@ import com.owncloud.android.R;
 import com.owncloud.android.authentication.AuthenticatorActivity;
 import com.owncloud.android.datamodel.FileDataStorageManager;
 import com.owncloud.android.datamodel.OCFile;
-import com.owncloud.android.oc_framework.operations.RemoteOperationResult;
+import com.owncloud.android.lib.common.operations.RemoteOperationResult;
 import com.owncloud.android.operations.SynchronizeFolderOperation;
 import com.owncloud.android.operations.UpdateOCVersionOperation;
-import com.owncloud.android.oc_framework.operations.RemoteOperationResult.ResultCode;
+import com.owncloud.android.lib.common.operations.RemoteOperationResult.ResultCode;
 import com.owncloud.android.ui.activity.ErrorsWhileCopyingHandlerActivity;
 import com.owncloud.android.utils.DisplayUtils;
 import com.owncloud.android.utils.Log_OC;
@@ -51,6 +51,7 @@ import android.content.Context;
 import android.content.Intent;
 import android.content.SyncResult;
 import android.os.Bundle;
+//import android.support.v4.content.LocalBroadcastManager;
 
 /**
  * Implementation of {@link AbstractThreadedSyncAdapter} responsible for synchronizing 
@@ -69,6 +70,16 @@ public class FileSyncAdapter extends AbstractOwnCloudSyncAdapter {
     private static final int MAX_FAILED_RESULTS = 3; 
     
     
+    public static final String EVENT_FULL_SYNC_START = FileSyncAdapter.class.getName() + ".EVENT_FULL_SYNC_START";
+    public static final String EVENT_FULL_SYNC_END = FileSyncAdapter.class.getName() + ".EVENT_FULL_SYNC_END";
+    public static final String EVENT_FULL_SYNC_FOLDER_CONTENTS_SYNCED = FileSyncAdapter.class.getName() + ".EVENT_FULL_SYNC_FOLDER_CONTENTS_SYNCED";
+    //public static final String EVENT_FULL_SYNC_FOLDER_SIZE_SYNCED = FileSyncAdapter.class.getName() + ".EVENT_FULL_SYNC_FOLDER_SIZE_SYNCED";
+    
+    public static final String EXTRA_ACCOUNT_NAME = FileSyncAdapter.class.getName() + ".EXTRA_ACCOUNT_NAME";
+    public static final String EXTRA_FOLDER_PATH = FileSyncAdapter.class.getName() + ".EXTRA_FOLDER_PATH";
+    public static final String EXTRA_RESULT = FileSyncAdapter.class.getName() + ".EXTRA_RESULT";
+    
+    
     /** Time stamp for the current synchronization process, used to distinguish fresh data */
     private long mCurrentSyncTime;
     
@@ -95,6 +106,9 @@ public class FileSyncAdapter extends AbstractOwnCloudSyncAdapter {
 
     /** {@link SyncResult} instance to return to the system when the synchronization finish */
     private SyncResult mSyncResult;
+
+    /** 'True' means that the server supports the share API */
+    private boolean mIsShareSupported;
     
     
     /**
@@ -139,6 +153,7 @@ public class FileSyncAdapter extends AbstractOwnCloudSyncAdapter {
         this.setAccount(account);
         this.setContentProviderClient(providerClient);
         this.setStorageManager(new FileDataStorageManager(account, providerClient));
+        
         try {
             this.initClientForCurrentAccount();
         } catch (IOException e) {
@@ -154,7 +169,7 @@ public class FileSyncAdapter extends AbstractOwnCloudSyncAdapter {
         }
         
         Log_OC.d(TAG, "Synchronization of ownCloud account " + account.name + " starting");
-        sendStickyBroadcast(true, null, null);  // message to signal the start of the synchronization to the UI
+        sendLocalBroadcast(EVENT_FULL_SYNC_START, null, null);  // message to signal the start of the synchronization to the UI
         
         try {
             updateOCVersion();
@@ -184,7 +199,7 @@ public class FileSyncAdapter extends AbstractOwnCloudSyncAdapter {
             if (mForgottenLocalFiles.size() > 0) {
                 notifyForgottenLocalFiles();
             }
-            sendStickyBroadcast(false, null, mLastFailedResult);        // message to signal the end to the UI
+            sendLocalBroadcast(EVENT_FULL_SYNC_END, null, mLastFailedResult);   // message to signal the end to the UI
         }
         
     }
@@ -215,6 +230,8 @@ public class FileSyncAdapter extends AbstractOwnCloudSyncAdapter {
         RemoteOperationResult result = update.execute(getClient());
         if (!result.isSuccess()) {
             mLastFailedResult = result; 
+        } else {
+            mIsShareSupported = update.getOCVersion().isSharedSupported();
         }
     }
     
@@ -243,13 +260,13 @@ public class FileSyncAdapter extends AbstractOwnCloudSyncAdapter {
         DataStorageManager dataStorageManager, 
         Account account, 
         Context context ) {
-            
         }
         */
         // folder synchronization
         SynchronizeFolderOperation synchFolderOp = new SynchronizeFolderOperation(  folder, 
                                                                                     mCurrentSyncTime, 
                                                                                     true,
+                                                                                    mIsShareSupported,
                                                                                     getStorageManager(), 
                                                                                     getAccount(), 
                                                                                     getContext()
@@ -258,7 +275,7 @@ public class FileSyncAdapter extends AbstractOwnCloudSyncAdapter {
         
         
         // synchronized folder -> notice to UI - ALWAYS, although !result.isSuccess
-        sendStickyBroadcast(true, folder.getRemotePath(), null);
+        sendLocalBroadcast(EVENT_FULL_SYNC_FOLDER_CONTENTS_SYNCED, folder.getRemotePath(), result);
         
         // check the result of synchronizing the folder
         if (result.isSuccess() || result.getCode() == ResultCode.SYNC_CONFLICT) {
@@ -332,9 +349,7 @@ public class FileSyncAdapter extends AbstractOwnCloudSyncAdapter {
                 syncDown = (parentEtagChanged || etag == null || etag.length() == 0);
                 if(syncDown) { */
                     synchronizeFolder(newFile);
-                    // update the size of the parent folder again after recursive synchronization 
-                    //getStorageManager().updateFolderSize(parent.getFileId());  
-                    sendStickyBroadcast(true, parent.getRemotePath(), null);        // notify again to refresh size in UI
+                    //sendLocalBroadcast(EVENT_FULL_SYNC_FOLDER_SIZE_SYNCED, parent.getRemotePath(), null);
                 //}
             }
         }
@@ -346,20 +361,22 @@ public class FileSyncAdapter extends AbstractOwnCloudSyncAdapter {
     /**
      * Sends a message to any application component interested in the progress of the synchronization.
      * 
-     * @param inProgress        'True' when the synchronization progress is not finished.
-     * @param dirRemotePath     Remote path of a folder that was just synchronized (with or without success)
+     * @param event             Event in the process of synchronization to be notified.   
+     * @param dirRemotePath     Remote path of the folder target of the event occurred.
+     * @param result            Result of an individual {@ SynchronizeFolderOperation}, if completed; may be null.
      */
-    private void sendStickyBroadcast(boolean inProgress, String dirRemotePath, RemoteOperationResult result) {
-        Intent i = new Intent(FileSyncService.getSyncMessage());
-        i.putExtra(FileSyncService.IN_PROGRESS, inProgress);
-        i.putExtra(FileSyncService.ACCOUNT_NAME, getAccount().name);
+    private void sendLocalBroadcast(String event, String dirRemotePath, RemoteOperationResult result) {
+        Log_OC.d(TAG, "Send broadcast " + event);
+        Intent intent = new Intent(event);
+        intent.putExtra(FileSyncAdapter.EXTRA_ACCOUNT_NAME, getAccount().name);
         if (dirRemotePath != null) {
-            i.putExtra(FileSyncService.SYNC_FOLDER_REMOTE_PATH, dirRemotePath);
+            intent.putExtra(FileSyncAdapter.EXTRA_FOLDER_PATH, dirRemotePath);
         }
         if (result != null) {
-            i.putExtra(FileSyncService.SYNC_RESULT, result);
+            intent.putExtra(FileSyncAdapter.EXTRA_RESULT, result);
         }
-        getContext().sendStickyBroadcast(i);
+        getContext().sendStickyBroadcast(intent);
+        //LocalBroadcastManager.getInstance(getContext()).sendBroadcast(intent);
     }
 
     
index 9ae051c..5da8c24 100644 (file)
@@ -31,20 +31,11 @@ import android.os.IBinder;
  */\r
 public class FileSyncService extends Service {\r
     \r
-    private static final String SYNC_MESSAGE = "ACCOUNT_SYNC";\r
-    public static final String SYNC_FOLDER_REMOTE_PATH = "SYNC_FOLDER_REMOTE_PATH";\r
-    public static final String IN_PROGRESS = "SYNC_IN_PROGRESS";\r
-    public static final String ACCOUNT_NAME = "ACCOUNT_NAME";\r
-    public static final String SYNC_RESULT = "SYNC_RESULT";\r
-\r
     // Storage for an instance of the sync adapter\r
     private static FileSyncAdapter sSyncAdapter = null;\r
     // Object to use as a thread-safe lock\r
     private static final Object sSyncAdapterLock = new Object();\r
     \r
-    public static String getSyncMessage(){\r
-        return FileSyncService.class.getName().toString() + SYNC_MESSAGE;\r
-    }\r
     /*\r
      * {@inheritDoc}\r
      */\r
index 3632b5e..e1c7b47 100644 (file)
@@ -48,7 +48,7 @@ import com.actionbarsherlock.view.MenuInflater;
 import com.actionbarsherlock.view.MenuItem;
 import com.owncloud.android.authentication.AuthenticatorActivity;
 import com.owncloud.android.authentication.AccountUtils;
-import com.owncloud.android.oc_framework.accounts.OwnCloudAccount;
+import com.owncloud.android.lib.common.accounts.AccountUtils.Constants;
 import com.owncloud.android.utils.DisplayUtils;
 import com.owncloud.android.utils.Log_OC;
 import com.owncloud.android.MainApp;
@@ -212,7 +212,7 @@ public class AccountSelectActivity extends SherlockListActivity implements
                 h.put("VER",
                         "ownCloud version: "
                                 + am.getUserData(a,
-                                        OwnCloudAccount.Constants.KEY_OC_VERSION));
+                                        Constants.KEY_OC_VERSION));
                 ll.add(h);
             }
 
index 5b22c34..fbbc5df 100644 (file)
@@ -19,7 +19,6 @@
 package com.owncloud.android.ui.activity;
 
 import com.actionbarsherlock.app.ActionBar;
-import com.owncloud.android.datamodel.FileDataStorageManager;
 import com.owncloud.android.datamodel.OCFile;
 import com.owncloud.android.files.services.FileUploader;
 import com.owncloud.android.ui.dialog.ConflictsResolveDialog;
@@ -77,6 +76,7 @@ public class ConflictsResolveActivity extends FileActivity implements OnConflict
 
     @Override
     protected void onAccountSet(boolean stateWasRecovered) {
+        super.onAccountSet(stateWasRecovered);
         if (getAccount() != null) {
             OCFile file = getFile();
             if (getFile() == null) {
@@ -84,8 +84,7 @@ public class ConflictsResolveActivity extends FileActivity implements OnConflict
                 finish();
             } else {
                 /// Check whether the 'main' OCFile handled by the Activity is contained in the current Account
-                FileDataStorageManager storageManager = new FileDataStorageManager(getAccount(), getContentResolver());
-                file = storageManager.getFileByPath(file.getRemotePath());   // file = null if not in the current Account
+                file = getStorageManager().getFileByPath(file.getRemotePath());   // file = null if not in the current Account
                 if (file != null) {
                     setFile(file);
                     ConflictsResolveDialog d = ConflictsResolveDialog.newInstance(file.getRemotePath(), this);
@@ -98,7 +97,6 @@ public class ConflictsResolveActivity extends FileActivity implements OnConflict
             }
             
         } else {
-            Log_OC.wtf(TAG, "onAccountChanged was called with NULL account associated!");
             finish();
         }
         
diff --git a/src/com/owncloud/android/ui/activity/CopyToClipboardActivity.java b/src/com/owncloud/android/ui/activity/CopyToClipboardActivity.java
new file mode 100644 (file)
index 0000000..b503c37
--- /dev/null
@@ -0,0 +1,65 @@
+/* ownCloud Android client application
+ *   Copyright (C) 2012-2014 ownCloud Inc.
+ *
+ *   This program is free software: you can redistribute it and/or modify
+ *   it under the terms of the GNU General Public License version 2,
+ *   as published by the Free Software Foundation.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+package com.owncloud.android.ui.activity;
+
+import com.owncloud.android.R;
+
+import android.app.Activity;
+import android.content.ClipData;
+import android.content.Intent;
+import android.os.Bundle;
+import android.text.ClipboardManager;
+import android.widget.Toast;
+
+/**
+ * Activity copying the text of the received Intent into the system clibpoard.
+ * 
+ * @author David A. Velasco
+ */
+@SuppressWarnings("deprecation")
+public class CopyToClipboardActivity extends Activity {
+    
+    @Override
+    public void onCreate(Bundle savedInstanceState) {
+        super.onCreate(savedInstanceState);
+        
+        // get the clipboard system service
+        ClipboardManager clipboardManager = (ClipboardManager) this.getSystemService(CLIPBOARD_SERVICE);
+        
+        // get the text to copy into the clipboard 
+        Intent intent = getIntent();
+        CharSequence text = intent.getCharSequenceExtra(Intent.EXTRA_TEXT);
+        
+        // and put the text the clipboard
+        if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.HONEYCOMB) {
+            // API level >= 11 -> modern Clipboard
+            ClipData clip = ClipData.newPlainText("ownCloud was here", text);
+            ((android.content.ClipboardManager)clipboardManager).setPrimaryClip(clip);
+            
+        } else {
+            // API level >= 11 -> legacy Clipboard
+            clipboardManager.setText(text);    
+        }
+        
+        // alert the user that the text is in the clipboard and we're done
+        Toast.makeText(this, R.string.clipboard_text_copied, Toast.LENGTH_SHORT).show();
+        
+        finish();
+    }    
+
+}
index 937d45d..42b90ae 100644 (file)
@@ -23,17 +23,35 @@ import android.accounts.AccountManager;
 import android.accounts.AccountManagerCallback;
 import android.accounts.AccountManagerFuture;
 import android.accounts.OperationCanceledException;
+import android.content.ComponentName;
+import android.content.Context;
 import android.content.Intent;
-import android.net.Uri;
+import android.content.ServiceConnection;
 import android.os.Bundle;
-import android.webkit.MimeTypeMap;
+import android.os.Handler;
+import android.os.IBinder;
+import android.support.v4.app.Fragment;
+import android.support.v4.app.FragmentManager;
+import android.support.v4.app.FragmentTransaction;
+import android.widget.Toast;
 
 import com.actionbarsherlock.app.SherlockFragmentActivity;
 import com.owncloud.android.MainApp;
 import com.owncloud.android.R;
 import com.owncloud.android.authentication.AccountUtils;
+import com.owncloud.android.datamodel.FileDataStorageManager;
 import com.owncloud.android.datamodel.OCFile;
-import com.owncloud.android.oc_framework.network.webdav.WebdavUtils;
+import com.owncloud.android.files.FileOperationsHelper;
+import com.owncloud.android.lib.common.operations.OnRemoteOperationListener;
+import com.owncloud.android.lib.common.operations.RemoteOperation;
+import com.owncloud.android.lib.common.operations.RemoteOperationResult;
+import com.owncloud.android.lib.common.operations.RemoteOperationResult.ResultCode;
+import com.owncloud.android.operations.CreateShareOperation;
+import com.owncloud.android.operations.UnshareLinkOperation;
+
+import com.owncloud.android.services.OperationsService;
+import com.owncloud.android.services.OperationsService.OperationsServiceBinder;
+import com.owncloud.android.ui.dialog.LoadingDialog;
 import com.owncloud.android.utils.Log_OC;
 
 
@@ -42,14 +60,16 @@ import com.owncloud.android.utils.Log_OC;
  * 
  * @author David A. Velasco
  */
-public abstract class FileActivity extends SherlockFragmentActivity {
+public class FileActivity extends SherlockFragmentActivity implements OnRemoteOperationListener {
 
     public static final String EXTRA_FILE = "com.owncloud.android.ui.activity.FILE";
     public static final String EXTRA_ACCOUNT = "com.owncloud.android.ui.activity.ACCOUNT";
     public static final String EXTRA_WAITING_TO_PREVIEW = "com.owncloud.android.ui.activity.WAITING_TO_PREVIEW";
     public static final String EXTRA_FROM_NOTIFICATION= "com.owncloud.android.ui.activity.FROM_NOTIFICATION";
     
-    public static final String TAG = FileActivity.class.getSimpleName(); 
+    public static final String TAG = FileActivity.class.getSimpleName();
+    
+    private static final String DIALOG_WAIT_TAG = "DIALOG_WAIT";
     
     
     /** OwnCloud {@link Account} where the main {@link OCFile} handled by the activity is located. */
@@ -69,6 +89,18 @@ public abstract class FileActivity extends SherlockFragmentActivity {
     
     /** Flag to signal if the activity is launched by a notification */
     private boolean mFromNotification;
+    
+    /** Messages handler associated to the main thread and the life cycle of the activity */
+    private Handler mHandler;
+    
+    /** Access point to the cached database for the current ownCloud {@link Account} */
+    private FileDataStorageManager mStorageManager = null;
+    
+    private FileOperationsHelper mFileOperationsHelper;
+    
+    private ServiceConnection mOperationsServiceConnection = null;
+    
+    private OperationsServiceBinder mOperationsServiceBinder = null;
 
     
     /**
@@ -81,7 +113,8 @@ public abstract class FileActivity extends SherlockFragmentActivity {
     @Override
     protected void onCreate(Bundle savedInstanceState) {
         super.onCreate(savedInstanceState);
-
+        mHandler = new Handler();
+        mFileOperationsHelper = new FileOperationsHelper();
         Account account;
         if(savedInstanceState != null) {
             account = savedInstanceState.getParcelable(FileActivity.EXTRA_ACCOUNT);
@@ -94,6 +127,9 @@ public abstract class FileActivity extends SherlockFragmentActivity {
         }
 
         setAccount(account, savedInstanceState != null);
+        
+        mOperationsServiceConnection = new OperationsServiceConnection();
+        bindService(new Intent(this, OperationsService.class), mOperationsServiceConnection, Context.BIND_AUTO_CREATE);
     }
 
     
@@ -109,7 +145,6 @@ public abstract class FileActivity extends SherlockFragmentActivity {
         if (!validAccount) {
             swapToDefaultAccount();
         }
-        
     }
 
     
@@ -119,6 +154,28 @@ public abstract class FileActivity extends SherlockFragmentActivity {
         if (mAccountWasSet) {
             onAccountSet(mAccountWasRestored);
         }
+        if (mOperationsServiceBinder != null) {
+            mOperationsServiceBinder.addOperationListener(FileActivity.this, mHandler);
+        }
+    }
+    
+    
+    @Override 
+    protected void onStop() {
+        super.onStop();
+        if (mOperationsServiceBinder != null) {
+            mOperationsServiceBinder.removeOperationListener(this);
+        }
+    }
+    
+    
+    @Override
+    protected void onDestroy() {
+        super.onDestroy();
+        if (mOperationsServiceConnection != null) {
+            unbindService(mOperationsServiceConnection);
+            mOperationsServiceBinder = null;
+        }
     }
     
     
@@ -292,41 +349,149 @@ public abstract class FileActivity extends SherlockFragmentActivity {
      * 
      *  Child classes must grant that state depending on the {@link Account} is updated.
      */
-    protected abstract void onAccountSet(boolean stateWasRecovered);
+    protected void onAccountSet(boolean stateWasRecovered) {
+        if (getAccount() != null) {
+            mStorageManager = new FileDataStorageManager(getAccount(), getContentResolver());
+            
+        } else {
+            Log_OC.wtf(TAG, "onAccountChanged was called with NULL account associated!");
+        }
+    }
+
+
+    public FileDataStorageManager getStorageManager() {
+        return mStorageManager;
+    }
+
+
+    public OnRemoteOperationListener getRemoteOperationListener() {
+        return this;
+    }
+
+
+    public Handler getHandler() {
+        return mHandler;
+    }
     
+    public FileOperationsHelper getFileOperationsHelper() {
+        return mFileOperationsHelper;
+    }
     
+    /**
+     * 
+     * @param operation     Removal operation performed.
+     * @param result        Result of the removal.
+     */
+    @Override
+    public void onRemoteOperationFinish(RemoteOperation operation, RemoteOperationResult result) {
+        Log_OC.d(TAG, "Received result of operation in FileActivity - common behaviour for all the FileActivities ");
+        if (operation instanceof CreateShareOperation) {
+            onCreateShareOperationFinish((CreateShareOperation) operation, result);
+            
+        } else if (operation instanceof UnshareLinkOperation) {
+            onUnshareLinkOperationFinish((UnshareLinkOperation)operation, result);
+        
+        } 
+    }
 
-    public void openFile(OCFile file) {
-        if (file != null) {
-            String storagePath = file.getStoragePath();
-            String encodedStoragePath = WebdavUtils.encodePath(storagePath);
+    private void onCreateShareOperationFinish(CreateShareOperation operation, RemoteOperationResult result) {
+        dismissLoadingDialog();
+        if (result.isSuccess()) {
+            updateFileFromDB();
             
-            Intent intentForSavedMimeType = new Intent(Intent.ACTION_VIEW);
-            intentForSavedMimeType.setDataAndType(Uri.parse("file://"+ encodedStoragePath), file.getMimetype());
-            intentForSavedMimeType.setFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION | Intent.FLAG_GRANT_WRITE_URI_PERMISSION);
+            Intent sendIntent = operation.getSendIntent();
+            startActivity(sendIntent);
             
-            Intent intentForGuessedMimeType = null;
-            if (storagePath.lastIndexOf('.') >= 0) {
-                String guessedMimeType = MimeTypeMap.getSingleton().getMimeTypeFromExtension(storagePath.substring(storagePath.lastIndexOf('.') + 1));
-                if (guessedMimeType != null && !guessedMimeType.equals(file.getMimetype())) {
-                    intentForGuessedMimeType = new Intent(Intent.ACTION_VIEW);
-                    intentForGuessedMimeType.setDataAndType(Uri.parse("file://"+ encodedStoragePath), guessedMimeType);
-                    intentForGuessedMimeType.setFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION | Intent.FLAG_GRANT_WRITE_URI_PERMISSION);
-                }
-            }
+        } else if (result.getCode() == ResultCode.SHARE_NOT_FOUND)  {        // Error --> SHARE_NOT_FOUND
+                Toast t = Toast.makeText(this, getString(R.string.share_link_file_no_exist), Toast.LENGTH_LONG);
+                t.show();
+        } else {    // Generic error
+            // Show a Message, operation finished without success
+            Toast t = Toast.makeText(this, getString(R.string.share_link_file_error), Toast.LENGTH_LONG);
+            t.show();
+        }
+    }
+    
+    
+    private void onUnshareLinkOperationFinish(UnshareLinkOperation operation, RemoteOperationResult result) {
+        dismissLoadingDialog();
+        
+        if (result.isSuccess()){
+            updateFileFromDB();
             
-            Intent chooserIntent = null;
-            if (intentForGuessedMimeType != null) {
-                chooserIntent = Intent.createChooser(intentForGuessedMimeType, getString(R.string.actionbar_open_with));
+        } else if (result.getCode() == ResultCode.SHARE_NOT_FOUND)  {        // Error --> SHARE_NOT_FOUND
+            Toast t = Toast.makeText(this, getString(R.string.unshare_link_file_no_exist), Toast.LENGTH_LONG);
+            t.show();
+        } else {    // Generic error
+            // Show a Message, operation finished without success
+            Toast t = Toast.makeText(this, getString(R.string.unshare_link_file_error), Toast.LENGTH_LONG);
+            t.show();
+        }
+        
+    }
+    
+    
+    private void updateFileFromDB(){
+      OCFile file = getStorageManager().getFileByPath(getFile().getRemotePath());
+      if (file != null) {
+          setFile(file);
+      }
+    }
+    
+    /**
+     * Show loading dialog 
+     */
+    public void showLoadingDialog() {
+        // Construct dialog
+        LoadingDialog loading = new LoadingDialog(getResources().getString(R.string.wait_a_moment));
+        FragmentManager fm = getSupportFragmentManager();
+        FragmentTransaction ft = fm.beginTransaction();
+        loading.show(ft, DIALOG_WAIT_TAG);
+        
+    }
+
+    
+    /**
+     * Dismiss loading dialog
+     */
+    public void dismissLoadingDialog(){
+        Fragment frag = getSupportFragmentManager().findFragmentByTag(DIALOG_WAIT_TAG);
+        if (frag != null) {
+            LoadingDialog loading = (LoadingDialog) frag;
+            loading.dismiss();
+        }
+    }
+
+    
+    /** 
+     * Implements callback methods for service binding. Passed as a parameter to { 
+     */
+    private class OperationsServiceConnection implements ServiceConnection {
+
+        @Override
+        public void onServiceConnected(ComponentName component, IBinder service) {
+            if (component.equals(new ComponentName(FileActivity.this, OperationsService.class))) {
+                Log_OC.d(TAG, "Operations service connected");
+                mOperationsServiceBinder = (OperationsServiceBinder) service;
+                mOperationsServiceBinder.addOperationListener(FileActivity.this, mHandler);
+                if (!mOperationsServiceBinder.isPerformingBlockingOperation()) {
+                    dismissLoadingDialog();
+                }
+
             } else {
-                chooserIntent = Intent.createChooser(intentForSavedMimeType, getString(R.string.actionbar_open_with));
+                return;
             }
-            
-            startActivity(chooserIntent);
-            
-        } else {
-            Log_OC.wtf(TAG, "Trying to open a NULL OCFile");
         }
-    }
+        
+
+        @Override
+        public void onServiceDisconnected(ComponentName component) {
+            if (component.equals(new ComponentName(FileActivity.this, OperationsService.class))) {
+                Log_OC.d(TAG, "Operations service disconnected");
+                mOperationsServiceBinder = null;
+                // TODO whatever could be waiting for the service is unbound
+            }
+        }
+    };    
     
 }
index 04f525e..4593e3f 100644 (file)
@@ -19,7 +19,6 @@
 package com.owncloud.android.ui.activity;
 
 import java.io.File;
-
 import android.accounts.Account;
 import android.app.AlertDialog;
 import android.app.Dialog;
@@ -38,13 +37,13 @@ import android.content.res.Resources.NotFoundException;
 import android.database.Cursor;
 import android.net.Uri;
 import android.os.Bundle;
-import android.os.Handler;
 import android.os.IBinder;
 import android.preference.PreferenceManager;
 import android.provider.MediaStore;
 import android.support.v4.app.Fragment;
 import android.support.v4.app.FragmentManager;
 import android.support.v4.app.FragmentTransaction;
+//import android.support.v4.content.LocalBroadcastManager;
 import android.util.Log;
 import android.view.View;
 import android.view.ViewGroup;
@@ -60,7 +59,6 @@ import com.actionbarsherlock.view.MenuItem;
 import com.actionbarsherlock.view.Window;
 import com.owncloud.android.MainApp;
 import com.owncloud.android.R;
-import com.owncloud.android.datamodel.FileDataStorageManager;
 import com.owncloud.android.datamodel.OCFile;
 import com.owncloud.android.files.services.FileDownloader;
 import com.owncloud.android.files.services.FileObserverService;
@@ -68,20 +66,24 @@ import com.owncloud.android.files.services.FileUploader;
 import com.owncloud.android.files.services.FileDownloader.FileDownloaderBinder;
 import com.owncloud.android.files.services.FileUploader.FileUploaderBinder;
 import com.owncloud.android.operations.CreateFolderOperation;
-import com.owncloud.android.oc_framework.operations.OnRemoteOperationListener;
-import com.owncloud.android.oc_framework.operations.RemoteOperation;
-import com.owncloud.android.oc_framework.operations.RemoteOperationResult;
-import com.owncloud.android.oc_framework.operations.RemoteOperationResult.ResultCode;
+
+import com.owncloud.android.lib.common.network.CertificateCombinedException;
+import com.owncloud.android.lib.common.operations.RemoteOperation;
+import com.owncloud.android.lib.common.operations.RemoteOperationResult;
+import com.owncloud.android.lib.common.operations.RemoteOperationResult.ResultCode;
+import com.owncloud.android.operations.CreateShareOperation;
 import com.owncloud.android.operations.RemoveFileOperation;
 import com.owncloud.android.operations.RenameFileOperation;
 import com.owncloud.android.operations.SynchronizeFileOperation;
 import com.owncloud.android.operations.SynchronizeFolderOperation;
-import com.owncloud.android.syncadapter.FileSyncService;
+import com.owncloud.android.operations.UnshareLinkOperation;
+import com.owncloud.android.services.OperationsService;
+import com.owncloud.android.syncadapter.FileSyncAdapter;
+import com.owncloud.android.ui.adapter.SslErrorViewAdapter;
 import com.owncloud.android.ui.dialog.EditNameDialog;
+import com.owncloud.android.ui.dialog.SslUntrustedCertDialog;
 import com.owncloud.android.ui.dialog.EditNameDialog.EditNameDialogListener;
-import com.owncloud.android.ui.dialog.LoadingDialog;
-import com.owncloud.android.ui.dialog.SslValidatorDialog;
-import com.owncloud.android.ui.dialog.SslValidatorDialog.OnSslValidatorListener;
+import com.owncloud.android.ui.dialog.SslUntrustedCertDialog.OnSslUntrustedCertListener;
 import com.owncloud.android.ui.fragment.FileDetailFragment;
 import com.owncloud.android.ui.fragment.FileFragment;
 import com.owncloud.android.ui.fragment.OCFileListFragment;
@@ -99,17 +101,15 @@ import com.owncloud.android.utils.Log_OC;
  * @author David A. Velasco
  */
 
-public class FileDisplayActivity extends FileActivity implements
-OCFileListFragment.ContainerActivity, FileDetailFragment.ContainerActivity, OnNavigationListener, OnSslValidatorListener, OnRemoteOperationListener, EditNameDialogListener {
+public class FileDisplayActivity extends HookActivity implements
+OCFileListFragment.ContainerActivity, FileDetailFragment.ContainerActivity, OnNavigationListener, OnSslUntrustedCertListener, EditNameDialogListener {
 
     private ArrayAdapter<String> mDirectories;
 
-    /** Access point to the cached database for the current ownCloud {@link Account} */
-    private FileDataStorageManager mStorageManager = null;
-
     private SyncBroadcastReceiver mSyncBroadcastReceiver;
     private UploadFinishReceiver mUploadFinishReceiver;
     private DownloadFinishReceiver mDownloadFinishReceiver;
+    //private OperationsServiceReceiver mOperationsServiceReceiver;
     private FileDownloaderBinder mDownloaderBinder = null;
     private FileUploaderBinder mUploaderBinder = null;
     private ServiceConnection mDownloadConnection = null, mUploadConnection = null;
@@ -121,14 +121,14 @@ OCFileListFragment.ContainerActivity, FileDetailFragment.ContainerActivity, OnNa
 
     private static final String KEY_WAITING_TO_PREVIEW = "WAITING_TO_PREVIEW";
     private static final String KEY_SYNC_IN_PROGRESS = "SYNC_IN_PROGRESS";
+    //private static final String KEY_REFRESH_SHARES_IN_PROGRESS = "SHARES_IN_PROGRESS";
+    private static final String KEY_WAITING_TO_SEND = "WAITING_TO_SEND";
 
     public static final int DIALOG_SHORT_WAIT = 0;
     private static final int DIALOG_CHOOSE_UPLOAD_SOURCE = 1;
-    private static final int DIALOG_SSL_VALIDATOR = 2;
-    private static final int DIALOG_CERT_NOT_SAVED = 3;
+    //private static final int DIALOG_SSL_VALIDATOR = 2;
+    private static final int DIALOG_CERT_NOT_SAVED = 2;
     
-    private static final String DIALOG_WAIT_TAG = "DIALOG_WAIT";
-
     public static final String ACTION_DETAILS = "com.owncloud.android.ui.activity.action.DETAILS";
 
     private static final int ACTION_SELECT_CONTENT_FROM_APPS = 1;
@@ -140,9 +140,13 @@ OCFileListFragment.ContainerActivity, FileDetailFragment.ContainerActivity, OnNa
     private static final String TAG_SECOND_FRAGMENT = "SECOND_FRAGMENT";
 
     private OCFile mWaitingToPreview;
-    private Handler mHandler;
     
     private boolean mSyncInProgress = false;
+    //private boolean mRefreshSharesInProgress = false;
+
+    private String DIALOG_UNTRUSTED_CERT;
+    
+    private OCFile mWaitingToSend;
 
     @Override
     protected void onCreate(Bundle savedInstanceState) {
@@ -151,8 +155,6 @@ OCFileListFragment.ContainerActivity, FileDetailFragment.ContainerActivity, OnNa
 
         super.onCreate(savedInstanceState); // this calls onAccountChanged() when ownCloud Account is valid
 
-        mHandler = new Handler();
-        
         /// bindings to transference services
         mUploadConnection = new ListServiceConnection(); 
         mDownloadConnection = new ListServiceConnection();
@@ -175,10 +177,14 @@ OCFileListFragment.ContainerActivity, FileDetailFragment.ContainerActivity, OnNa
         if(savedInstanceState != null) {
             mWaitingToPreview = (OCFile) savedInstanceState.getParcelable(FileDisplayActivity.KEY_WAITING_TO_PREVIEW);
             mSyncInProgress = savedInstanceState.getBoolean(KEY_SYNC_IN_PROGRESS);
+            //mRefreshSharesInProgress = savedInstanceState.getBoolean(KEY_REFRESH_SHARES_IN_PROGRESS);
+            mWaitingToSend = (OCFile) savedInstanceState.getParcelable(FileDisplayActivity.KEY_WAITING_TO_SEND);
            
         } else {
             mWaitingToPreview = null;
             mSyncInProgress = false;
+            //mRefreshSharesInProgress = false;
+            mWaitingToSend = null;
         }        
 
         /// USER INTERFACE
@@ -190,12 +196,17 @@ OCFileListFragment.ContainerActivity, FileDetailFragment.ContainerActivity, OnNa
         mRightFragmentContainer = findViewById(R.id.right_fragment_container);
         if (savedInstanceState == null) {
             createMinFragments();
+        } else {
+            Log_OC.d(TAG, "Init the secondFragment again");
+            if (mDualPane) {
+                initFragmentsWithFile();                
+            }
         }
 
         // Action bar setup
         mDirectories = new CustomArrayAdapter<String>(this, R.layout.sherlock_spinner_dropdown_item);
         getSupportActionBar().setHomeButtonEnabled(true);       // mandatory since Android ICS, according to the official documentation
-        setSupportProgressBarIndeterminateVisibility(mSyncInProgress);    // always AFTER setContentView(...) ; to work around bug in its implementation
+        setSupportProgressBarIndeterminateVisibility(mSyncInProgress /*|| mRefreshSharesInProgress*/);    // always AFTER setContentView(...) ; to work around bug in its implementation
         
         Log_OC.d(TAG, "onCreate() end");
     }
@@ -204,6 +215,7 @@ OCFileListFragment.ContainerActivity, FileDetailFragment.ContainerActivity, OnNa
     protected void onStart() {
         super.onStart();
         getSupportActionBar().setIcon(DisplayUtils.getSeasonalIconId());
+        refeshListOfFilesFragment();
     }
 
     @Override
@@ -215,15 +227,13 @@ OCFileListFragment.ContainerActivity, FileDetailFragment.ContainerActivity, OnNa
             unbindService(mUploadConnection);
     }
 
-
     /**
      *  Called when the ownCloud {@link Account} associated to the Activity was just updated.
      */ 
     @Override
     protected void onAccountSet(boolean stateWasRecovered) {
+        super.onAccountSet(stateWasRecovered);
         if (getAccount() != null) {
-            mStorageManager = new FileDataStorageManager(getAccount(), getContentResolver());
-
             /// Check whether the 'main' OCFile handled by the Activity is contained in the current Account
             OCFile file = getFile();
             // get parent from path
@@ -233,18 +243,19 @@ OCFileListFragment.ContainerActivity, FileDetailFragment.ContainerActivity, OnNa
                     // upload in progress - right now, files are not inserted in the local cache until the upload is successful
                     // get parent from path
                     parentPath = file.getRemotePath().substring(0, file.getRemotePath().lastIndexOf(file.getFileName()));
-                    if (mStorageManager.getFileByPath(parentPath) ==  null)
+                    if (getStorageManager().getFileByPath(parentPath) ==  null)
                         file = null; // not able to know the directory where the file is uploading
                 } else {
-                    file = mStorageManager.getFileByPath(file.getRemotePath());   // currentDir = null if not in the current Account
+                    file = getStorageManager().getFileByPath(file.getRemotePath());   // currentDir = null if not in the current Account
                 }
             }
             if (file == null) {
                 // fall back to root folder
-                file = mStorageManager.getFileByPath(OCFile.ROOT_PATH);  // never returns null
+                file = getStorageManager().getFileByPath(OCFile.ROOT_PATH);  // never returns null
             }
             setFile(file);
             setNavigationListWithFolder(file);
+            
             if (!stateWasRecovered) {
                 Log_OC.e(TAG, "Initializing Fragments in onAccountChanged..");
                 initFragmentsWithFile();
@@ -256,10 +267,6 @@ OCFileListFragment.ContainerActivity, FileDetailFragment.ContainerActivity, OnNa
                 updateFragmentsVisibility(!file.isFolder());
                 updateNavigationElementsInActionBar(file.isFolder() ? null : file);
             }
-            
-            
-        } else {
-            Log_OC.wtf(TAG, "onAccountChanged was called with NULL account associated!");
         }
     }
 
@@ -272,10 +279,9 @@ OCFileListFragment.ContainerActivity, FileDetailFragment.ContainerActivity, OnNa
             if (fileIt.isFolder()) {
                 mDirectories.add(fileIt.getFileName());
             }
-            //fileIt = mStorageManager.getFileById(fileIt.getParentId());
             // get parent from path
             parentPath = fileIt.getRemotePath().substring(0, fileIt.getRemotePath().lastIndexOf(fileIt.getFileName()));
-            fileIt = mStorageManager.getFileByPath(parentPath);
+            fileIt = getStorageManager().getFileByPath(parentPath);
         }
         mDirectories.add(OCFile.PATH_SEPARATOR);
     }
@@ -287,7 +293,7 @@ OCFileListFragment.ContainerActivity, FileDetailFragment.ContainerActivity, OnNa
         transaction.add(R.id.left_fragment_container, listOfFiles, TAG_LIST_OF_FILES);
         transaction.commit();
     }
-
+    
     private void initFragmentsWithFile() {
         if (getAccount() != null && getFile() != null) {
             /// First fragment
@@ -437,12 +443,12 @@ OCFileListFragment.ContainerActivity, FileDetailFragment.ContainerActivity, OnNa
                 boolean detailsFragmentChanged = false;
                 if (waitedPreview) {
                     if (success) {
-                        mWaitingToPreview = mStorageManager.getFileById(mWaitingToPreview.getFileId());   // update the file from database, for the local storage path
+                        mWaitingToPreview = getStorageManager().getFileById(mWaitingToPreview.getFileId());   // update the file from database, for the local storage path
                         if (PreviewMediaFragment.canBePreviewed(mWaitingToPreview)) {
                             startMediaPreview(mWaitingToPreview, 0, true);
                             detailsFragmentChanged = true;
                         } else {
-                            openFile(mWaitingToPreview);
+                            getFileOperationsHelper().openFile(mWaitingToPreview, this);
                         }
                     }
                     mWaitingToPreview = null;
@@ -454,7 +460,6 @@ OCFileListFragment.ContainerActivity, FileDetailFragment.ContainerActivity, OnNa
         }
     }
 
-
     @Override
     public boolean onCreateOptionsMenu(Menu menu) {
         MenuInflater inflater = getSherlock().getMenuInflater();
@@ -533,7 +538,7 @@ OCFileListFragment.ContainerActivity, FileDetailFragment.ContainerActivity, OnNa
                 targetPath = mDirectories.getItem(i) + OCFile.PATH_SEPARATOR + targetPath; 
             }
             targetPath = OCFile.PATH_SEPARATOR + targetPath;
-            OCFile targetFolder = mStorageManager.getFileByPath(targetPath);
+            OCFile targetFolder = getStorageManager().getFileByPath(targetPath);
             if (targetFolder != null) {
                 browseTo(targetFolder);
             }
@@ -541,7 +546,8 @@ OCFileListFragment.ContainerActivity, FileDetailFragment.ContainerActivity, OnNa
             // the next operation triggers a new call to this method, but it's necessary to 
             // ensure that the name exposed in the action bar is the current directory when the 
             // user selected it in the navigation list
-            getSupportActionBar().setSelectedNavigationItem(0);
+            if (getSupportActionBar().getNavigationMode() == ActionBar.NAVIGATION_MODE_LIST  && itemPosition != 0) 
+                getSupportActionBar().setSelectedNavigationItem(0);
         }
         return true;
     }
@@ -667,6 +673,8 @@ OCFileListFragment.ContainerActivity, FileDetailFragment.ContainerActivity, OnNa
         super.onSaveInstanceState(outState);
         outState.putParcelable(FileDisplayActivity.KEY_WAITING_TO_PREVIEW, mWaitingToPreview);
         outState.putBoolean(FileDisplayActivity.KEY_SYNC_IN_PROGRESS, mSyncInProgress);
+        //outState.putBoolean(FileDisplayActivity.KEY_REFRESH_SHARES_IN_PROGRESS, mRefreshSharesInProgress);
+        outState.putParcelable(FileDisplayActivity.KEY_WAITING_TO_SEND, mWaitingToSend);
 
         Log_OC.d(TAG, "onSaveInstanceState() end");
     }
@@ -679,9 +687,15 @@ OCFileListFragment.ContainerActivity, FileDetailFragment.ContainerActivity, OnNa
         Log_OC.e(TAG, "onResume() start");
 
         // Listen for sync messages
-        IntentFilter syncIntentFilter = new IntentFilter(FileSyncService.getSyncMessage());
+        IntentFilter syncIntentFilter = new IntentFilter(FileSyncAdapter.EVENT_FULL_SYNC_START);
+        syncIntentFilter.addAction(FileSyncAdapter.EVENT_FULL_SYNC_END);
+        //syncIntentFilter.addAction(FileSyncAdapter.EVENT_FULL_SYNC_FOLDER_SIZE_SYNCED);
+        syncIntentFilter.addAction(FileSyncAdapter.EVENT_FULL_SYNC_FOLDER_CONTENTS_SYNCED);
+        syncIntentFilter.addAction(SynchronizeFolderOperation.EVENT_SINGLE_FOLDER_CONTENTS_SYNCED);
+        syncIntentFilter.addAction(SynchronizeFolderOperation.EVENT_SINGLE_FOLDER_SHARES_SYNCED);
         mSyncBroadcastReceiver = new SyncBroadcastReceiver();
         registerReceiver(mSyncBroadcastReceiver, syncIntentFilter);
+        //LocalBroadcastManager.getInstance(this).registerReceiver(mSyncBroadcastReceiver, syncIntentFilter);
 
         // Listen for upload messages
         IntentFilter uploadIntentFilter = new IntentFilter(FileUploader.getUploadFinishMessage());
@@ -693,6 +707,14 @@ OCFileListFragment.ContainerActivity, FileDetailFragment.ContainerActivity, OnNa
         downloadIntentFilter.addAction(FileDownloader.getDownloadFinishMessage());
         mDownloadFinishReceiver = new DownloadFinishReceiver();
         registerReceiver(mDownloadFinishReceiver, downloadIntentFilter);
+        
+        // Listen for messages from the OperationsService
+        /*
+        IntentFilter operationsIntentFilter = new IntentFilter(OperationsService.ACTION_OPERATION_ADDED);
+        operationsIntentFilter.addAction(OperationsService.ACTION_OPERATION_FINISHED);
+        mOperationsServiceReceiver = new OperationsServiceReceiver();
+        LocalBroadcastManager.getInstance(this).registerReceiver(mOperationsServiceReceiver, operationsIntentFilter);
+        */
     
         Log_OC.d(TAG, "onResume() end");
     }
@@ -704,6 +726,7 @@ OCFileListFragment.ContainerActivity, FileDetailFragment.ContainerActivity, OnNa
         Log_OC.e(TAG, "onPause() start");
         if (mSyncBroadcastReceiver != null) {
             unregisterReceiver(mSyncBroadcastReceiver);
+            //LocalBroadcastManager.getInstance(this).unregisterReceiver(mSyncBroadcastReceiver);
             mSyncBroadcastReceiver = null;
         }
         if (mUploadFinishReceiver != null) {
@@ -714,16 +737,13 @@ OCFileListFragment.ContainerActivity, FileDetailFragment.ContainerActivity, OnNa
             unregisterReceiver(mDownloadFinishReceiver);
             mDownloadFinishReceiver = null;
         }
-
-        Log_OC.d(TAG, "onPause() end");
-    }
-
-
-    @Override
-    protected void onPrepareDialog(int id, Dialog dialog, Bundle args) {
-        if (id == DIALOG_SSL_VALIDATOR && mLastSslUntrustedServerResult != null) {
-            ((SslValidatorDialog)dialog).updateResult(mLastSslUntrustedServerResult);
+        /*
+        if (mOperationsServiceReceiver != null) {
+            LocalBroadcastManager.getInstance(this).unregisterReceiver(mOperationsServiceReceiver);
+            mOperationsServiceReceiver = null;
         }
+        */
+        Log_OC.d(TAG, "onPause() end");
     }
 
 
@@ -785,10 +805,6 @@ OCFileListFragment.ContainerActivity, FileDetailFragment.ContainerActivity, OnNa
             dialog = builder.create();
             break;
         }
-        case DIALOG_SSL_VALIDATOR: {
-            dialog = SslValidatorDialog.newInstance(this, mLastSslUntrustedServerResult, this);
-            break;
-        }
         case DIALOG_CERT_NOT_SAVED: {
             builder = new AlertDialog.Builder(this);
             builder.setMessage(getResources().getString(R.string.ssl_validator_not_saved));
@@ -811,30 +827,6 @@ OCFileListFragment.ContainerActivity, FileDetailFragment.ContainerActivity, OnNa
 
 
     /**
-     * Show loading dialog 
-     */
-    public void showLoadingDialog() {
-        // Construct dialog
-        LoadingDialog loading = new LoadingDialog(getResources().getString(R.string.wait_a_moment));
-        FragmentManager fm = getSupportFragmentManager();
-        FragmentTransaction ft = fm.beginTransaction();
-        loading.show(ft, DIALOG_WAIT_TAG);
-        
-    }
-    
-    /**
-     * Dismiss loading dialog
-     */
-    public void dismissLoadingDialog(){
-        Fragment frag = getSupportFragmentManager().findFragmentByTag(DIALOG_WAIT_TAG);
-      if (frag != null) {
-          LoadingDialog loading = (LoadingDialog) frag;
-            loading.dismiss();
-        }
-    }
-    
-    
-    /**
      * Translates a content URI of an image to a physical path
      * on the disk
      * @param uri The URI to resolve
@@ -886,6 +878,8 @@ OCFileListFragment.ContainerActivity, FileDetailFragment.ContainerActivity, OnNa
 
             ((TextView) v).setTextColor(getResources().getColorStateList(
                     android.R.color.white));
+            
+            fixRoot((TextView) v );
             return v;
         }
 
@@ -896,9 +890,16 @@ OCFileListFragment.ContainerActivity, FileDetailFragment.ContainerActivity, OnNa
             ((TextView) v).setTextColor(getResources().getColorStateList(
                     android.R.color.white));
 
+            fixRoot((TextView) v );
             return v;
         }
 
+        private void fixRoot(TextView v) {
+            if (v.getText().equals(OCFile.PATH_SEPARATOR)) {
+                v.setText(R.string.default_display_name_for_root_folder);
+            }
+        }
+
     }
 
     private class SyncBroadcastReceiver extends BroadcastReceiver {
@@ -908,53 +909,70 @@ OCFileListFragment.ContainerActivity, FileDetailFragment.ContainerActivity, OnNa
          */
         @Override
         public void onReceive(Context context, Intent intent) {
-            boolean inProgress = intent.getBooleanExtra(FileSyncService.IN_PROGRESS, false);
-            String accountName = intent.getStringExtra(FileSyncService.ACCOUNT_NAME);
-            RemoteOperationResult synchResult = (RemoteOperationResult)intent.getSerializableExtra(FileSyncService.SYNC_RESULT);
-
-            if (getAccount() != null && accountName.equals(getAccount().name)
-                    && mStorageManager != null
-                    ) {  
-
-                String synchFolderRemotePath = intent.getStringExtra(FileSyncService.SYNC_FOLDER_REMOTE_PATH); 
-
-                OCFile currentFile = (getFile() == null) ? null : mStorageManager.getFileByPath(getFile().getRemotePath());
-                OCFile currentDir = (getCurrentDir() == null) ? null : mStorageManager.getFileByPath(getCurrentDir().getRemotePath());
-
-                if (currentDir == null) {
-                    // current folder was removed from the server 
-                    Toast.makeText( FileDisplayActivity.this, 
-                                    String.format(getString(R.string.sync_current_folder_was_removed), mDirectories.getItem(0)), 
-                                    Toast.LENGTH_LONG)
-                        .show();
-                    browseToRoot();
+            String event = intent.getAction();
+            Log_OC.d(TAG, "Received broadcast " + event);
+            String accountName = intent.getStringExtra(FileSyncAdapter.EXTRA_ACCOUNT_NAME);
+            String synchFolderRemotePath = intent.getStringExtra(FileSyncAdapter.EXTRA_FOLDER_PATH); 
+            RemoteOperationResult synchResult = (RemoteOperationResult)intent.getSerializableExtra(FileSyncAdapter.EXTRA_RESULT);
+            boolean sameAccount = (getAccount() != null && accountName.equals(getAccount().name) && getStorageManager() != null); 
+
+            if (sameAccount) {
+                
+                if (FileSyncAdapter.EVENT_FULL_SYNC_START.equals(event)) {
+                    mSyncInProgress = true;
                     
                 } else {
-                    if (currentFile == null && !getFile().isFolder()) {
-                        // currently selected file was removed in the server, and now we know it
-                        cleanSecondFragment();
-                        currentFile = currentDir;
-                    }
-                
-                    if (synchFolderRemotePath != null && currentDir.getRemotePath().equals(synchFolderRemotePath)) {
-                        OCFileListFragment fileListFragment = getListOfFilesFragment();
-                        if (fileListFragment != null) {
-                            fileListFragment.listDirectory(currentDir);
+                    OCFile currentFile = (getFile() == null) ? null : getStorageManager().getFileByPath(getFile().getRemotePath());
+                    OCFile currentDir = (getCurrentDir() == null) ? null : getStorageManager().getFileByPath(getCurrentDir().getRemotePath());
+
+                    if (currentDir == null) {
+                        // current folder was removed from the server 
+                        Toast.makeText( FileDisplayActivity.this, 
+                                        String.format(getString(R.string.sync_current_folder_was_removed), mDirectories.getItem(0)), 
+                                        Toast.LENGTH_LONG)
+                            .show();
+                        browseToRoot();
+                        
+                    } else {
+                        if (currentFile == null && !getFile().isFolder()) {
+                            // currently selected file was removed in the server, and now we know it
+                            cleanSecondFragment();
+                            currentFile = currentDir;
                         }
+                    
+                        if (synchFolderRemotePath != null && currentDir.getRemotePath().equals(synchFolderRemotePath)) {
+                            OCFileListFragment fileListFragment = getListOfFilesFragment();
+                            if (fileListFragment != null) {
+                                fileListFragment.listDirectory(currentDir);
+                            }
+                        }
+                        setFile(currentFile);
+                    }
+                    
+                    mSyncInProgress = (!FileSyncAdapter.EVENT_FULL_SYNC_END.equals(event) && !SynchronizeFolderOperation.EVENT_SINGLE_FOLDER_SHARES_SYNCED.equals(event));
+                            
+                    /*
+                    if (synchResult != null && 
+                        synchResult.isSuccess() &&
+                            (SynchronizeFolderOperation.EVENT_SINGLE_FOLDER_SYNCED.equals(event) || 
+                                FileSyncAdapter.EVENT_FULL_SYNC_FOLDER_CONTENTS_SYNCED.equals(event)
+                            ) &&
+                            !mRefreshSharesInProgress &&
+                            getFileOperationsHelper().isSharedSupported(FileDisplayActivity.this)
+                        ) {
+                        startGetShares();
                     }
-                    setFile(currentFile);
+                    */
+                    
                 }
-                
-                setSupportProgressBarIndeterminateVisibility(inProgress);
                 removeStickyBroadcast(intent);
-                mSyncInProgress = inProgress;
-
+                Log_OC.d(TAG, "Setting progress visibility to " + mSyncInProgress);
+                setSupportProgressBarIndeterminateVisibility(mSyncInProgress /*|| mRefreshSharesInProgress*/);
             }
             
             if (synchResult != null) {
                 if (synchResult.getCode().equals(RemoteOperationResult.ResultCode.SSL_RECOVERABLE_PEER_UNVERIFIED)) {
                     mLastSslUntrustedServerResult = synchResult;
-                    showDialog(DIALOG_SSL_VALIDATOR); 
                 }
             }
         }
@@ -1000,6 +1018,13 @@ OCFileListFragment.ContainerActivity, FileDetailFragment.ContainerActivity, OnNa
                 refreshSecondFragment(intent.getAction(), downloadedRemotePath, intent.getBooleanExtra(FileDownloader.EXTRA_DOWNLOAD_RESULT, false));
             }
 
+            if (mWaitingToSend != null) {
+                mWaitingToSend = getStorageManager().getFileByPath(mWaitingToSend.getRemotePath()); // Update the file to send
+                if (mWaitingToSend.isDown()) { 
+                    sendDownloadedFile();
+                }
+            }
+            
             removeStickyBroadcast(intent);
         }
 
@@ -1013,16 +1038,45 @@ OCFileListFragment.ContainerActivity, FileDetailFragment.ContainerActivity, OnNa
             return (accountName != null && getAccount() != null && accountName.equals(getAccount().name));
         }
     }
-
-
+    
+    
     /**
-     * {@inheritDoc}
+     * Class waiting for broadcast events from the {@link OperationsService}.
+     * 
+     * Updates the list of files when a get for shares is finished; at this moment the refresh of shares is the only
+     * operation performed in {@link OperationsService}.
+     * 
+     * In the future will handle the progress or finalization of all the operations performed in {@link OperationsService}, 
+     * probably all the operations associated to the app model. 
      */
-    @Override
-    public FileDataStorageManager getStorageManager() {
-        return mStorageManager;
-    }
+    private class OperationsServiceReceiver extends BroadcastReceiver {
 
+        @Override
+        public void onReceive(Context context, Intent intent) {
+            if (OperationsService.ACTION_OPERATION_ADDED.equals(intent.getAction())) {
+                
+            } else if (OperationsService.ACTION_OPERATION_FINISHED.equals(intent.getAction())) {
+                //mRefreshSharesInProgress = false;
+                
+                Account account = intent.getParcelableExtra(OperationsService.EXTRA_ACCOUNT);
+                RemoteOperationResult getSharesResult = (RemoteOperationResult)intent.getSerializableExtra(OperationsService.EXTRA_RESULT);
+                if (getAccount() != null && account.name.equals(getAccount().name)
+                        && getStorageManager() != null
+                        ) {
+                    refeshListOfFilesFragment();
+                }
+                if ((getSharesResult != null) &&
+                        RemoteOperationResult.ResultCode.SSL_RECOVERABLE_PEER_UNVERIFIED.equals(getSharesResult.getCode())) {
+                    mLastSslUntrustedServerResult = getSharesResult;
+                    showUntrustedCertDialog(mLastSslUntrustedServerResult);
+                }
+
+                //setSupportProgressBarIndeterminateVisibility(mRefreshSharesInProgress || mSyncInProgress);
+            }
+            
+        }
+            
+    }
 
     public void browseToRoot() {
         OCFileListFragment listOfFiles = getListOfFilesFragment(); 
@@ -1030,7 +1084,7 @@ OCFileListFragment.ContainerActivity, FileDetailFragment.ContainerActivity, OnNa
             while (mDirectories.getCount() > 1) {
                 popDirname();
             }
-            OCFile root = mStorageManager.getFileByPath(OCFile.ROOT_PATH);
+            OCFile root = getStorageManager().getFileByPath(OCFile.ROOT_PATH);
             listOfFiles.listDirectory(root);
             setFile(listOfFiles.getCurrentFile());
             startSyncFolderOperation(root);
@@ -1143,9 +1197,13 @@ OCFileListFragment.ContainerActivity, FileDetailFragment.ContainerActivity, OnNa
         if (chosenFile == null || mDualPane) {
             // only list of files - set for browsing through folders
             OCFile currentDir = getCurrentDir();
-            actionBar.setDisplayHomeAsUpEnabled(currentDir != null && currentDir.getParentId() != 0);
-            actionBar.setDisplayShowTitleEnabled(false);
-            actionBar.setNavigationMode(ActionBar.NAVIGATION_MODE_LIST);
+            boolean noRoot = (currentDir != null && currentDir.getParentId() != 0);
+            actionBar.setDisplayHomeAsUpEnabled(noRoot);
+            actionBar.setDisplayShowTitleEnabled(!noRoot); 
+            if (!noRoot) {
+                actionBar.setTitle(getString(R.string.default_display_name_for_root_folder));
+            }
+            actionBar.setNavigationMode(!noRoot ? ActionBar.NAVIGATION_MODE_STANDARD : ActionBar.NAVIGATION_MODE_LIST);
             actionBar.setListNavigationCallbacks(mDirectories, this);   // assuming mDirectories is updated
 
         } else {
@@ -1256,6 +1314,10 @@ OCFileListFragment.ContainerActivity, FileDetailFragment.ContainerActivity, OnNa
         showDialog(DIALOG_CERT_NOT_SAVED);
     }
 
+    @Override
+    public void onCancelCertificate() {
+        // nothing to do
+    }
 
     /**
      * Updates the view associated to the activity after the finish of some operation over files
@@ -1266,6 +1328,8 @@ OCFileListFragment.ContainerActivity, FileDetailFragment.ContainerActivity, OnNa
      */
     @Override
     public void onRemoteOperationFinish(RemoteOperation operation, RemoteOperationResult result) {
+        super.onRemoteOperationFinish(operation, result);
+        
         if (operation instanceof RemoveFileOperation) {
             onRemoveFileOperationFinish((RemoveFileOperation)operation, result);
 
@@ -1278,10 +1342,52 @@ OCFileListFragment.ContainerActivity, FileDetailFragment.ContainerActivity, OnNa
         } else if (operation instanceof CreateFolderOperation) {
             onCreateFolderOperationFinish((CreateFolderOperation)operation, result);
             
+        } else if (operation instanceof CreateShareOperation) {
+            onCreateShareOperationFinish((CreateShareOperation) operation, result);
+            
+        } else if (operation instanceof UnshareLinkOperation) {
+            onUnshareLinkOperationFinish((UnshareLinkOperation)operation, result);
+        
         } 
+        
     }
 
+    
+    private void onCreateShareOperationFinish(CreateShareOperation operation, RemoteOperationResult result) {
+        if (result.isSuccess()) {
+            refreshShowDetails();
+            refeshListOfFilesFragment();
+        }
+    }
 
+    
+    private void onUnshareLinkOperationFinish(UnshareLinkOperation operation, RemoteOperationResult result) {
+        if (result.isSuccess()) {
+            refreshShowDetails();
+            refeshListOfFilesFragment();
+        } else if (result.getCode() == ResultCode.SHARE_NOT_FOUND) {
+            cleanSecondFragment();
+            refeshListOfFilesFragment();
+        }
+    }
+    
+    private void refreshShowDetails() {
+        FileFragment details = getSecondFragment();
+        if (details != null) {
+            OCFile file = details.getFile();
+            if (file != null) {
+                file = getStorageManager().getFileByPath(file.getRemotePath()); 
+                if (details instanceof PreviewMediaFragment) {
+                    // Refresh  OCFile of the fragment
+                    ((PreviewMediaFragment) details).updateFile(file);
+                } else {
+                    showDetails(file);
+                } 
+            }
+            invalidateOptionsMenu();
+        } 
+    }
+    
     /**
      * Updates the view associated to the activity after the finish of an operation trying to remove a 
      * file. 
@@ -1300,7 +1406,7 @@ OCFileListFragment.ContainerActivity, FileDetailFragment.ContainerActivity, OnNa
             if (second != null && removedFile.equals(second.getFile())) {
                 cleanSecondFragment();
             }
-            if (mStorageManager.getFileById(removedFile.getParentId()).equals(getCurrentDir())) {
+            if (getStorageManager().getFileById(removedFile.getParentId()).equals(getCurrentDir())) {
                 refeshListOfFilesFragment();
             }
 
@@ -1309,7 +1415,7 @@ OCFileListFragment.ContainerActivity, FileDetailFragment.ContainerActivity, OnNa
             msg.show();
             if (result.isSslRecoverableException()) {
                 mLastSslUntrustedServerResult = result;
-                showDialog(DIALOG_SSL_VALIDATOR); 
+                showUntrustedCertDialog(mLastSslUntrustedServerResult);
             }
         }
     }
@@ -1359,7 +1465,7 @@ OCFileListFragment.ContainerActivity, FileDetailFragment.ContainerActivity, OnNa
                     ((FileDetailFragment) details).updateFileDetails(renamedFile, getAccount());
                 }
             }
-            if (mStorageManager.getFileById(renamedFile.getParentId()).equals(getCurrentDir())) {
+            if (getStorageManager().getFileById(renamedFile.getParentId()).equals(getCurrentDir())) {
                 refeshListOfFilesFragment();
             }
 
@@ -1376,7 +1482,7 @@ OCFileListFragment.ContainerActivity, FileDetailFragment.ContainerActivity, OnNa
                 msg.show();
                 if (result.isSslRecoverableException()) {
                     mLastSslUntrustedServerResult = result;
-                    showDialog(DIALOG_SSL_VALIDATOR); 
+                    showUntrustedCertDialog(mLastSslUntrustedServerResult);
                 }
             }
         }
@@ -1435,11 +1541,11 @@ OCFileListFragment.ContainerActivity, FileDetailFragment.ContainerActivity, OnNa
 
                 // Create directory
                 path += newDirectoryName + OCFile.PATH_SEPARATOR;
-                RemoteOperation operation = new CreateFolderOperation(path, false, mStorageManager);
+                RemoteOperation operation = new CreateFolderOperation(path, false, getStorageManager());
                 operation.execute(  getAccount(), 
                         FileDisplayActivity.this, 
                         FileDisplayActivity.this, 
-                        mHandler,
+                        getHandler(),
                         FileDisplayActivity.this);
 
                 showLoadingDialog();
@@ -1464,9 +1570,9 @@ OCFileListFragment.ContainerActivity, FileDetailFragment.ContainerActivity, OnNa
         if (file != null) {
             if (file.isFolder()) {
                 return file;
-            } else if (mStorageManager != null) {
+            } else if (getStorageManager() != null) {
                 String parentPath = file.getRemotePath().substring(0, file.getRemotePath().lastIndexOf(file.getFileName()));
-                return mStorageManager.getFileByPath(parentPath);
+                return getStorageManager().getFileByPath(parentPath);
             }
         }
         return null;
@@ -1481,6 +1587,7 @@ OCFileListFragment.ContainerActivity, FileDetailFragment.ContainerActivity, OnNa
         RemoteOperation synchFolderOp = new SynchronizeFolderOperation( folder,  
                                                                         currentSyncTime, 
                                                                         false,
+                                                                        getFileOperationsHelper().isSharedSupported(this),
                                                                         getStorageManager(), 
                                                                         getAccount(), 
                                                                         getApplicationContext()
@@ -1490,16 +1597,56 @@ OCFileListFragment.ContainerActivity, FileDetailFragment.ContainerActivity, OnNa
         setSupportProgressBarIndeterminateVisibility(true);
     }
 
+    /*
+    private void startGetShares() {
+        // Get shared files/folders
+        Intent intent = new Intent(this, OperationsService.class);
+        intent.putExtra(OperationsService.EXTRA_ACCOUNT, getAccount());
+        startService(intent);
+        
+        mRefreshSharesInProgress = true;
+    }
+    */
+    
+    /**
+     * Show untrusted cert dialog 
+     */
+    public void showUntrustedCertDialog(RemoteOperationResult result) {
+        // Show a dialog with the certificate info
+        SslUntrustedCertDialog dialog = SslUntrustedCertDialog.newInstanceForFullSslError((CertificateCombinedException)result.getException());
+        FragmentManager fm = getSupportFragmentManager();
+        FragmentTransaction ft = fm.beginTransaction();
+        dialog.show(ft, DIALOG_UNTRUSTED_CERT);
+    }
+    
+    /**
+     * Requests the download of the received {@link OCFile} , updates the UI
+     * to monitor the download progress and prepares the activity to send the file
+     * when the download finishes.
+     * 
+     * @param file          {@link OCFile} to download and preview.
+     */
+    @Override
+    public void startDownloadForSending(OCFile file) {
+        mWaitingToSend = file;
+        requestForDownload(mWaitingToSend);
+        boolean hasSecondFragment = (getSecondFragment()!= null);
+        updateFragmentsVisibility(hasSecondFragment);
+    }
+    
+    private void requestForDownload(OCFile file) {
+        Account account = getAccount();
+        if (!mDownloaderBinder.isDownloading(account, file)) {
+            Intent i = new Intent(this, FileDownloader.class);
+            i.putExtra(FileDownloader.EXTRA_ACCOUNT, account);
+            i.putExtra(FileDownloader.EXTRA_FILE, file);
+            startService(i);
+        }
+    }
+    
+    private void sendDownloadedFile(){
+        getFileOperationsHelper().sendDownloadedFile(mWaitingToSend, this);
+        mWaitingToSend = null;
+    }
     
-//    public void enableDisableViewGroup(ViewGroup viewGroup, boolean enabled) {
-//        int childCount = viewGroup.getChildCount();
-//        for (int i = 0; i < childCount; i++) {
-//          View view = viewGroup.getChildAt(i);
-//          view.setEnabled(enabled);
-//          view.setClickable(!enabled);
-//          if (view instanceof ViewGroup) {
-//            enableDisableViewGroup((ViewGroup) view, enabled);
-//          }
-//        }
-//      }
 }
diff --git a/src/com/owncloud/android/ui/activity/HookActivity.java b/src/com/owncloud/android/ui/activity/HookActivity.java
new file mode 100644 (file)
index 0000000..54d65b1
--- /dev/null
@@ -0,0 +1,24 @@
+/* ownCloud Android client application
+ *   Copyright (C) 2012-2014 ownCloud Inc.
+ *
+ *   This program is free software: you can redistribute it and/or modify
+ *   it under the terms of the GNU General Public License version 2,
+ *   as published by the Free Software Foundation.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+package com.owncloud.android.ui.activity;
+
+public abstract class HookActivity extends FileActivity {
+
+    private static final String TAG = HookActivity.class.getName();
+    
+}
index 05a631d..3ebb432 100644 (file)
@@ -17,6 +17,7 @@
  */
 package com.owncloud.android.ui.activity;
 
+import android.accounts.Account;
 import android.content.Intent;
 import android.content.SharedPreferences;
 import android.content.pm.PackageInfo;
@@ -35,6 +36,7 @@ import com.actionbarsherlock.app.SherlockPreferenceActivity;
 import com.actionbarsherlock.view.Menu;
 import com.actionbarsherlock.view.MenuItem;
 import com.owncloud.android.R;
+import com.owncloud.android.authentication.AccountUtils;
 import com.owncloud.android.db.DbHandler;
 import com.owncloud.android.utils.DisplayUtils;
 import com.owncloud.android.utils.Log_OC;
@@ -131,18 +133,19 @@ public class Preferences extends SherlockPreferenceActivity {
 
                         Intent intent = new Intent(Intent.ACTION_SENDTO); 
                         intent.setType("text/plain");
-                        //Account currentAccount = AccountUtils.getCurrentOwnCloudAccount(Preferences.this);
+                        intent.setData(Uri.parse(getString(R.string.mail_recommend))); 
+                        intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); 
+                        
                         String appName = getString(R.string.app_name);
-                        //String username = currentAccount.name.substring(0, currentAccount.name.lastIndexOf('@')); 
-                        //String recommendSubject = String.format(getString(R.string.recommend_subject), username, appName);
+                        String downloadUrl = getString(R.string.url_app_download);
+                        Account currentAccount = AccountUtils.getCurrentOwnCloudAccount(Preferences.this);
+                        String username = currentAccount.name.substring(0, currentAccount.name.lastIndexOf('@'));
+                        
                         String recommendSubject = String.format(getString(R.string.recommend_subject), appName);
+                        String recommendText = String.format(getString(R.string.recommend_text), appName, downloadUrl, username);
+                        
                         intent.putExtra(Intent.EXTRA_SUBJECT, recommendSubject);
-                        //String recommendText = String.format(getString(R.string.recommend_text), getString(R.string.app_name), username);
-                        String recommendText = String.format(getString(R.string.recommend_text), getString(R.string.app_name), getString(R.string.url_app_download));
                         intent.putExtra(Intent.EXTRA_TEXT, recommendText);
-
-                        intent.setData(Uri.parse(getString(R.string.mail_recommend))); 
-                        intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); 
                         startActivity(intent);
 
 
index 7eff9b4..8b4a41d 100644 (file)
@@ -380,6 +380,7 @@ public class UploadFilesActivity extends FileActivity implements
 
     @Override
     protected void onAccountSet(boolean stateWasRecovered) {
+        super.onAccountSet(stateWasRecovered);
         if (getAccount() != null) {
             if (!mAccountOnCreation.equals(getAccount())) {
                 setResult(RESULT_CANCELED);
@@ -387,7 +388,6 @@ public class UploadFilesActivity extends FileActivity implements
             }
             
         } else {
-            Log_OC.wtf(TAG, "onAccountChanged was called with NULL account associated!");
             setResult(RESULT_CANCELED);
             finish();
         }
index 85c9e40..07e6e95 100644 (file)
@@ -329,13 +329,13 @@ public class Uploader extends ListActivity implements OnItemClickListener, andro
 
     public void uploadFiles() {
         try {
-            //WebdavClient webdav = OwnCloudClientUtils.createOwnCloudClient(mAccount, getApplicationContext());
+            //OwnCloudClient webdav = OwnCloudClientUtils.createOwnCloudClient(mAccount, getApplicationContext());
 
             ArrayList<String> local = new ArrayList<String>();
             ArrayList<String> remote = new ArrayList<String>();
             
             /* TODO - mCreateDir can never be true at this moment; we will replace wdc.createDirectory by CreateFolderOperation when that is fixed 
-            WebdavClient wdc = OwnCloudClientUtils.createOwnCloudClient(mAccount, getApplicationContext());
+            OwnCloudClient wdc = OwnCloudClientUtils.createOwnCloudClient(mAccount, getApplicationContext());
             // create last directory in path if necessary
             if (mCreateDir) {
                 wdc.createDirectory(mUploadPath);
diff --git a/src/com/owncloud/android/ui/adapter/CertificateCombinedExceptionViewAdapter.java b/src/com/owncloud/android/ui/adapter/CertificateCombinedExceptionViewAdapter.java
new file mode 100644 (file)
index 0000000..b1c3263
--- /dev/null
@@ -0,0 +1,74 @@
+/* ownCloud Android client application
+ *   Copyright (C) 2012-2014 ownCloud Inc.
+ *
+ *   This program is free software: you can redistribute it and/or modify
+ *   it under the terms of the GNU General Public License version 2,
+ *   as published by the Free Software Foundation.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+package com.owncloud.android.ui.adapter;
+
+import com.owncloud.android.R;
+import com.owncloud.android.lib.common.network.CertificateCombinedException;
+import com.owncloud.android.ui.dialog.SslUntrustedCertDialog;
+
+import android.view.View;
+import android.widget.TextView;
+
+/**
+ * TODO
+ * 
+ * @author masensio
+ * @author David A. Velasco
+ *
+ */
+public class CertificateCombinedExceptionViewAdapter implements SslUntrustedCertDialog.ErrorViewAdapter {
+    
+    //private final static String TAG = CertificateCombinedExceptionViewAdapter.class.getSimpleName();
+    
+    private CertificateCombinedException mSslException = null;
+    
+    public CertificateCombinedExceptionViewAdapter(CertificateCombinedException sslException) {
+        mSslException = sslException;
+    }
+    
+    @Override
+    public void updateErrorView(View dialogView) {
+        /// clean
+        dialogView.findViewById(R.id.reason_no_info_about_error).setVisibility(View.GONE);
+       
+        /// refresh
+        if (mSslException.getCertPathValidatorException() != null) {
+            ((TextView)dialogView.findViewById(R.id.reason_cert_not_trusted)).setVisibility(View.VISIBLE);
+        } else {
+            dialogView.findViewById(R.id.reason_cert_not_trusted).setVisibility(View.GONE);
+        }
+        
+        if (mSslException.getCertificateExpiredException() != null) {
+            ((TextView)dialogView.findViewById(R.id.reason_cert_expired)).setVisibility(View.VISIBLE);
+        } else {
+            dialogView.findViewById(R.id.reason_cert_expired).setVisibility(View.GONE);
+        }
+        
+        if (mSslException.getCertificateNotYetValidException() != null) {
+            ((TextView)dialogView.findViewById(R.id.reason_cert_not_yet_valid)).setVisibility(View.VISIBLE);
+        } else {
+            dialogView.findViewById(R.id.reason_cert_not_yet_valid).setVisibility(View.GONE);
+        }
+
+        if (mSslException.getSslPeerUnverifiedException() != null) {
+            ((TextView)dialogView.findViewById(R.id.reason_hostname_not_verified)).setVisibility(View.VISIBLE);
+        } else {
+            dialogView.findViewById(R.id.reason_hostname_not_verified).setVisibility(View.GONE);
+        }
+        
+    }
+}
index 841a5d0..11449af 100644 (file)
@@ -1,6 +1,6 @@
 /* ownCloud Android client application\r
  *   Copyright (C) 2011  Bartek Przybylski\r
- *   Copyright (C) 2012-2013 ownCloud Inc.\r
+ *   Copyright (C) 2012-2014 ownCloud Inc.\r
  *\r
  *   This program is free software: you can redistribute it and/or modify\r
  *   it under the terms of the GNU General Public License version 2,\r
@@ -161,12 +161,19 @@ public class FileListListAdapter extends BaseAdapter implements ListAdapter {
             } \r
             else {\r
                 \r
-                fileSizeV.setVisibility(View.VISIBLE);\r
-                fileSizeV.setText(DisplayUtils.bytesToHumanReadable(file.getFileLength()));\r
+                fileSizeV.setVisibility(View.INVISIBLE);\r
+                //fileSizeV.setText(DisplayUtils.bytesToHumanReadable(file.getFileLength()));\r
                 lastModV.setVisibility(View.VISIBLE);\r
                 lastModV.setText(DisplayUtils.unixTimeToHumanReadable(file.getModificationTimestamp()));\r
-               checkBoxV.setVisibility(View.GONE);\r
-               view.findViewById(R.id.imageView3).setVisibility(View.GONE);\r
+                checkBoxV.setVisibility(View.GONE);\r
+                view.findViewById(R.id.imageView3).setVisibility(View.GONE);\r
+            }\r
+            \r
+            ImageView shareIconV = (ImageView) view.findViewById(R.id.shareIcon);\r
+            if (file.isShareByLink()) {\r
+                shareIconV.setVisibility(View.VISIBLE);\r
+            } else {\r
+                shareIconV.setVisibility(View.INVISIBLE);\r
             }\r
         }\r
 \r
index 7cd2c2a..5686874 100644 (file)
@@ -1,6 +1,6 @@
 /* ownCloud Android client application
  *   Copyright (C) 2011  Bartek Przybylski
- *   Copyright (C) 2012-2013 ownCloud Inc.
+ *   Copyright (C) 2012-2014 ownCloud Inc.
  *
  *   This program is free software: you can redistribute it and/or modify
  *   it under the terms of the GNU General Public License version 2,
@@ -135,6 +135,8 @@ public class LocalFileListAdapter extends BaseAdapter implements ListAdapter {
             
             view.findViewById(R.id.imageView2).setVisibility(View.INVISIBLE);   // not GONE; the alignment changes; ugly way to keep it
             view.findViewById(R.id.imageView3).setVisibility(View.GONE);
+            
+            view.findViewById(R.id.shareIcon).setVisibility(View.GONE);
         }
 
         return view;
diff --git a/src/com/owncloud/android/ui/adapter/SslCertificateViewAdapter.java b/src/com/owncloud/android/ui/adapter/SslCertificateViewAdapter.java
new file mode 100644 (file)
index 0000000..a944ead
--- /dev/null
@@ -0,0 +1,126 @@
+/* ownCloud Android client application
+ *   Copyright (C) 2012-2014 ownCloud Inc.
+ *
+ *   This program is free software: you can redistribute it and/or modify
+ *   it under the terms of the GNU General Public License version 2,
+ *   as published by the Free Software Foundation.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+package com.owncloud.android.ui.adapter;
+
+import java.text.DateFormat;
+import java.util.Date;
+
+import com.owncloud.android.R;
+import com.owncloud.android.ui.dialog.SslUntrustedCertDialog;
+import android.net.http.SslCertificate;
+import android.view.View;
+import android.widget.TextView;
+
+/**
+ * TODO
+ * 
+ * @author masensio
+ * @author David A. Velasco
+ */
+public class SslCertificateViewAdapter implements SslUntrustedCertDialog.CertificateViewAdapter {
+    
+    //private final static String TAG = SslCertificateViewAdapter.class.getSimpleName();
+    
+    private SslCertificate mCertificate;
+
+    
+    /**
+     * Constructor
+     * 
+     * @param 
+     */
+    public SslCertificateViewAdapter(SslCertificate certificate) {
+        mCertificate = certificate;
+    }
+
+    @Override
+    public void updateCertificateView(View dialogView) {
+        TextView nullCerView = (TextView) dialogView.findViewById(R.id.null_cert);
+        if (mCertificate != null) {
+            nullCerView.setVisibility(View.GONE);
+            showSubject(mCertificate.getIssuedTo(), dialogView);
+            showIssuer(mCertificate.getIssuedBy(), dialogView);
+            showValidity(mCertificate.getValidNotBeforeDate(), mCertificate.getValidNotAfterDate(), dialogView);
+            hideSignature(dialogView);
+            
+        } else {
+            nullCerView.setVisibility(View.VISIBLE);
+        }
+    }
+    
+    private void showValidity(Date notBefore, Date notAfter, View dialogView) {
+        TextView fromView = ((TextView)dialogView.findViewById(R.id.value_validity_from));
+        TextView toView = ((TextView)dialogView.findViewById(R.id.value_validity_to));
+        DateFormat dateFormat = DateFormat.getDateInstance();
+        fromView.setText(dateFormat.format(notBefore));
+        toView.setText(dateFormat.format(notAfter));
+    }
+
+    
+    private void showSubject(SslCertificate.DName subject, View dialogView) {
+        TextView cnView = ((TextView)dialogView.findViewById(R.id.value_subject_CN));
+        cnView.setText(subject.getCName());
+        cnView.setVisibility(View.VISIBLE);
+        
+        TextView oView = ((TextView)dialogView.findViewById(R.id.value_subject_O));
+        oView.setText(subject.getOName());
+        oView.setVisibility(View.VISIBLE);
+        
+        TextView ouView = ((TextView)dialogView.findViewById(R.id.value_subject_OU));
+        ouView.setText(subject.getUName());
+        ouView.setVisibility(View.VISIBLE);
+
+        // SslCertificates don't offer this information
+        ((TextView)dialogView.findViewById(R.id.value_subject_C)).setVisibility(View.GONE);
+        ((TextView)dialogView.findViewById(R.id.value_subject_ST)).setVisibility(View.GONE);
+        ((TextView)dialogView.findViewById(R.id.value_subject_L)).setVisibility(View.GONE);
+        ((TextView)dialogView.findViewById(R.id.label_subject_C)).setVisibility(View.GONE);
+        ((TextView)dialogView.findViewById(R.id.label_subject_ST)).setVisibility(View.GONE);
+        ((TextView)dialogView.findViewById(R.id.label_subject_L)).setVisibility(View.GONE);
+    }
+    
+    
+    private void showIssuer(SslCertificate.DName issuer, View dialogView) {
+        TextView cnView = ((TextView)dialogView.findViewById(R.id.value_issuer_CN));
+        cnView.setText(issuer.getCName());
+        cnView.setVisibility(View.VISIBLE);
+        
+        TextView oView = ((TextView)dialogView.findViewById(R.id.value_issuer_O));
+        oView.setText(issuer.getOName());
+        oView.setVisibility(View.VISIBLE);
+
+        TextView ouView = ((TextView)dialogView.findViewById(R.id.value_issuer_OU));
+        ouView.setText(issuer.getUName());
+        ouView.setVisibility(View.VISIBLE);
+        
+        // SslCertificates don't offer this information
+        ((TextView)dialogView.findViewById(R.id.value_issuer_C)).setVisibility(View.GONE);
+        ((TextView)dialogView.findViewById(R.id.value_issuer_ST)).setVisibility(View.GONE);
+        ((TextView)dialogView.findViewById(R.id.value_issuer_L)).setVisibility(View.GONE);
+        ((TextView)dialogView.findViewById(R.id.label_issuer_C)).setVisibility(View.GONE);
+        ((TextView)dialogView.findViewById(R.id.label_issuer_ST)).setVisibility(View.GONE);
+        ((TextView)dialogView.findViewById(R.id.label_issuer_L)).setVisibility(View.GONE);
+    }
+    
+    private void hideSignature(View dialogView) {
+        ((TextView)dialogView.findViewById(R.id.label_signature)).setVisibility(View.GONE);
+        ((TextView)dialogView.findViewById(R.id.label_signature_algorithm)).setVisibility(View.GONE);
+        ((TextView)dialogView.findViewById(R.id.value_signature_algorithm)).setVisibility(View.GONE);
+        ((TextView)dialogView.findViewById(R.id.value_signature)).setVisibility(View.GONE);
+    }
+
+}
diff --git a/src/com/owncloud/android/ui/adapter/SslErrorViewAdapter.java b/src/com/owncloud/android/ui/adapter/SslErrorViewAdapter.java
new file mode 100644 (file)
index 0000000..7d2e291
--- /dev/null
@@ -0,0 +1,73 @@
+/* ownCloud Android client application
+ *   Copyright (C) 2012-2014 ownCloud Inc.
+ *
+ *   This program is free software: you can redistribute it and/or modify
+ *   it under the terms of the GNU General Public License version 2,
+ *   as published by the Free Software Foundation.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+package com.owncloud.android.ui.adapter;
+
+import com.owncloud.android.R;
+import com.owncloud.android.ui.dialog.SslUntrustedCertDialog;
+import android.net.http.SslError;
+import android.view.View;
+import android.widget.TextView;
+
+/**
+ * Dialog to show an Untrusted Certificate
+ * 
+ * @author masensio
+ * @author David A. Velasco
+ *
+ */
+public class SslErrorViewAdapter implements SslUntrustedCertDialog.ErrorViewAdapter {
+    
+    //private final static String TAG = SslErrorViewAdapter.class.getSimpleName();
+    
+    private SslError mSslError;
+    
+    public SslErrorViewAdapter(SslError sslError) {
+        mSslError = sslError;
+    }
+    
+    @Override
+    public void updateErrorView(View dialogView) {
+        /// clean
+        dialogView.findViewById(R.id.reason_no_info_about_error).setVisibility(View.GONE);
+        
+        /// refresh
+        if (mSslError.hasError(SslError.SSL_UNTRUSTED)) {
+            ((TextView)dialogView.findViewById(R.id.reason_cert_not_trusted)).setVisibility(View.VISIBLE);
+        } else {
+            dialogView.findViewById(R.id.reason_cert_not_trusted).setVisibility(View.GONE);
+        }
+        
+        if (mSslError.hasError(SslError.SSL_EXPIRED)) {
+            ((TextView)dialogView.findViewById(R.id.reason_cert_expired)).setVisibility(View.VISIBLE);
+        } else {
+            dialogView.findViewById(R.id.reason_cert_expired).setVisibility(View.GONE);
+        }
+        
+        if (mSslError.getPrimaryError() == SslError.SSL_NOTYETVALID) {
+            ((TextView)dialogView.findViewById(R.id.reason_cert_not_yet_valid)).setVisibility(View.VISIBLE);
+        } else {
+            dialogView.findViewById(R.id.reason_cert_not_yet_valid).setVisibility(View.GONE);
+        }
+        
+        if (mSslError.getPrimaryError() == SslError.SSL_IDMISMATCH) {
+            ((TextView)dialogView.findViewById(R.id.reason_hostname_not_verified)).setVisibility(View.VISIBLE);
+        } else {
+            dialogView.findViewById(R.id.reason_hostname_not_verified).setVisibility(View.GONE);
+        }
+    }
+
+}
diff --git a/src/com/owncloud/android/ui/adapter/X509CertificateViewAdapter.java b/src/com/owncloud/android/ui/adapter/X509CertificateViewAdapter.java
new file mode 100644 (file)
index 0000000..a290dca
--- /dev/null
@@ -0,0 +1,204 @@
+/* ownCloud Android client application
+ *   Copyright (C) 2012-2014 ownCloud Inc.
+ *
+ *   This program is free software: you can redistribute it and/or modify
+ *   it under the terms of the GNU General Public License version 2,
+ *   as published by the Free Software Foundation.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+package com.owncloud.android.ui.adapter;
+
+import java.security.cert.X509Certificate;
+import java.text.DateFormat;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.Map;
+
+import javax.security.auth.x500.X500Principal;
+
+import com.owncloud.android.R;
+import com.owncloud.android.ui.dialog.SslUntrustedCertDialog;
+
+import android.view.View;
+import android.widget.TextView;
+
+/**
+ * 
+ * @author masensio
+ * @author David A. Velasco
+ *
+ */
+public class X509CertificateViewAdapter implements SslUntrustedCertDialog.CertificateViewAdapter {
+    
+    //private final static String TAG = X509CertificateViewAdapter.class.getSimpleName();
+    
+    private X509Certificate mCertificate = null;
+    
+    public X509CertificateViewAdapter(X509Certificate certificate) {
+        mCertificate = certificate;
+    }
+    
+    @Override
+    public void updateCertificateView(View dialogView) {
+        TextView nullCerView = (TextView) dialogView.findViewById(R.id.null_cert);
+        
+        if (mCertificate != null) {
+            nullCerView.setVisibility(View.GONE);
+            showSubject(mCertificate.getSubjectX500Principal(), dialogView);
+            showIssuer(mCertificate.getIssuerX500Principal(), dialogView);
+            showValidity(mCertificate.getNotBefore(), mCertificate.getNotAfter(), dialogView);
+            showSignature(dialogView);
+            
+        } else {
+            nullCerView.setVisibility(View.VISIBLE);
+        }
+    }
+
+    private void showSignature(View dialogView) {
+        TextView sigView = ((TextView)dialogView.findViewById(R.id.value_signature));
+        TextView algorithmView = ((TextView)dialogView.findViewById(R.id.value_signature_algorithm));
+        sigView.setText(getHex(mCertificate.getSignature()));
+        algorithmView.setText(mCertificate.getSigAlgName());
+    }
+    
+    public String getHex(final byte [] raw) {
+        if (raw == null) {
+           return null;
+        }
+        final StringBuilder hex = new StringBuilder(2 * raw.length);
+        for (final byte b : raw) {
+           final int hiVal = (b & 0xF0) >> 4;
+           final int loVal = b & 0x0F;
+           hex.append((char) ('0' + (hiVal + (hiVal / 10 * 7))));
+           hex.append((char) ('0' + (loVal + (loVal / 10 * 7))));
+        }
+        return hex.toString();
+     }    
+
+    private void showValidity(Date notBefore, Date notAfter, View dialogView) {
+        TextView fromView = ((TextView)dialogView.findViewById(R.id.value_validity_from));
+        TextView toView = ((TextView)dialogView.findViewById(R.id.value_validity_to));
+        DateFormat dateFormat = DateFormat.getDateInstance();
+        fromView.setText(dateFormat.format(notBefore));
+        toView.setText(dateFormat.format(notAfter));
+    }
+
+    private void showSubject(X500Principal subject, View dialogView) {
+        Map<String, String> s = parsePrincipal(subject);
+        TextView cnView = ((TextView)dialogView.findViewById(R.id.value_subject_CN));
+        TextView oView = ((TextView)dialogView.findViewById(R.id.value_subject_O));
+        TextView ouView = ((TextView)dialogView.findViewById(R.id.value_subject_OU));
+        TextView cView = ((TextView)dialogView.findViewById(R.id.value_subject_C));
+        TextView stView = ((TextView)dialogView.findViewById(R.id.value_subject_ST));
+        TextView lView = ((TextView)dialogView.findViewById(R.id.value_subject_L));
+        
+        if (s.get("CN") != null) {
+            cnView.setText(s.get("CN"));
+            cnView.setVisibility(View.VISIBLE);
+        } else {
+            cnView.setVisibility(View.GONE);
+        }
+        if (s.get("O") != null) {
+            oView.setText(s.get("O"));
+            oView.setVisibility(View.VISIBLE);
+        } else {
+            oView.setVisibility(View.GONE);
+        }
+        if (s.get("OU") != null) {
+            ouView.setText(s.get("OU"));
+            ouView.setVisibility(View.VISIBLE);
+        } else {
+            ouView.setVisibility(View.GONE);
+        }
+        if (s.get("C") != null) {
+            cView.setText(s.get("C"));
+            cView.setVisibility(View.VISIBLE);
+        } else {
+            cView.setVisibility(View.GONE);
+        }
+        if (s.get("ST") != null) {
+            stView.setText(s.get("ST"));
+            stView.setVisibility(View.VISIBLE);
+        } else {
+            stView.setVisibility(View.GONE);
+        }
+        if (s.get("L") != null) {
+            lView.setText(s.get("L"));
+            lView.setVisibility(View.VISIBLE);
+        } else {
+            lView.setVisibility(View.GONE);
+        }
+    }
+    
+    private void showIssuer(X500Principal issuer, View dialogView) {
+        Map<String, String> s = parsePrincipal(issuer);
+        TextView cnView = ((TextView)dialogView.findViewById(R.id.value_issuer_CN));
+        TextView oView = ((TextView)dialogView.findViewById(R.id.value_issuer_O));
+        TextView ouView = ((TextView)dialogView.findViewById(R.id.value_issuer_OU));
+        TextView cView = ((TextView)dialogView.findViewById(R.id.value_issuer_C));
+        TextView stView = ((TextView)dialogView.findViewById(R.id.value_issuer_ST));
+        TextView lView = ((TextView)dialogView.findViewById(R.id.value_issuer_L));
+        
+        if (s.get("CN") != null) {
+            cnView.setText(s.get("CN"));
+            cnView.setVisibility(View.VISIBLE);
+        } else {
+            cnView.setVisibility(View.GONE);
+        }
+        if (s.get("O") != null) {
+            oView.setText(s.get("O"));
+            oView.setVisibility(View.VISIBLE);
+        } else {
+            oView.setVisibility(View.GONE);
+        }
+        if (s.get("OU") != null) {
+            ouView.setText(s.get("OU"));
+            ouView.setVisibility(View.VISIBLE);
+        } else {
+            ouView.setVisibility(View.GONE);
+        }
+        if (s.get("C") != null) {
+            cView.setText(s.get("C"));
+            cView.setVisibility(View.VISIBLE);
+        } else {
+            cView.setVisibility(View.GONE);
+        }
+        if (s.get("ST") != null) {
+            stView.setText(s.get("ST"));
+            stView.setVisibility(View.VISIBLE);
+        } else {
+            stView.setVisibility(View.GONE);
+        }
+        if (s.get("L") != null) {
+            lView.setText(s.get("L"));
+            lView.setVisibility(View.VISIBLE);
+        } else {
+            lView.setVisibility(View.GONE);
+        }
+    }
+    
+
+    private Map<String, String> parsePrincipal(X500Principal principal) {
+        Map<String, String> result = new HashMap<String, String>();
+        String toParse = principal.getName();
+        String[] pieces = toParse.split(",");
+        String[] tokens = {"CN", "O", "OU", "C", "ST", "L"}; 
+        for (int i=0; i < pieces.length ; i++) {
+            for (int j=0; j<tokens.length; j++) {
+                if (pieces[i].startsWith(tokens[j] + "=")) {
+                    result.put(tokens[j], pieces[i].substring(tokens[j].length()+1));
+                }
+            }
+        }
+        return result;
+    }
+
+}
index 862715f..0ab7e4d 100644 (file)
@@ -31,7 +31,7 @@ import android.widget.Toast;
 
 import com.actionbarsherlock.app.SherlockDialogFragment;
 import com.owncloud.android.R;
-import com.owncloud.android.oc_framework.utils.FileUtils;
+import com.owncloud.android.lib.resources.files.FileUtils;
 
 
 /**
index 2203e03..5622441 100644 (file)
@@ -1,3 +1,19 @@
+/* ownCloud Android client application
+ *   Copyright (C) 2012-2014 ownCloud Inc.
+ *
+ *   This program is free software: you can redistribute it and/or modify
+ *   it under the terms of the GNU General Public License version 2,
+ *   as published by the Free Software Foundation.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
 package com.owncloud.android.ui.dialog;
 
 import com.owncloud.android.R;
index 91c607e..cbf1acb 100644 (file)
@@ -1,5 +1,5 @@
 /* ownCloud Android client application
- *   Copyright (C) 2012-2013 ownCloud Inc.
+ *   Copyright (C) 2012-2014 ownCloud Inc.
  *
  *   This program is free software: you can redistribute it and/or modify
  *   it under the terms of the GNU General Public License version 2,
@@ -30,15 +30,15 @@ import android.view.View;
 import android.view.ViewGroup;
 import android.webkit.CookieManager;
 import android.webkit.CookieSyncManager;
-import android.webkit.WebBackForwardList;
 import android.webkit.WebSettings;
 import android.webkit.WebView;
+import android.widget.RelativeLayout;
 
 import com.actionbarsherlock.app.SherlockDialogFragment;
 import com.owncloud.android.R;
 import com.owncloud.android.authentication.SsoWebViewClient;
 import com.owncloud.android.authentication.SsoWebViewClient.SsoWebViewClientListener;
-import com.owncloud.android.oc_framework.network.webdav.WebdavClient;
+import com.owncloud.android.lib.common.OwnCloudClient;
 import com.owncloud.android.utils.Log_OC;
 
 
@@ -56,7 +56,6 @@ public class SamlWebViewDialog extends SherlockDialogFragment {
 
     private static final String ARG_INITIAL_URL = "INITIAL_URL";
     private static final String ARG_TARGET_URL = "TARGET_URL";
-    private static final String KEY_WEBVIEW_STATE = "WEBVIEW_STATE";
     
     private WebView mSsoWebView;
     private SsoWebViewClient mWebViewClient;
@@ -68,9 +67,6 @@ public class SamlWebViewDialog extends SherlockDialogFragment {
 
     private SsoWebViewClientListener mSsoWebViewClientListener;
 
-    //private View mSsoRootView;
-
-
     /**
      * Public factory method to get dialog instances.
      * 
@@ -103,7 +99,7 @@ public class SamlWebViewDialog extends SherlockDialogFragment {
         try {
             mSsoWebViewClientListener = (SsoWebViewClientListener) activity;
             mHandler = new Handler();
-            mWebViewClient = new SsoWebViewClient(mHandler, mSsoWebViewClientListener);
+            mWebViewClient = new SsoWebViewClient(activity, mHandler, mSsoWebViewClientListener);
             
        } catch (ClassCastException e) {
             throw new ClassCastException(activity.toString() + " must implement " + SsoWebViewClientListener.class.getSimpleName());
@@ -114,10 +110,12 @@ public class SamlWebViewDialog extends SherlockDialogFragment {
     @SuppressLint("SetJavaScriptEnabled")
     @Override
     public void onCreate(Bundle savedInstanceState) {
-        Log_OC.d(TAG, "onCreate");
+        Log_OC.d(TAG, "onCreate, savedInstanceState is " + savedInstanceState);
         super.onCreate(savedInstanceState);
         
-        CookieSyncManager.createInstance(getActivity());
+        setRetainInstance(true);
+        
+        CookieSyncManager.createInstance(getSherlockActivity().getApplicationContext());
 
         if (savedInstanceState == null) {
             mInitialUrl = getArguments().getString(ARG_INITIAL_URL);
@@ -130,82 +128,68 @@ public class SamlWebViewDialog extends SherlockDialogFragment {
         setStyle(SherlockDialogFragment.STYLE_NO_TITLE, R.style.Theme_ownCloud_Dialog);
     }
     
-    @Override
-    public Dialog onCreateDialog(Bundle savedInstanceState) {
-        Log_OC.d(TAG, "onCreateDialog");
-
-        /*
-        // build the dialog
-        AlertDialog.Builder builder = new AlertDialog.Builder(getSherlockActivity());
-        if (mSsoRootView.getParent() != null) {
-            ((ViewGroup)(mSsoRootView.getParent())).removeView(mSsoRootView);
-        }
-        builder.setView(mSsoRootView);
-        //builder.setView(mSsoWebView);
-        Dialog dialog = builder.create();
-        */
-        
-        return super.onCreateDialog(savedInstanceState);
-    }
-
+    @SuppressWarnings("deprecation")
     @SuppressLint("SetJavaScriptEnabled")
     @Override
     public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
-        Log_OC.d(TAG, "onCreateView");
+        Log_OC.d(TAG, "onCreateView, savedInsanceState is " + savedInstanceState);
         
         // Inflate layout of the dialog  
-        View rootView = inflater.inflate(R.layout.sso_dialog, container, false);  // null parent view because it will go in the dialog layout
-        mSsoWebView  = (WebView) rootView.findViewById(R.id.sso_webview);
-            
-        mWebViewClient.setTargetUrl(mTargetUrl);
-        mSsoWebView.setWebViewClient(mWebViewClient);
+        RelativeLayout ssoRootView = (RelativeLayout) inflater.inflate(R.layout.sso_dialog, container, false);  // null parent view because it will go in the dialog layout
         
-        if (savedInstanceState == null) {
-            Log_OC.d(TAG,  "   initWebView start");
+        if (mSsoWebView == null) {
+            // initialize the WebView
+            mSsoWebView = new SsoWebView(getSherlockActivity().getApplicationContext());
+            mSsoWebView.setFocusable(true);
+            mSsoWebView.setFocusableInTouchMode(true);
+            mSsoWebView.setClickable(true);
+            
             CookieManager cookieManager = CookieManager.getInstance();
             cookieManager.setAcceptCookie(true);
             cookieManager.removeAllCookie();
             mSsoWebView.loadUrl(mInitialUrl);
-            
-        } else {
-            Log_OC.d(TAG, "   restoreWebView start");
-            WebBackForwardList history = mSsoWebView.restoreState(savedInstanceState.getBundle(KEY_WEBVIEW_STATE));
-            if (history == null) {
-                Log_OC.e(TAG, "Error restoring WebView state ; back to starting URL");
-                mSsoWebView.loadUrl(mInitialUrl);
-            }
+          
+            WebSettings webSettings = mSsoWebView.getSettings();
+            webSettings.setJavaScriptEnabled(true);
+            webSettings.setBuiltInZoomControls(false);
+            webSettings.setLoadWithOverviewMode(false);
+            webSettings.setSavePassword(false);
+            webSettings.setUserAgentString(OwnCloudClient.USER_AGENT);
+            webSettings.setSaveFormData(false);
         }
-
-        WebSettings webSettings = mSsoWebView.getSettings();
-        webSettings.setJavaScriptEnabled(true);
-        webSettings.setBuiltInZoomControls(true);
-        webSettings.setLoadWithOverviewMode(false);
-        webSettings.setSavePassword(false);
-        webSettings.setUserAgentString(WebdavClient.USER_AGENT);
-        webSettings.setSaveFormData(false);
         
-        return rootView;
+        mWebViewClient.setTargetUrl(mTargetUrl);
+        mSsoWebView.setWebViewClient(mWebViewClient);
+        
+        // add the webview into the layout
+        RelativeLayout.LayoutParams layoutParams = new RelativeLayout.LayoutParams(
+                RelativeLayout.LayoutParams.WRAP_CONTENT, 
+                RelativeLayout.LayoutParams.WRAP_CONTENT
+                );
+        ssoRootView.addView(mSsoWebView, layoutParams);
+        ssoRootView.requestLayout();
+        
+        return ssoRootView;
     }
 
     @Override
     public void onSaveInstanceState(Bundle outState) {
-        Log_OC.d(SAML_DIALOG_TAG, "onSaveInstanceState being CALLED");
+        Log_OC.d(TAG, "onSaveInstanceState being CALLED");
         super.onSaveInstanceState(outState);
         
         // save URLs
         outState.putString(ARG_INITIAL_URL, mInitialUrl);
         outState.putString(ARG_TARGET_URL, mTargetUrl);
-        
-        // Save the state of the WebView
-        Bundle webviewState = new Bundle();
-        mSsoWebView.saveState(webviewState);
-        outState.putBundle(KEY_WEBVIEW_STATE, webviewState);
     }
 
     @Override
     public void onDestroyView() {
         Log_OC.d(TAG, "onDestroyView");
         
+        if ((ViewGroup)mSsoWebView.getParent() != null) {
+            ((ViewGroup)mSsoWebView.getParent()).removeView(mSsoWebView);
+        }
+        
         mSsoWebView.setWebViewClient(null);
         
         // Work around bug: http://code.google.com/p/android/issues/detail?id=17423
@@ -235,50 +219,52 @@ public class SamlWebViewDialog extends SherlockDialogFragment {
     
     @Override
     public void onCancel (DialogInterface dialog) {
-        Log_OC.d(SAML_DIALOG_TAG, "onCancel");
+        Log_OC.d(TAG, "onCancel");
         super.onCancel(dialog);
     }
     
     @Override
     public void onDismiss (DialogInterface dialog) {
-        Log_OC.d(SAML_DIALOG_TAG, "onDismiss");
+        Log_OC.d(TAG, "onDismiss");
         super.onDismiss(dialog);
     }
     
     @Override
     public void onStart() {
-        Log_OC.d(SAML_DIALOG_TAG, "onStart");
+        Log_OC.d(TAG, "onStart");
         super.onStart();
     }
 
     @Override
     public void onStop() {
-        Log_OC.d(SAML_DIALOG_TAG, "onStop");
+        Log_OC.d(TAG, "onStop");
         super.onStop();
     }
 
     @Override
     public void onResume() {
-        Log_OC.d(SAML_DIALOG_TAG, "onResume");
+        Log_OC.d(TAG, "onResume");
         super.onResume();
+        mSsoWebView.onResume();
     }
 
     @Override
     public void onPause() {
-        Log_OC.d(SAML_DIALOG_TAG, "onPause");
+        Log_OC.d(TAG, "onPause");
+        mSsoWebView.onPause();
         super.onPause();
     }
     
     @Override
     public int show (FragmentTransaction transaction, String tag) {
-        Log_OC.d(SAML_DIALOG_TAG, "show (transaction)");
+        Log_OC.d(TAG, "show (transaction)");
         return super.show(transaction, tag);
     }
 
     @Override
     public void show (FragmentManager manager, String tag) {
-        Log_OC.d(SAML_DIALOG_TAG, "show (manager)");
+        Log_OC.d(TAG, "show (manager)");
         super.show(manager, tag);
     }
-
+    
 }
\ No newline at end of file
diff --git a/src/com/owncloud/android/ui/dialog/ShareLinkToDialog.java b/src/com/owncloud/android/ui/dialog/ShareLinkToDialog.java
new file mode 100644 (file)
index 0000000..3076e27
--- /dev/null
@@ -0,0 +1,184 @@
+/* ownCloud Android client application
+ *   Copyright (C) 2012-2014 ownCloud Inc.
+ *
+ *   This program is free software: you can redistribute it and/or modify
+ *   it under the terms of the GNU General Public License version 2,
+ *   as published by the Free Software Foundation.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+package com.owncloud.android.ui.dialog;
+
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.Iterator;
+import java.util.List;
+
+import android.app.AlertDialog;
+import android.app.Dialog;
+import android.content.ComponentName;
+import android.content.Context;
+import android.content.DialogInterface;
+import android.content.Intent;
+import android.content.pm.ActivityInfo;
+import android.content.pm.PackageManager;
+import android.content.pm.ResolveInfo;
+import android.os.Bundle;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.ArrayAdapter;
+import android.widget.ImageView;
+import android.widget.TextView;
+
+import com.actionbarsherlock.app.SherlockDialogFragment;
+import com.owncloud.android.R;
+import com.owncloud.android.datamodel.OCFile;
+import com.owncloud.android.files.FileOperationsHelper;
+import com.owncloud.android.ui.activity.CopyToClipboardActivity;
+import com.owncloud.android.ui.activity.FileActivity;
+import com.owncloud.android.utils.Log_OC;
+
+/**
+ * Dialog showing a list activities able to resolve a given Intent, 
+ * filtering out the activities matching give package names.
+ * 
+ * @author David A. Velasco
+ */
+public class ShareLinkToDialog  extends SherlockDialogFragment {
+    
+    private final static String TAG =  ShareLinkToDialog.class.getSimpleName();
+    private final static String ARG_INTENT =  ShareLinkToDialog.class.getSimpleName() + ".ARG_INTENT";
+    private final static String ARG_PACKAGES_TO_EXCLUDE =  ShareLinkToDialog.class.getSimpleName() + ".ARG_PACKAGES_TO_EXCLUDE";
+    private final static String ARG_FILE_TO_SHARE = ShareLinkToDialog.class.getSimpleName() + ".FILE_TO_SHARE";
+    
+    private ActivityAdapter mAdapter;
+    private OCFile mFile;
+    private Intent mIntent;
+    
+    public static ShareLinkToDialog newInstance(Intent intent, String[] packagesToExclude, OCFile fileToShare) {
+        ShareLinkToDialog f = new ShareLinkToDialog();
+        Bundle args = new Bundle();
+        args.putParcelable(ARG_INTENT, intent);
+        args.putStringArray(ARG_PACKAGES_TO_EXCLUDE, packagesToExclude);
+        args.putParcelable(ARG_FILE_TO_SHARE, fileToShare);
+        f.setArguments(args);
+        return f;
+    }
+    
+    public ShareLinkToDialog() {
+        super();
+        Log_OC.d(TAG, "constructor");
+    }
+    
+    @Override
+    public Dialog onCreateDialog(Bundle savedInstanceState) {
+        mIntent = getArguments().getParcelable(ARG_INTENT);
+        String[] packagesToExclude = getArguments().getStringArray(ARG_PACKAGES_TO_EXCLUDE);
+        List<String> packagesToExcludeList = Arrays.asList(packagesToExclude != null ? packagesToExclude : new String[0]);
+        mFile = getArguments().getParcelable(ARG_FILE_TO_SHARE);
+        
+        PackageManager pm= getSherlockActivity().getPackageManager();
+        List<ResolveInfo> activities = pm.queryIntentActivities(mIntent, PackageManager.MATCH_DEFAULT_ONLY);
+        Iterator<ResolveInfo> it = activities.iterator();
+        ResolveInfo resolveInfo;
+        while (it.hasNext()) {
+            resolveInfo = it.next();
+            if (packagesToExcludeList.contains(resolveInfo.activityInfo.packageName.toLowerCase())) {
+                it.remove();
+            }
+        }
+        
+        boolean sendAction = mIntent.getBooleanExtra(Intent.ACTION_SEND, false);
+        
+        if (!sendAction) {
+            // add activity for copy to clipboard
+            Intent copyToClipboardIntent = new Intent(getSherlockActivity(), CopyToClipboardActivity.class);
+            List<ResolveInfo> copyToClipboard = pm.queryIntentActivities(copyToClipboardIntent, 0);
+            if (!copyToClipboard.isEmpty()) {
+                activities.add(copyToClipboard.get(0));
+            }
+        }
+        
+        Collections.sort(activities, new ResolveInfo.DisplayNameComparator(pm)); 
+        mAdapter = new ActivityAdapter(getSherlockActivity(), pm, activities);
+        
+        return createSelector(sendAction);
+        
+    }
+
+    private AlertDialog createSelector(final boolean sendAction) {
+    
+        int titleId;
+        if (sendAction) {
+            titleId = R.string.activity_chooser_send_file_title;
+        } else {
+            titleId = R.string.activity_chooser_title;
+        }
+        
+        return new AlertDialog.Builder(getSherlockActivity())
+                    .setTitle(titleId)
+                    .setAdapter(mAdapter, new DialogInterface.OnClickListener() {
+                        @Override
+                        public void onClick(DialogInterface dialog, int which) {
+                            // Add the information of the chosen activity to the intent to send 
+                            ResolveInfo chosen = mAdapter.getItem(which);
+                            ActivityInfo actInfo = chosen.activityInfo;
+                            ComponentName name=new ComponentName(actInfo.applicationInfo.packageName, actInfo.name);
+                            mIntent.setComponent(name);                               
+
+                            if (sendAction) {
+                                dialog.dismiss();    // explicitly added for Android 2.x devices
+
+                                // Send the file
+                                ((FileActivity)getSherlockActivity()).startActivity(mIntent);
+
+                            } else {
+                                // Create a new share resource
+                                FileOperationsHelper foh = new FileOperationsHelper();
+                                foh.shareFileWithLinkToApp(mFile, mIntent, (FileActivity)getSherlockActivity());
+                            }
+                        }
+        })
+        .create();
+    }
+    
+    class ActivityAdapter extends ArrayAdapter<ResolveInfo> {
+        
+        private PackageManager mPackageManager;
+        
+        ActivityAdapter(Context context, PackageManager pm, List<ResolveInfo> apps) {
+            super(context, R.layout.activity_row, apps);
+            this.mPackageManager = pm;
+        }
+        
+        @Override
+        public View getView(int position, View convertView, ViewGroup parent) {
+            if (convertView == null) {
+                convertView = newView(parent);
+            }
+            bindView(position, convertView);
+            return convertView;
+        }
+        
+        private View newView(ViewGroup parent) {
+            return(((LayoutInflater)getContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE)).inflate(R.layout.activity_row, parent, false));
+        }
+        
+        private void bindView(int position, View row) {
+            TextView label = (TextView) row.findViewById(R.id.title);
+            label.setText(getItem(position).loadLabel(mPackageManager));
+            ImageView icon = (ImageView) row.findViewById(R.id.icon);
+            icon.setImageDrawable(getItem(position).loadIcon(mPackageManager));
+        }
+    }
+    
+}
diff --git a/src/com/owncloud/android/ui/dialog/SslUntrustedCertDialog.java b/src/com/owncloud/android/ui/dialog/SslUntrustedCertDialog.java
new file mode 100644 (file)
index 0000000..315ed19
--- /dev/null
@@ -0,0 +1,241 @@
+/* ownCloud Android client application
+ *   Copyright (C) 2012-2014 ownCloud Inc.
+ *
+ *   This program is free software: you can redistribute it and/or modify
+ *   it under the terms of the GNU General Public License version 2,
+ *   as published by the Free Software Foundation.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+package com.owncloud.android.ui.dialog;
+
+import java.io.IOException;
+import java.security.GeneralSecurityException;
+import java.security.cert.X509Certificate;
+
+import android.app.Activity;
+import android.app.Dialog;
+import android.net.http.SslError;
+import android.os.Bundle;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+import android.view.Window;
+import android.view.View.OnClickListener;
+import android.webkit.SslErrorHandler;
+import android.widget.Button;
+
+import com.actionbarsherlock.app.SherlockDialogFragment;
+import com.owncloud.android.R;
+import com.owncloud.android.lib.common.network.CertificateCombinedException;
+import com.owncloud.android.lib.common.network.NetworkUtils;
+import com.owncloud.android.ui.adapter.CertificateCombinedExceptionViewAdapter;
+import com.owncloud.android.ui.adapter.SslCertificateViewAdapter;
+import com.owncloud.android.ui.adapter.SslErrorViewAdapter;
+import com.owncloud.android.ui.adapter.X509CertificateViewAdapter;
+import com.owncloud.android.utils.Log_OC;
+
+/**
+ * Dialog to show information about an untrusted certificate and allow the user
+ * to decide trust on it or not.
+ * 
+ * Abstract implementation of common functionality for different dialogs that
+ * get the information about the error and the certificate from different classes. 
+ * 
+ * @author masensio
+ * @author David A. Velasco
+ */
+public class SslUntrustedCertDialog extends SherlockDialogFragment {
+    
+    private final static String TAG = SslUntrustedCertDialog.class.getSimpleName();
+    
+    protected View mView = null;
+    protected SslErrorHandler mHandler = null;
+    protected X509Certificate m509Certificate = null;
+
+    private ErrorViewAdapter mErrorViewAdapter = null;
+    private CertificateViewAdapter mCertificateViewAdapter = null;
+    
+    public static SslUntrustedCertDialog newInstanceForEmptySslError(SslError error, SslErrorHandler handler) {
+        if (error == null) {
+            throw new IllegalArgumentException("Trying to create instance with parameter error == null");
+        }
+        if (handler == null) {
+            throw new IllegalArgumentException("Trying to create instance with parameter handler == null");
+        }
+        SslUntrustedCertDialog dialog = new SslUntrustedCertDialog();
+        dialog.mHandler = handler;
+        dialog.mErrorViewAdapter = new SslErrorViewAdapter(error);
+        dialog.mCertificateViewAdapter = new SslCertificateViewAdapter(error.getCertificate());
+        return dialog;
+    }
+    
+    public static SslUntrustedCertDialog newInstanceForFullSslError(CertificateCombinedException sslException) {
+        if (sslException == null) {
+            throw new IllegalArgumentException("Trying to create instance with parameter sslException == null");
+        }
+        SslUntrustedCertDialog dialog = new SslUntrustedCertDialog();
+        dialog.m509Certificate = sslException.getServerCertificate();
+        dialog.mErrorViewAdapter = new CertificateCombinedExceptionViewAdapter(sslException);
+        dialog.mCertificateViewAdapter = new X509CertificateViewAdapter(sslException.getServerCertificate());
+        return dialog;
+    }
+    
+    public static SslUntrustedCertDialog newInstanceForFullSslError(X509Certificate cert, SslError error, SslErrorHandler handler) {
+        if (cert == null) {
+            throw new IllegalArgumentException("Trying to create instance with parameter cert == null");
+        }
+        if (error == null) {
+            throw new IllegalArgumentException("Trying to create instance with parameter error == null");
+        }
+        if (handler == null) {
+            throw new IllegalArgumentException("Trying to create instance with parameter handler == null");
+        }
+        SslUntrustedCertDialog dialog = new SslUntrustedCertDialog();
+        dialog.m509Certificate = cert;
+        dialog.mHandler = handler;
+        dialog.mErrorViewAdapter = new SslErrorViewAdapter(error);
+        dialog.mCertificateViewAdapter = new X509CertificateViewAdapter(cert);
+        return dialog;
+    }
+    
+    
+    @Override
+    public void onAttach(Activity activity) {
+        Log_OC.d(TAG, "onAttach");
+        super.onAttach(activity);
+        if (!(activity instanceof OnSslUntrustedCertListener)) {
+            throw new IllegalArgumentException("The host activity must implement " + OnSslUntrustedCertListener.class.getCanonicalName());
+        }
+    }
+
+    
+    @Override
+    public void onCreate(Bundle savedInstanceState) {
+        Log_OC.d(TAG, "onCreate, savedInstanceState is " + savedInstanceState);
+        super.onCreate(savedInstanceState);
+        setRetainInstance(true);    // force to keep the state of the fragment on configuration changes (such as device rotations)
+        setCancelable(false);
+        mView = null;
+    }
+    
+    @Override
+    public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
+        Log_OC.d(TAG, "onCreateView, savedInsanceState is " + savedInstanceState);
+        // Create a view by inflating desired layout
+        if (mView == null) {
+            mView = inflater.inflate(R.layout.ssl_untrusted_cert_layout, container,  false);
+            mView.findViewById(R.id.details_scroll).setVisibility(View.GONE);
+            mErrorViewAdapter.updateErrorView(mView);
+        } else {
+            ((ViewGroup)mView.getParent()).removeView(mView);
+        }
+        
+        Button ok = (Button) mView.findViewById(R.id.ok);
+        ok.setOnClickListener(new OnCertificateTrusted());
+        
+        Button cancel = (Button) mView.findViewById(R.id.cancel);
+        cancel.setOnClickListener(new OnCertificateNotTrusted());
+        
+        Button details = (Button) mView.findViewById(R.id.details_btn);
+        details.setOnClickListener(new OnClickListener() {
+
+            @Override
+            public void onClick(View v) {
+                View detailsScroll = mView.findViewById(R.id.details_scroll);
+                if (detailsScroll.getVisibility() == View.VISIBLE) {
+                    detailsScroll.setVisibility(View.GONE);
+                    ((Button) v).setText(R.string.ssl_validator_btn_details_see);
+
+                } else {
+                    detailsScroll.setVisibility(View.VISIBLE);
+                    ((Button) v).setText(R.string.ssl_validator_btn_details_hide);
+                    mCertificateViewAdapter.updateCertificateView(mView);
+                }
+            }
+
+        });
+        
+        return mView;
+    }
+    
+
+    @Override
+    public Dialog onCreateDialog(Bundle savedInstanceState) {
+        Log_OC.d(TAG, "onCreateDialog, savedInstanceState is " + savedInstanceState);
+        final Dialog dialog = super.onCreateDialog(savedInstanceState);
+        dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
+        return dialog;
+    }
+
+    @Override
+    public void onDestroyView() {
+        Log_OC.d(TAG, "onDestroyView");
+        if (getDialog() != null && getRetainInstance())
+            getDialog().setDismissMessage(null);
+        super.onDestroyView();
+    }
+    
+    private class OnCertificateNotTrusted implements OnClickListener {
+        
+        @Override
+        public void onClick(View v) {
+            getDialog().cancel();
+            if (mHandler != null) {
+                mHandler.cancel();
+            }
+            ((OnSslUntrustedCertListener)getSherlockActivity()).onCancelCertificate();
+        }
+    }
+    
+    
+    private class OnCertificateTrusted implements OnClickListener {
+
+        @Override
+        public void onClick(View v) {
+            dismiss();
+            if (mHandler != null) {
+                mHandler.proceed();
+            }
+            if (m509Certificate != null) {
+                Activity activity = getSherlockActivity();
+                try {
+                    NetworkUtils.addCertToKnownServersStore(m509Certificate, activity);   // TODO make this asynchronously, it can take some time
+                    ((OnSslUntrustedCertListener)activity).onSavedCertificate();
+    
+                } catch (GeneralSecurityException e) {
+                    ((OnSslUntrustedCertListener)activity).onFailedSavingCertificate();
+                    Log_OC.e(TAG, "Server certificate could not be saved in the known-servers trust store ", e);
+                  
+                } catch (IOException e) {
+                    ((OnSslUntrustedCertListener)activity).onFailedSavingCertificate();
+                    Log_OC.e(TAG, "Server certificate could not be saved in the known-servers trust store ", e);
+                }
+            }
+        }
+        
+    }
+    
+    
+    public interface OnSslUntrustedCertListener {
+        public void onSavedCertificate();
+        public void onFailedSavingCertificate();
+        public void onCancelCertificate();
+    }
+    
+    public interface ErrorViewAdapter {
+        void updateErrorView(View mView);
+    }
+    
+    public interface CertificateViewAdapter {
+        void updateCertificateView(View mView);
+    }
+    
+}
index a50ecc9..0e95552 100644 (file)
@@ -39,9 +39,9 @@ import android.view.Window;
 import android.widget.Button;
 import android.widget.TextView;
 
-import com.owncloud.android.oc_framework.network.CertificateCombinedException;
-import com.owncloud.android.oc_framework.network.NetworkUtils;
-import com.owncloud.android.oc_framework.operations.RemoteOperationResult;
+import com.owncloud.android.lib.common.network.CertificateCombinedException;
+import com.owncloud.android.lib.common.network.NetworkUtils;
+import com.owncloud.android.lib.common.operations.RemoteOperationResult;
 import com.owncloud.android.utils.Log_OC;
 
 /**
@@ -223,6 +223,7 @@ public class SslValidatorDialog extends Dialog {
         return hex.toString();
      }    
 
+    @SuppressWarnings("deprecation")
     private void showValidity(Date notBefore, Date notAfter) {
         TextView fromView = ((TextView)mView.findViewById(R.id.value_validity_from));
         TextView toView = ((TextView)mView.findViewById(R.id.value_validity_to));
index e024bc6..dc8c9f6 100644 (file)
@@ -50,11 +50,11 @@ import com.owncloud.android.files.services.FileObserverService;
 import com.owncloud.android.files.services.FileUploader;
 import com.owncloud.android.files.services.FileDownloader.FileDownloaderBinder;
 import com.owncloud.android.files.services.FileUploader.FileUploaderBinder;
-import com.owncloud.android.oc_framework.network.webdav.OnDatatransferProgressListener;
-import com.owncloud.android.oc_framework.operations.OnRemoteOperationListener;
-import com.owncloud.android.oc_framework.operations.RemoteOperation;
-import com.owncloud.android.oc_framework.operations.RemoteOperationResult;
-import com.owncloud.android.oc_framework.operations.RemoteOperationResult.ResultCode;
+import com.owncloud.android.lib.common.network.OnDatatransferProgressListener;
+import com.owncloud.android.lib.common.operations.OnRemoteOperationListener;
+import com.owncloud.android.lib.common.operations.RemoteOperation;
+import com.owncloud.android.lib.common.operations.RemoteOperationResult;
+import com.owncloud.android.lib.common.operations.RemoteOperationResult.ResultCode;
 import com.owncloud.android.operations.RemoveFileOperation;
 import com.owncloud.android.operations.RenameFileOperation;
 import com.owncloud.android.operations.SynchronizeFileOperation;
@@ -186,6 +186,10 @@ public class FileDetailFragment extends FileFragment implements
         super.onActivityCreated(savedInstanceState);
         if (mAccount != null) {
             mStorageManager = new FileDataStorageManager(mAccount, getActivity().getApplicationContext().getContentResolver());
+            OCFile file = mStorageManager.getFileByPath(getFile().getRemotePath());
+            if (file != null) {
+                setFile(file);
+            }
         }
     }
         
@@ -248,6 +252,20 @@ public class FileDetailFragment extends FileFragment implements
             item.setVisible(false);
             item.setEnabled(false);
         }
+        
+        // Send file
+        item = menu.findItem(R.id.action_send_file);
+        boolean sendEnabled = getString(R.string.send_files_to_other_apps).equalsIgnoreCase("on");
+        if (item != null) {
+            if (sendEnabled) {
+                item.setVisible(true);
+                item.setEnabled(true);
+            } else {
+                item.setVisible(false);
+                item.setEnabled(false);
+                
+            }
+        }
     }
 
     
@@ -310,7 +328,14 @@ public class FileDetailFragment extends FileFragment implements
             toHide.add(R.id.action_remove_file);
             
         }
-
+        
+        // Options shareLink
+        if (!file.isShareByLink()) {
+            toHide.add(R.id.action_unshare_file);
+        } else {
+            toShow.add(R.id.action_unshare_file);
+        }
+        
         MenuItem item = null;
         for (int i : toHide) {
             item = menu.findItem(i);
@@ -335,8 +360,19 @@ public class FileDetailFragment extends FileFragment implements
     @Override
     public boolean onOptionsItemSelected(MenuItem item) {
         switch (item.getItemId()) {
+            case R.id.action_share_file: {
+                FileDisplayActivity activity = (FileDisplayActivity) getSherlockActivity();
+                activity.getFileOperationsHelper().shareFileWithLink(getFile(), activity);
+                return true;
+            }
+            case R.id.action_unshare_file: {
+                FileDisplayActivity activity = (FileDisplayActivity) getSherlockActivity();
+                activity.getFileOperationsHelper().unshareFileWithLink(getFile(), activity);
+                return true;
+            }
             case R.id.action_open_file_with: {
-                mContainerActivity.openFile(getFile());
+                FileDisplayActivity activity = (FileDisplayActivity) getSherlockActivity();
+                activity.getFileOperationsHelper().openFile(getFile(), activity);
                 return true;
             }
             case R.id.action_remove_file: {
@@ -354,11 +390,23 @@ public class FileDetailFragment extends FileFragment implements
                 synchronizeFile();
                 return true;
             }
+            case R.id.action_send_file: {
+                FileDisplayActivity activity = (FileDisplayActivity) getSherlockActivity();
+                // Obtain the file
+                if (!getFile().isDown()) {  // Download the file                    
+                    Log_OC.d(TAG, getFile().getRemotePath() + " : File must be downloaded");
+                    activity.startDownloadForSending(getFile());
+                    
+                } else {
+                    activity.getFileOperationsHelper().sendDownloadedFile(getFile(), activity);
+                }
+                return true;
+            }
             default:
                 return false;
         }
     }
-    
+
     @Override
     public void onClick(View v) {
         switch (v.getId()) {
@@ -399,7 +447,6 @@ public class FileDetailFragment extends FileFragment implements
         }
     }
 
-
     private void removeFile() {
         OCFile file = getFile();
         ConfirmationDialogFragment confDialog = ConfirmationDialogFragment.newInstance(
@@ -904,11 +951,6 @@ public class FileDetailFragment extends FileFragment implements
         }
         
         @Override
-        public void onTransferProgress(long progressRate) {
-            // old method, nothing here
-        };
-
-        @Override
         public void onTransferProgress(long progressRate, long totalTransferredSoFar, long totalToTransfer, String filename) {
             int percent = (int)(100.0*((double)totalTransferredSoFar)/((double)totalToTransfer));
             if (percent != mLastPercent) {
index b6c6574..2f1a49b 100644 (file)
@@ -21,7 +21,6 @@ import android.support.v4.app.Fragment;
 
 import com.actionbarsherlock.app.SherlockFragment;
 import com.owncloud.android.datamodel.OCFile;
-import com.owncloud.android.files.FileHandler;
 import com.owncloud.android.ui.activity.TransferServiceGetter;
 
 
@@ -73,7 +72,7 @@ public class FileFragment extends SherlockFragment {
      * 
      * @author David A. Velasco
      */
-    public interface ContainerActivity extends TransferServiceGetter, FileHandler {
+    public interface ContainerActivity extends TransferServiceGetter {
 
         /**
          * Callback method invoked when the detail fragment wants to notice its container 
@@ -95,8 +94,7 @@ public class FileFragment extends SherlockFragment {
          * @param file      File to show details
          */
         public void showDetails(OCFile file);
-        
-        
+
     }
     
 }
index c75eedb..cb37007 100644 (file)
@@ -25,11 +25,10 @@ import com.owncloud.android.R;
 import com.owncloud.android.authentication.AccountUtils;
 import com.owncloud.android.datamodel.FileDataStorageManager;
 import com.owncloud.android.datamodel.OCFile;
-import com.owncloud.android.files.FileHandler;
 import com.owncloud.android.files.services.FileDownloader.FileDownloaderBinder;
 import com.owncloud.android.files.services.FileUploader.FileUploaderBinder;
-import com.owncloud.android.oc_framework.operations.OnRemoteOperationListener;
-import com.owncloud.android.oc_framework.operations.RemoteOperation;
+import com.owncloud.android.lib.common.operations.OnRemoteOperationListener;
+import com.owncloud.android.lib.common.operations.RemoteOperation;
 import com.owncloud.android.operations.RemoveFileOperation;
 import com.owncloud.android.operations.RenameFileOperation;
 import com.owncloud.android.operations.SynchronizeFileOperation;
@@ -43,7 +42,6 @@ import com.owncloud.android.ui.preview.PreviewImageFragment;
 import com.owncloud.android.ui.preview.PreviewMediaFragment;
 import com.owncloud.android.utils.Log_OC;
 
-
 import android.accounts.Account;
 import android.app.Activity;
 import android.os.Bundle;
@@ -183,8 +181,8 @@ public class OCFileListFragment extends ExtendedListFragment implements EditName
                         // media preview
                         mContainerActivity.startMediaPreview(file, 0, true);
                     } else {
-                        // open with
-                        mContainerActivity.openFile(file);
+                        FileDisplayActivity activity = (FileDisplayActivity) getSherlockActivity();
+                        activity.getFileOperationsHelper().openFile(file, activity);
                     }
                     
                 } else {
@@ -222,6 +220,7 @@ public class OCFileListFragment extends ExtendedListFragment implements EditName
             toHide.add(R.id.action_cancel_upload);
             toHide.add(R.id.action_sync_file);
             toHide.add(R.id.action_see_details);
+            toHide.add(R.id.action_send_file);
             if (    mContainerActivity.getFileDownloaderBinder().isDownloading(AccountUtils.getCurrentOwnCloudAccount(getActivity()), targetFile) ||
                     mContainerActivity.getFileUploaderBinder().isUploading(AccountUtils.getCurrentOwnCloudAccount(getActivity()), targetFile)           ) {
                 toDisable.add(R.id.action_rename_file);
@@ -258,7 +257,18 @@ public class OCFileListFragment extends ExtendedListFragment implements EditName
                 toHide.add(R.id.action_cancel_upload);
             }
         }
+        
+        // Options shareLink
+        if (!targetFile.isShareByLink()) {
+            toHide.add(R.id.action_unshare_file);
+        }
 
+        // Send file
+        boolean sendEnabled = getString(R.string.send_files_to_other_apps).equalsIgnoreCase("on");
+        if (!sendEnabled) {
+            toHide.add(R.id.action_send_file);
+        }
+        
         for (int i : toHide) {
             item = menu.findItem(i);
             if (item != null) {
@@ -283,7 +293,17 @@ public class OCFileListFragment extends ExtendedListFragment implements EditName
     public boolean onContextItemSelected (MenuItem item) {
         AdapterContextMenuInfo info = (AdapterContextMenuInfo) item.getMenuInfo();        
         mTargetFile = (OCFile) mAdapter.getItem(info.position);
-        switch (item.getItemId()) {
+        switch (item.getItemId()) {                
+            case R.id.action_share_file: {
+                FileDisplayActivity activity = (FileDisplayActivity) getSherlockActivity();
+                activity.getFileOperationsHelper().shareFileWithLink(mTargetFile, activity);
+                return true;
+            }
+            case R.id.action_unshare_file: {
+                FileDisplayActivity activity = (FileDisplayActivity) getSherlockActivity();
+                activity.getFileOperationsHelper().unshareFileWithLink(mTargetFile, activity);
+                return true;
+            }
             case R.id.action_rename_file: {
                 String fileName = mTargetFile.getFileName();
                 int extensionStart = mTargetFile.isFolder() ? -1 : fileName.lastIndexOf(".");
@@ -345,11 +365,24 @@ public class OCFileListFragment extends ExtendedListFragment implements EditName
                 ((FileFragment.ContainerActivity)getActivity()).showDetails(mTargetFile);
                 return true;
             }
+            case R.id.action_send_file: {
+                // Obtain the file
+                if (!mTargetFile.isDown()) {  // Download the file
+                    Log_OC.d(TAG, mTargetFile.getRemotePath() + " : File must be downloaded");
+                    mContainerActivity.startDownloadForSending(mTargetFile);
+                    
+                } else {
+                
+                    FileDisplayActivity activity = (FileDisplayActivity) getSherlockActivity();
+                    activity.getFileOperationsHelper().sendDownloadedFile(mTargetFile, activity);
+                }
+                return true;
+            }
             default:
                 return super.onContextItemSelected(item); 
         }
     }
-    
+
 
     /**
      * Use this to query the {@link OCFile} that is currently
@@ -410,7 +443,7 @@ public class OCFileListFragment extends ExtendedListFragment implements EditName
      * 
      * @author David A. Velasco
      */
-    public interface ContainerActivity extends TransferServiceGetter, OnRemoteOperationListener, FileHandler {
+    public interface ContainerActivity extends TransferServiceGetter, OnRemoteOperationListener {
 
         /**
          * Callback method invoked when a the user browsed into a different folder through the list of files
@@ -418,7 +451,7 @@ public class OCFileListFragment extends ExtendedListFragment implements EditName
          * @param file
          */
         public void onBrowsedDownTo(OCFile folder);
-        
+
         public void startDownloadForPreview(OCFile file);
 
         public void startMediaPreview(OCFile file, int i, boolean b);
@@ -449,6 +482,8 @@ public class OCFileListFragment extends ExtendedListFragment implements EditName
          * @param uploading     Flag signaling if the file is now uploading.
          */
         public void onTransferStateChanged(OCFile file, boolean downloading, boolean uploading);
+
+        void startDownloadForSending(OCFile file);
         
     }
     
index c18f84b..c8fd2d2 100644 (file)
@@ -37,7 +37,7 @@ import android.widget.ImageButton;
 import android.widget.ProgressBar;
 import android.widget.TextView;
 
-import com.owncloud.android.oc_framework.network.webdav.OnDatatransferProgressListener;
+import com.owncloud.android.lib.common.network.OnDatatransferProgressListener;
 
 
 /**
@@ -353,11 +353,6 @@ public class FileDownloadFragment extends FileFragment implements OnClickListene
         }
         
         @Override
-        public void onTransferProgress(long progressRate) {
-            // old method, nothing here
-        };
-
-        @Override
         public void onTransferProgress(long progressRate, long totalTransferredSoFar, long totalToTransfer, String filename) {
             int percent = (int)(100.0*((double)totalTransferredSoFar)/((double)totalToTransfer));
             if (percent != mLastPercent) {
index edafa65..d7cc36d 100644 (file)
@@ -45,6 +45,12 @@ import com.owncloud.android.files.services.FileDownloader;
 import com.owncloud.android.files.services.FileUploader;
 import com.owncloud.android.files.services.FileDownloader.FileDownloaderBinder;
 import com.owncloud.android.files.services.FileUploader.FileUploaderBinder;
+import com.owncloud.android.lib.common.operations.OnRemoteOperationListener;
+import com.owncloud.android.lib.common.operations.RemoteOperation;
+import com.owncloud.android.lib.common.operations.RemoteOperationResult;
+import com.owncloud.android.lib.common.operations.RemoteOperationResult.ResultCode;
+import com.owncloud.android.operations.CreateShareOperation;
+import com.owncloud.android.operations.UnshareLinkOperation;
 import com.owncloud.android.ui.activity.FileActivity;
 import com.owncloud.android.ui.activity.FileDisplayActivity;
 import com.owncloud.android.ui.activity.PinCodeActivity;
@@ -59,7 +65,7 @@ import com.owncloud.android.utils.Log_OC;
  *  
  *  @author David A. Velasco
  */
-public class PreviewImageActivity extends FileActivity implements FileFragment.ContainerActivity, ViewPager.OnPageChangeListener, OnTouchListener {
+public class PreviewImageActivity extends FileActivity implements FileFragment.ContainerActivity, ViewPager.OnPageChangeListener, OnTouchListener , OnRemoteOperationListener{
     
     public static final int DIALOG_SHORT_WAIT = 0;
 
@@ -70,8 +76,6 @@ public class PreviewImageActivity extends FileActivity implements FileFragment.C
     
     private static final String DIALOG_WAIT_TAG = "DIALOG_WAIT";
     
-    private FileDataStorageManager mStorageManager;
-    
     private ViewPager mViewPager; 
     private PreviewImagePagerAdapter mPreviewImagePagerAdapter;    
     
@@ -115,13 +119,12 @@ public class PreviewImageActivity extends FileActivity implements FileFragment.C
     private void initViewPager() {
         // get parent from path
         String parentPath = getFile().getRemotePath().substring(0, getFile().getRemotePath().lastIndexOf(getFile().getFileName()));
-        OCFile parentFolder = mStorageManager.getFileByPath(parentPath);
-        //OCFile parentFolder = mStorageManager.getFileById(getFile().getParentId());
+        OCFile parentFolder = getStorageManager().getFileByPath(parentPath);
         if (parentFolder == null) {
             // should not be necessary
-            parentFolder = mStorageManager.getFileByPath(OCFile.ROOT_PATH);
+            parentFolder = getStorageManager().getFileByPath(OCFile.ROOT_PATH);
         }
-        mPreviewImagePagerAdapter = new PreviewImagePagerAdapter(getSupportFragmentManager(), parentFolder, getAccount(), mStorageManager);
+        mPreviewImagePagerAdapter = new PreviewImagePagerAdapter(getSupportFragmentManager(), parentFolder, getAccount(), getStorageManager());
         mViewPager = (ViewPager) findViewById(R.id.fragmentPager);
         int position = mPreviewImagePagerAdapter.getFilePosition(getFile());
         position = (position >= 0) ? position : 0;
@@ -150,7 +153,43 @@ public class PreviewImageActivity extends FileActivity implements FileFragment.C
         outState.putBoolean(KEY_WAITING_FOR_BINDER, mRequestWaitingForBinder);    
     }
 
-
+    @Override
+    public void onRemoteOperationFinish(RemoteOperation operation, RemoteOperationResult result) {
+        super.onRemoteOperationFinish(operation, result);
+        
+        if (operation instanceof CreateShareOperation) {
+            onCreateShareOperationFinish((CreateShareOperation) operation, result);
+            
+        } else if (operation instanceof UnshareLinkOperation) {
+            onUnshareLinkOperationFinish((UnshareLinkOperation) operation, result);
+            
+        }
+    }
+    
+    
+    private void onUnshareLinkOperationFinish(UnshareLinkOperation operation, RemoteOperationResult result) {
+        if (result.isSuccess()) {
+            OCFile file = getStorageManager().getFileByPath(getFile().getRemotePath());
+            if (file != null) {
+                setFile(file);
+            }
+            invalidateOptionsMenu();
+        } else if  (result.getCode() == ResultCode.SHARE_NOT_FOUND) {
+            backToDisplayActivity();
+        }
+            
+    }
+    
+    private void onCreateShareOperationFinish(CreateShareOperation operation, RemoteOperationResult result) {
+        if (result.isSuccess()) {
+            OCFile file = getStorageManager().getFileByPath(getFile().getRemotePath());
+            if (file != null) {
+                setFile(file);
+            }
+            invalidateOptionsMenu();
+        }
+    }
+    
     /** Defines callbacks for service binding, passed to bindService() */
     private class PreviewImageServiceConnection implements ServiceConnection {
 
@@ -206,7 +245,6 @@ public class PreviewImageActivity extends FileActivity implements FileFragment.C
         super.onDestroy();
     }
     
-    
     @Override
     public boolean onOptionsItemSelected(MenuItem item) {
         boolean returnValue = false;
@@ -385,7 +423,7 @@ public class PreviewImageActivity extends FileActivity implements FileFragment.C
             if (getAccount().name.equals(accountName) && 
                     downloadedRemotePath != null) {
 
-                OCFile file = mStorageManager.getFileByPath(downloadedRemotePath);
+                OCFile file = getStorageManager().getFileByPath(downloadedRemotePath);
                 int position = mPreviewImagePagerAdapter.getFilePosition(file);
                 boolean downloadWasFine = intent.getBooleanExtra(FileDownloader.EXTRA_DOWNLOAD_RESULT, false);
                 //boolean isOffscreen =  Math.abs((mViewPager.getCurrentItem() - position)) <= mViewPager.getOffscreenPageLimit();
@@ -433,6 +471,7 @@ public class PreviewImageActivity extends FileActivity implements FileFragment.C
 
     @Override
     protected void onAccountSet(boolean stateWasRecovered) {
+        super.onAccountSet(stateWasRecovered);
         if (getAccount() != null) {
             OCFile file = getFile();
             /// Validate handled file  (first image to preview)
@@ -442,15 +481,14 @@ public class PreviewImageActivity extends FileActivity implements FileFragment.C
             if (!file.isImage()) {
                 throw new IllegalArgumentException("Non-image file passed as argument");
             }
-            mStorageManager = new FileDataStorageManager(getAccount(), getContentResolver());            
             
             // Update file according to DB file, if it is possible
             if (file.getFileId() > FileDataStorageManager.ROOT_PARENT_ID)            
-                file = mStorageManager.getFileById(file.getFileId());
+                file = getStorageManager().getFileById(file.getFileId());
             
             if (file != null) {
                 /// Refresh the activity according to the Account and OCFile set
-                setFile(file);  // reset after getting it fresh from mStorageManager
+                setFile(file);  // reset after getting it fresh from storageManager
                 getSupportActionBar().setTitle(getFile().getFileName());
                 //if (!stateWasRecovered) {
                     initViewPager();
@@ -460,9 +498,6 @@ public class PreviewImageActivity extends FileActivity implements FileFragment.C
                 // handled file not in the current Account
                 finish();
             }
-            
-        } else {
-            Log_OC.wtf(TAG, "onAccountChanged was called with NULL account associated!");
         }
     }
     
@@ -480,5 +515,5 @@ public class PreviewImageActivity extends FileActivity implements FileFragment.C
             startActivity(i);
         }
     }
-    
+
 }
index 0ae6868..3a374e0 100644 (file)
@@ -52,11 +52,12 @@ import com.actionbarsherlock.view.MenuItem;
 import com.owncloud.android.R;
 import com.owncloud.android.datamodel.FileDataStorageManager;
 import com.owncloud.android.datamodel.OCFile;
-import com.owncloud.android.oc_framework.network.webdav.WebdavUtils;
-import com.owncloud.android.oc_framework.operations.OnRemoteOperationListener;
-import com.owncloud.android.oc_framework.operations.RemoteOperation;
-import com.owncloud.android.oc_framework.operations.RemoteOperationResult;
+import com.owncloud.android.lib.common.network.WebdavUtils;
+import com.owncloud.android.lib.common.operations.OnRemoteOperationListener;
+import com.owncloud.android.lib.common.operations.RemoteOperation;
+import com.owncloud.android.lib.common.operations.RemoteOperationResult;
 import com.owncloud.android.operations.RemoveFileOperation;
+import com.owncloud.android.ui.activity.FileActivity;
 import com.owncloud.android.ui.fragment.ConfirmationDialogFragment;
 import com.owncloud.android.ui.fragment.FileFragment;
 import com.owncloud.android.utils.Log_OC;
@@ -175,8 +176,22 @@ public class PreviewImageFragment extends FileFragment implements   OnRemoteOper
         mStorageManager = new FileDataStorageManager(mAccount, getActivity().getApplicationContext().getContentResolver());
         if (savedInstanceState != null) {
             if (!mIgnoreFirstSavedState) {
-                setFile((OCFile)savedInstanceState.getParcelable(PreviewImageFragment.EXTRA_FILE));
+                OCFile file = (OCFile)savedInstanceState.getParcelable(PreviewImageFragment.EXTRA_FILE);
                 mAccount = savedInstanceState.getParcelable(PreviewImageFragment.EXTRA_ACCOUNT);
+                
+                // Update the file
+                if (mAccount!= null) {
+                    mStorageManager = new FileDataStorageManager(mAccount, getActivity().getApplicationContext().getContentResolver());
+                    OCFile updatedFile = mStorageManager.getFileByPath(file.getRemotePath());
+                    if (updatedFile != null) {
+                        setFile(updatedFile);
+                    } else {
+                        setFile(file);
+                    }
+                } else {
+                    setFile(file);
+                }
+
             } else {
                 mIgnoreFirstSavedState = false;
             }
@@ -229,7 +244,18 @@ public class PreviewImageFragment extends FileFragment implements   OnRemoteOper
         toHide.add(R.id.action_cancel_upload);
         toHide.add(R.id.action_download_file);
         toHide.add(R.id.action_rename_file);    // by now
+        
+        // Options shareLink
+        if (!getFile().isShareByLink()) {
+            toHide.add(R.id.action_unshare_file);
+        }
 
+        // Send file
+        boolean sendEnabled = getString(R.string.send_files_to_other_apps).equalsIgnoreCase("on");
+        if (!sendEnabled) {
+            toHide.add(R.id.action_send_file);
+        }
+        
         for (int i : toHide) {
             item = menu.findItem(i);
             if (item != null) {
@@ -240,6 +266,27 @@ public class PreviewImageFragment extends FileFragment implements   OnRemoteOper
         
     }
 
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public void onPrepareOptionsMenu(Menu menu) {
+        super.onPrepareOptionsMenu(menu);
+        
+        MenuItem item = menu.findItem(R.id.action_unshare_file);
+        // Options shareLink
+        OCFile file = ((FileActivity) getSherlockActivity()).getFile();
+        if (!file.isShareByLink()) {
+            item.setVisible(false);
+            item.setEnabled(false);
+        } else {
+            item.setVisible(true);
+            item.setEnabled(true);
+        }
+            
+    }
+
+    
     
     /**
      * {@inheritDoc}
@@ -247,6 +294,16 @@ public class PreviewImageFragment extends FileFragment implements   OnRemoteOper
     @Override
     public boolean onOptionsItemSelected(MenuItem item) {
         switch (item.getItemId()) {
+            case R.id.action_share_file: {
+                FileActivity act = (FileActivity)getSherlockActivity();
+                act.getFileOperationsHelper().shareFileWithLink(getFile(), act);
+                return true;
+            }
+            case R.id.action_unshare_file: {
+                FileActivity act = (FileActivity)getSherlockActivity();
+                act.getFileOperationsHelper().unshareFileWithLink(getFile(), act);
+                return true;
+            }
             case R.id.action_open_file_with: {
                 openFile();
                 return true;
@@ -259,13 +316,18 @@ public class PreviewImageFragment extends FileFragment implements   OnRemoteOper
                 seeDetails();
                 return true;
             }
+            case R.id.action_send_file: {
+                FileActivity act = (FileActivity)getSherlockActivity();
+                act.getFileOperationsHelper().sendDownloadedFile(getFile(), act);
+                return true;
+            }
             
             default:
                 return false;
         }
     }
-
     
+
     private void seeDetails() {
         ((FileFragment.ContainerActivity)getActivity()).showDetails(getFile());        
     }
index b21f333..7fa399a 100644 (file)
@@ -57,10 +57,10 @@ import com.owncloud.android.datamodel.OCFile;
 import com.owncloud.android.media.MediaControlView;
 import com.owncloud.android.media.MediaService;
 import com.owncloud.android.media.MediaServiceBinder;
-import com.owncloud.android.oc_framework.network.webdav.WebdavUtils;
-import com.owncloud.android.oc_framework.operations.OnRemoteOperationListener;
-import com.owncloud.android.oc_framework.operations.RemoteOperation;
-import com.owncloud.android.oc_framework.operations.RemoteOperationResult;
+import com.owncloud.android.lib.common.network.WebdavUtils;
+import com.owncloud.android.lib.common.operations.OnRemoteOperationListener;
+import com.owncloud.android.lib.common.operations.RemoteOperation;
+import com.owncloud.android.lib.common.operations.RemoteOperationResult;
 import com.owncloud.android.operations.RemoveFileOperation;
 import com.owncloud.android.ui.activity.FileActivity;
 import com.owncloud.android.ui.activity.FileDisplayActivity;
@@ -289,7 +289,18 @@ public class PreviewMediaFragment extends FileFragment implements
         toHide.add(R.id.action_download_file);
         toHide.add(R.id.action_sync_file);
         toHide.add(R.id.action_rename_file);    // by now
-
+        
+        // Options shareLink
+        if (!getFile().isShareByLink()) {
+            toHide.add(R.id.action_unshare_file);
+        }
+        
+        // Send file
+        boolean sendEnabled = getString(R.string.send_files_to_other_apps).equalsIgnoreCase("on");
+        if (!sendEnabled) {
+            toHide.add(R.id.action_send_file);
+        }
+        
         for (int i : toHide) {
             item = menu.findItem(i);
             if (item != null) {
@@ -300,6 +311,25 @@ public class PreviewMediaFragment extends FileFragment implements
         
     }
 
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public void onPrepareOptionsMenu(Menu menu) {
+        super.onPrepareOptionsMenu(menu);
+        
+        MenuItem item = menu.findItem(R.id.action_unshare_file);
+        // Options shareLink
+        if (!getFile().isShareByLink()) {            
+            item.setVisible(false);
+            item.setEnabled(false);
+        } else {
+            item.setVisible(true);
+            item.setEnabled(true);
+        }
+    }
+    
     
     /**
      * {@inheritDoc}
@@ -307,6 +337,14 @@ public class PreviewMediaFragment extends FileFragment implements
     @Override
     public boolean onOptionsItemSelected(MenuItem item) {
         switch (item.getItemId()) {
+            case R.id.action_share_file: {
+                shareFileWithLink();
+                return true;
+            }
+            case R.id.action_unshare_file: {
+                unshareFileWithLink();
+                return true;
+            }
             case R.id.action_open_file_with: {
                 openFile();
                 return true;
@@ -319,13 +357,45 @@ public class PreviewMediaFragment extends FileFragment implements
                 seeDetails();
                 return true;
             }
+            case R.id.action_send_file: {
+                sendFile();
+            }
             
             default:
                 return false;
         }
     }
+    
+
 
+    /**
+     * Update the file of the fragment with file value
+     * @param file
+     */
+    public void updateFile(OCFile file){
+        setFile(file);
+    }
+    
+    private void unshareFileWithLink() {
+        stopPreview(false);
+        FileActivity activity = (FileActivity)((FileFragment.ContainerActivity)getActivity());
+        activity.getFileOperationsHelper().unshareFileWithLink(getFile(), activity);
+    }
     
+    private void shareFileWithLink() {
+        stopPreview(false);
+        FileActivity activity = (FileActivity)((FileFragment.ContainerActivity)getActivity());
+        activity.getFileOperationsHelper().shareFileWithLink(getFile(), activity);
+        
+    }
+
+    private void sendFile() {
+        stopPreview(false);
+        FileActivity activity = (FileActivity)((FileFragment.ContainerActivity)getActivity());
+        activity.getFileOperationsHelper().sendDownloadedFile(getFile(), activity);
+        
+    }
+
     private void seeDetails() {
         stopPreview(false);
         ((FileFragment.ContainerActivity)getActivity()).showDetails(getFile());        
@@ -533,17 +603,19 @@ public class PreviewMediaFragment extends FileFragment implements
 
         @Override
         public void onServiceConnected(ComponentName component, IBinder service) {
-            if (component.equals(new ComponentName(getActivity(), MediaService.class))) {
-                Log_OC.d(TAG, "Media service connected");
-                mMediaServiceBinder = (MediaServiceBinder) service;
-                if (mMediaServiceBinder != null) {
-                    prepareMediaController();
-                    playAudio();    // do not wait for the touch of nobody to play audio
-                    
-                    Log_OC.d(TAG, "Successfully bound to MediaService, MediaController ready");
-                    
-                } else {
-                    Log_OC.e(TAG, "Unexpected response from MediaService while binding");
+            if (getActivity() != null) {
+                if (component.equals(new ComponentName(getActivity(), MediaService.class))) {
+                    Log_OC.d(TAG, "Media service connected");
+                    mMediaServiceBinder = (MediaServiceBinder) service;
+                    if (mMediaServiceBinder != null) {
+                        prepareMediaController();
+                        playAudio();    // do not wait for the touch of nobody to play audio
+
+                        Log_OC.d(TAG, "Successfully bound to MediaService, MediaController ready");
+
+                    } else {
+                        Log_OC.e(TAG, "Unexpected response from MediaService while binding");
+                    }
                 }
             }
         }
index 59d9655..c674e91 100644 (file)
@@ -18,7 +18,6 @@
 package com.owncloud.android.ui.preview;
 
 import com.owncloud.android.R;
-import com.owncloud.android.datamodel.FileDataStorageManager;
 import com.owncloud.android.datamodel.OCFile;
 import com.owncloud.android.media.MediaService;
 import com.owncloud.android.ui.activity.FileActivity;
@@ -37,8 +36,8 @@ import android.os.Bundle;
 import android.widget.MediaController;
 import android.widget.VideoView;
 
-import com.owncloud.android.oc_framework.accounts.AccountUtils;
-import com.owncloud.android.oc_framework.accounts.AccountUtils.AccountNotFoundException;
+import com.owncloud.android.lib.common.accounts.AccountUtils;
+import com.owncloud.android.lib.common.accounts.AccountUtils.AccountNotFoundException;
 
 /**
  *  Activity implementing a basic video player.
@@ -60,8 +59,6 @@ public class PreviewVideoActivity extends FileActivity implements OnCompletionLi
     
     private static final String TAG = PreviewVideoActivity.class.getSimpleName();
 
-    private FileDataStorageManager mStorageManager;
-    
     private int mSavedPlaybackPosition;         // in the unit time handled by MediaPlayer.getCurrentPosition()
     private boolean mAutoplay;                  // when 'true', the playback starts immediately with the activity
     private VideoView mVideoPlayer;             // view to play the file; both performs and show the playback
@@ -191,9 +188,9 @@ public class PreviewVideoActivity extends FileActivity implements OnCompletionLi
         return true;
     }
     
-    
     @Override
     protected void onAccountSet(boolean stateWasRecovered) {
+        super.onAccountSet(stateWasRecovered);
         if (getAccount() != null) {
             OCFile file = getFile();
             /// Validate handled file  (first image to preview)
@@ -203,8 +200,7 @@ public class PreviewVideoActivity extends FileActivity implements OnCompletionLi
             if (!file.isVideo()) {
                 throw new IllegalArgumentException("Non-video file passed as argument");
             }
-            mStorageManager = new FileDataStorageManager(getAccount(), getContentResolver());
-            file = mStorageManager.getFileById(file.getFileId()); 
+            file = getStorageManager().getFileById(file.getFileId()); 
             if (file != null) {
                 if (file.isDown()) {
                     mVideoPlayer.setVideoPath(file.getStoragePath());
@@ -230,7 +226,6 @@ public class PreviewVideoActivity extends FileActivity implements OnCompletionLi
                 finish();
             }
         } else {
-            Log_OC.wtf(TAG, "onAccountChanged was called with NULL account associated!");
             finish();
         }
    }
index d4042f5..e8e8f48 100644 (file)
@@ -22,7 +22,7 @@ import java.io.File;
 import com.owncloud.android.MainApp;
 import com.owncloud.android.R;
 import com.owncloud.android.datamodel.OCFile;
-import com.owncloud.android.oc_framework.operations.RemoteFile;
+import com.owncloud.android.lib.resources.files.RemoteFile;
 
 import android.annotation.SuppressLint;
 import android.content.Context;
index 03667ff..fc6dc21 100644 (file)
@@ -18,8 +18,8 @@
 
 package com.owncloud.android.test;
 
-import com.owncloud.android.oc_framework.accounts.AccountUtils;
-import com.owncloud.android.oc_framework.utils.OwnCloudVersion;
+import com.owncloud.android.lib.common.accounts.AccountUtils;
+import com.owncloud.android.lib.resources.status.OwnCloudVersion;
 
 import android.test.AndroidTestCase;