Merge branch 'develop' into sni_support_based_on_network_implementation_built_in
authorDavid A. Velasco <dvelasco@solidgear.es>
Mon, 2 Dec 2013 12:44:08 +0000 (13:44 +0100)
committerDavid A. Velasco <dvelasco@solidgear.es>
Mon, 2 Dec 2013 12:44:08 +0000 (13:44 +0100)
31 files changed:
oc_framework-test-project/oc_framework-test-test/src/com/owncloud/android/oc_framework_test_project/test/DeleteFileTest.java [new file with mode: 0644]
oc_framework-test-project/oc_framework-test-test/src/com/owncloud/android/oc_framework_test_project/test/ReadFolderTest.java [new file with mode: 0644]
oc_framework-test-project/oc_framework-test-test/src/com/owncloud/android/oc_framework_test_project/test/RenameFileTest.java
oc_framework-test-project/src/com/owncloud/android/oc_framework_test_project/TestActivity.java
oc_framework/src/com/owncloud/android/oc_framework/network/BearerAuthScheme.java
oc_framework/src/com/owncloud/android/oc_framework/operations/RemoteFile.java [new file with mode: 0644]
oc_framework/src/com/owncloud/android/oc_framework/operations/RemoteOperationResult.java
oc_framework/src/com/owncloud/android/oc_framework/operations/remote/CreateRemoteFolderOperation.java
oc_framework/src/com/owncloud/android/oc_framework/operations/remote/ReadRemoteFolderOperation.java [new file with mode: 0644]
oc_framework/src/com/owncloud/android/oc_framework/operations/remote/RemoveRemoteFileOperation.java [new file with mode: 0644]
oc_framework/src/com/owncloud/android/oc_framework/operations/remote/RenameRemoteFileOperation.java
oc_framework/src/com/owncloud/android/oc_framework/utils/FileUtils.java
res/values-cs-rCZ/strings.xml
res/values-de-rDE/strings.xml
res/values-de/strings.xml
res/values-el/strings.xml
res/values-et-rEE/strings.xml
res/values-fr-rCA/strings.xml [new file with mode: 0644]
res/values-fr/strings.xml
res/values-gl/strings.xml
res/values-it/strings.xml
res/values-sl/strings.xml
res/values-sv/strings.xml
src/com/owncloud/android/datamodel/FileDataStorageManager.java
src/com/owncloud/android/operations/RemoveFileOperation.java
src/com/owncloud/android/operations/RenameFileOperation.java
src/com/owncloud/android/operations/SynchronizeFolderOperation.java
src/com/owncloud/android/ui/fragment/FileDetailFragment.java
src/com/owncloud/android/ui/preview/PreviewImageFragment.java
src/com/owncloud/android/ui/preview/PreviewMediaFragment.java
tests/src/com/owncloud/android/test/AccountUtilsTest.java

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
new file mode 100644 (file)
index 0000000..b8ab2b0
--- /dev/null
@@ -0,0 +1,57 @@
+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;
+
+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/ReadFolderTest.java b/oc_framework-test-project/oc_framework-test-test/src/com/owncloud/android/oc_framework_test_project/test/ReadFolderTest.java
new file mode 100644 (file)
index 0000000..c339915
--- /dev/null
@@ -0,0 +1,46 @@
+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());
+       }
+       
+}
index fe30550..e21c6ff 100644 (file)
@@ -6,6 +6,12 @@ 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 */
index 7687bb2..db38ea5 100644 (file)
@@ -4,6 +4,8 @@ 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.RemoteOperationResult;
 import com.owncloud.android.oc_framework.operations.remote.CreateRemoteFolderOperation;
+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 android.net.Uri;
@@ -44,8 +46,8 @@ public class TestActivity extends Activity {
 
        /**
         * Access to the library method to Create a Folder
-        * @param remotePath
-        * @param createFullPath
+        * @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
         */
@@ -75,4 +77,32 @@ public class TestActivity extends Activity {
                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;
+       }
+       
 }
index 37698d6..7d9df09 100644 (file)
@@ -1,4 +1,3 @@
-package com.owncloud.android.oc_framework.network;
 /* ownCloud Android client application
  *   Copyright (C) 2012  ownCloud Inc.
  *
@@ -17,6 +16,7 @@ package com.owncloud.android.oc_framework.network;
  */
 
 
+package com.owncloud.android.oc_framework.network;
 
 import java.util.Map;
 
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
new file mode 100644 (file)
index 0000000..07f45b7
--- /dev/null
@@ -0,0 +1,170 @@
+/* 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.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 = 7256606476031992757L;
+       
+       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;
+       }
+
+       /**
+     * 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);                
+       }
+    
+    
+}
index f26988c..666e312 100644 (file)
@@ -24,6 +24,7 @@ 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;
 
@@ -51,10 +52,8 @@ import android.util.Log;
  */
 public class RemoteOperationResult implements Serializable {
 
-    /** Generated - should be refreshed every time the class changes!! */
-    private static final long serialVersionUID = -4415103901492836870L;
-    
-
+       /** Generated - should be refreshed every time the class changes!! */
+       private static final long serialVersionUID = -2469951225222759283L;
     
     private static final String TAG = "RemoteOperationResult";
     
@@ -99,9 +98,12 @@ public class RemoteOperationResult implements Serializable {
     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) {
@@ -196,6 +198,15 @@ public class RemoteOperationResult implements Serializable {
 
     }
 
+
+    public void setData(ArrayList<RemoteFile> files){
+       mFiles = files;
+    }
+    
+       public ArrayList<RemoteFile> getData(){
+               return mFiles;
+       }
+    
     public boolean isSuccess() {
         return mSuccess;
     }
index 0974d08..4e756da 100644 (file)
@@ -1,3 +1,20 @@
+/* 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;
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
new file mode 100644 (file)
index 0000000..b0a8bd5
--- /dev/null
@@ -0,0 +1,162 @@
+/* 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
new file mode 100644 (file)
index 0000000..f083acb
--- /dev/null
@@ -0,0 +1,83 @@
+/* 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;
+       }
+
+}
index ad6fffc..b1714ae 100644 (file)
@@ -1,3 +1,20 @@
+/* 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;
index 8fb01dc..a7674e4 100644 (file)
@@ -1,3 +1,20 @@
+/* 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;
index df2dd56..f4d717f 100644 (file)
   <string name="prefs_log_summary_history">Zobrazuje zaznamenané logy</string>
   <string name="prefs_log_delete_history_button">Smazat historii</string>
   <string name="prefs_help">Nápověda</string>
+  <string name="prefs_recommend">Doporučit příteli</string>
   <string name="prefs_feedback">Odezva</string>
   <string name="prefs_imprint">Imprint</string>
+  <string name="recommend_subject">Zkusit %1$s na vašem smartphonu!</string>
+  <string name="recommend_text">Chtěl bych vás pozvat k používání %1$s na vašem smartphonu.\nKe stažení zde:  %2$s</string>
   <string name="auth_check_server">Zkontrolovat server</string>
   <string name="auth_host_url">Adresa serveru</string>
   <string name="auth_username">Uživatelské jméno</string>
@@ -92,6 +95,7 @@
   <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_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="foreign_files_fail">Některé soubory nebylo možno přesunout</string>
   <string name="media_err_unsupported">Nepodporovaný kodek</string>
   <string name="media_err_io">Multimediální soubor nelze přečíst</string>
   <string name="media_err_malformed">Multimediální soubor není správně kódován</string>
+  <string name="media_err_timeout">Příliš mnoho času bylo zkoušeno přehrání</string>
   <string name="media_err_invalid_progressive_playback">Multimediální soubor nelze proudově odesílat</string>
   <string name="media_err_unknown">Multimediální soubor nemůže být přehrán s výchozím přehrávačem</string>
   <string name="media_err_security_ex">Chyba zabezpečení při pokusu o přehrání %1$s</string>
   <string name="auth_connection_established">Spojení navázáno</string>
   <string name="auth_testing_connection">Zkouším spojení...</string>
   <string name="auth_not_configured_title">Neplatné nastavení serveru</string>
+  <string name="auth_account_not_new">Účet pro stejného uživatele a server již v zařízení existuje</string>
+  <string name="auth_account_not_the_same">Zadaný uživatel neodpovídá uživateli tohoto účtu</string>
   <string name="auth_unknown_error_title">Nastala neznámá chyba</string>
   <string name="auth_unknown_host_title">Nelze najít hostitele</string>
   <string name="auth_incorrect_path_title">Instance serveru nenalezena</string>
   <string name="auth_timeout_title">Serveru trvalo příliš dlouho odpovědět</string>
   <string name="auth_incorrect_address_title">Neplatné URL</string>
   <string name="auth_ssl_general_error_title">Inicializace SSL selhala</string>
+  <string name="auth_ssl_unverified_server_title">Nemohu ověřit SSL identitu serveru</string>
   <string name="auth_bad_oc_version_title">Nerozpoznaná verze serveru</string>
   <string name="auth_wrong_connection_title">Nemohu navázat spojení</string>
   <string name="auth_secure_connection">Zabezpečené spojení navázáno</string>
   <string name="auth_oauth_error">Neúspěšné přihlášení</string>
   <string name="auth_oauth_error_access_denied">Přístup zamítnut autorizačním serverem</string>
   <string name="auth_wtf_reenter_URL">Neočekávaný stav; prosím vložte znovu URL adresu serveru</string>
+  <string name="auth_expired_oauth_token_toast">Vaše přihlášení vypršelo. Přihlašte se, prosím, znovu</string>
   <string name="auth_expired_basic_auth_toast">Zadejte prosím aktuální heslo</string>
+  <string name="auth_expired_saml_sso_token_toast">Vaše přihlášení vypršelo. Přihlašte se, prosím, znovu</string>
+  <string name="auth_connecting_auth_server">Připojuji se k přihlašovacímu serveru...</string>
+  <string name="auth_unsupported_auth_method">Server nepodporuje tuto přihlašovací metodu.</string>
+  <string name="auth_unsupported_multiaccount">%1$s nepodporuje více účtů.</string>
   <string name="fd_keep_in_sync">Udržovat soubor aktuální</string>
   <string name="common_rename">Přejmenovat</string>
   <string name="common_remove">Odstranit</string>
   <string name="sync_file_fail_msg">Vzdálený soubor nemohl být zkontrolován</string>
   <string name="sync_file_nothing_to_do_msg">Obsah souboru je již synchronizován</string>
   <string name="create_dir_fail_msg">Adresář nelze vytvořit</string>
+  <string name="filename_forbidden_characters">Zakázané znaky: / \\ &lt; &gt; : \" | ? *</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="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="ssl_validator_reason_cert_not_trusted">- Certifikát serveru je nedůvěryhodný</string>
   <string name="preview_image_description">Náhled obrázku</string>
   <string name="preview_image_error_unknown_format">Obrázek nemůže být zobrazen</string>
   <string name="error__upload__local_file_not_copied">%1$s nelze zkopírovat do místního adresáře %2$s</string>
+  <string name="actionbar_failed_instant_upload">Selhalo Okamžité odeslání\"</string>
   <string name="failed_upload_headline_text">Selhaná okamžitá odeslání</string>
   <string name="failed_upload_headline_hint">Souhrn všech selhaných okamžitých odeslání</string>
   <string name="failed_upload_all_cb">vybrat vše</string>
index 1a8f2ca..5059746 100644 (file)
   <string name="sync_file_fail_msg">Die entfernte Datei konnte nicht überprüft werden</string>
   <string name="sync_file_nothing_to_do_msg">Dateiinhalte bereits synchronisiert</string>
   <string name="create_dir_fail_msg">Das Verzeichnis konnte nicht erstellt werden.</string>
+  <string name="filename_forbidden_characters">Verbotene Zeichen: / \\ &lt; &gt; : \" | ? *</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="preview_image_description">Bildvorschau</string>
   <string name="preview_image_error_unknown_format">Dieses Bild kann nicht angezeigt werden</string>
   <string name="error__upload__local_file_not_copied">%1$s konnte nicht in den lokalen %2$s Ordner kopiert werden</string>
+  <string name="actionbar_failed_instant_upload">Sofort-Upload fehlgeschlagen</string>
   <string name="failed_upload_headline_text">Sofortige Uploads fehlgeschlagen</string>
   <string name="failed_upload_headline_hint">Zusammenfassung aller fehlgeschlagenen Uploads</string>
   <string name="failed_upload_all_cb">Alle auswählen</string>
index 8478772..e1d851e 100644 (file)
   <string name="sync_file_fail_msg">Die entfernte Datei konnte nicht überprüft werden</string>
   <string name="sync_file_nothing_to_do_msg">Dateiinhalte bereits synchronisiert</string>
   <string name="create_dir_fail_msg">Das Verzeichnis konnte nicht erstellt werden.</string>
+  <string name="filename_forbidden_characters">Verbotene Zeichen: / \\ &lt; &gt; : \" | ? *</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="preview_image_description">Bildvorschau</string>
   <string name="preview_image_error_unknown_format">Dieses Bild kann nicht angezeigt werden</string>
   <string name="error__upload__local_file_not_copied">%1$s konnte nicht in den lokalen %2$s Ordner kopiert werden</string>
+  <string name="actionbar_failed_instant_upload">Sofort-Upload fehlgeschlagen</string>
   <string name="failed_upload_headline_text">SofortUpload fehlgeschlagen</string>
   <string name="failed_upload_headline_hint">Übersicht aller fehlgeschlagenen SofortUploads</string>
   <string name="failed_upload_all_cb">Alles auswählen</string>
index 0837a49..f747b1b 100644 (file)
@@ -2,6 +2,7 @@
 <resources>
   <string name="about_android">%1$s Εφαρμογή για Android</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="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">Διεύθυνση εξυπηρέτη</string>
   <string name="auth_username">Όνομα χρήστη</string>
@@ -74,6 +82,7 @@
   <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>
@@ -84,6 +93,8 @@
   <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="foreign_files_fail">Μερικα αρχεια δεν μπορεσαν να μετακινηθουν</string>
   <string name="pincode_stored">Το PIN της εφαρμογής αποθηκεύτηκε</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_invalid_progressive_playback">Το αρχείο πολυμέσων δεν μπορεί να μεταδοθεί</string>
+  <string name="media_err_unknown">Το αρχείο πολυμέσων δεν μπορεί να αναπαραχθεί με την παρεχόμενη εφαρμογή αναπαραγωγής πολυμέσων</string>
   <string name="media_play_pause_description">Κουμπί αναπαραγωγής ή παύσης</string>
   <string name="auth_trying_to_login">Προσπάθεια σύνδεσης...</string>
   <string name="auth_no_net_conn_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">Δεν βρέθηκε στιγμιότυπο server σας</string>
   <string name="auth_timeout_title">Ο εξυπηρετητής αργεί πολύ να απαντήσει</string>
   <string name="auth_incorrect_address_title">Κακώς διατυπωμένο URL</string>
   <string name="auth_ssl_general_error_title">Η αρχικοποίηση του SLL απέτυχε</string>
+  <string name="auth_ssl_unverified_server_title">Αδυναμία επιβεβαίωσης την ταυτότητα SSL του διακομιστή</string>
   <string name="auth_bad_oc_version_title">Μη αναγνωρίσιμη έκδοση διακομιστή server σας</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_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">Διατήρηση αρχείου ενημερωμένo</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="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="preview_image_error_unknown_format">Αυτή η εικόνε δεν μπόρεσε να προβληθεί</string>
   <string name="error__upload__local_file_not_copied">%1$s δεν μπορεσε να αντιγραφθεί στον %2$s τοπικο καταλόγο </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">Παρακαλώ ελέγξτε τις ρυθμίσεις του διακομιστή σας, ίσως έχετε υπερβεί τη διαθέσιμη μερίδα σας.</string>
 </resources>
index 41a7c31..3a07fcd 100644 (file)
   <string name="sync_file_fail_msg">Mujaloleva faili kontrollimine ebaõnnestus</string>
   <string name="sync_file_nothing_to_do_msg">Faili sisu on juba sünkroniseeritud</string>
   <string name="create_dir_fail_msg">Kausta loomine ebaõnnestus</string>
+  <string name="filename_forbidden_characters">Keelatud sümbolid:  / \\ &lt; &gt; : \" | ? *</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="preview_image_description">Pildi eelvaade</string>
   <string name="preview_image_error_unknown_format">Seda pilti ei saa näidata</string>
   <string name="error__upload__local_file_not_copied">%1$s ei suudetud kopeerida kohalikku kataloogi failina %2$s</string>
+  <string name="actionbar_failed_instant_upload">Ebaõnnestunud kohene üleslaadimine</string>
   <string name="failed_upload_headline_text">Ebaõnnestunud kohesed üleslaadimised</string>
   <string name="failed_upload_headline_hint">Kõikide ebaõnnestunud üleslaadimiste kokkuvõte</string>
   <string name="failed_upload_all_cb">vali kõik</string>
diff --git a/res/values-fr-rCA/strings.xml b/res/values-fr-rCA/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 65f0723..40d759f 100644 (file)
   <string name="sync_file_fail_msg">Le fichier distant n\'a pu être vérifié</string>
   <string name="sync_file_nothing_to_do_msg">Le contenu des fichiers est déjà synchronisé</string>
   <string name="create_dir_fail_msg">Création du répertoire impossible</string>
+  <string name="filename_forbidden_characters">Caractères interdits : / \\ &lt; &gt; : \" | ? *</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="preview_image_description">Prévisualisation de l\'image</string>
   <string name="preview_image_error_unknown_format">Cette image ne peut pas être affichée</string>
   <string name="error__upload__local_file_not_copied">%1$s n\'a pas pu être copié vers le dossier local suivant %2$s</string>
+  <string name="actionbar_failed_instant_upload">Échec du téléversement instantané</string>
   <string name="failed_upload_headline_text">Téléchargements instantanés échoués</string>
   <string name="failed_upload_headline_hint">Résumé de tous les téléchargements instantanés échoués</string>
   <string name="failed_upload_all_cb">Tous sélectionner</string>
index 2c223c3..fe9e7d0 100644 (file)
   <string name="sync_file_fail_msg">Non foi posíbel comprobar o ficheiro remoto</string>
   <string name="sync_file_nothing_to_do_msg">Os contidos do ficheiro xa están sincronizados</string>
   <string name="create_dir_fail_msg">Non foi posíbel crear o directorio</string>
+  <string name="filename_forbidden_characters">Caracteres non permitidos: / \\ &lt; &gt; : \" | ? *</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="preview_image_description">Vista previa da imaxe</string>
   <string name="preview_image_error_unknown_format">Esta imaxe non pode ser amosada</string>
   <string name="error__upload__local_file_not_copied">Non foi posíbel copiar %1$s no directorio local %2$s</string>
+  <string name="actionbar_failed_instant_upload">produciuse un fallo de EnvíoInstantáneo</string>
   <string name="failed_upload_headline_text">Envíos instantáneos fallados</string>
   <string name="failed_upload_headline_hint">Resumo de todos os envíos instantáneos fallados</string>
   <string name="failed_upload_all_cb">seleccionar todo</string>
index 58bdc13..2242f74 100644 (file)
   <string name="sync_file_fail_msg">Il file remoto non può essere controllato</string>
   <string name="sync_file_nothing_to_do_msg">Contenuti del file già sincronizzati</string>
   <string name="create_dir_fail_msg">La cartella non può essere creata</string>
+  <string name="filename_forbidden_characters">Caratteri proibiti: / \\ &lt; &gt; : \" | ? *</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="preview_image_description">Anteprima dell\'immagine</string>
   <string name="preview_image_error_unknown_format">Questa immagine non può essere mostrata</string>
   <string name="error__upload__local_file_not_copied">%1$s non può essere copiato nella cartella locale %2$s</string>
+  <string name="actionbar_failed_instant_upload">Caricamento istantaneo non riuscito</string>
   <string name="failed_upload_headline_text">Caricamenti istantanei non riusciti</string>
   <string name="failed_upload_headline_hint">Riepilogo dei caricamenti istantanei non riusciti</string>
   <string name="failed_upload_all_cb">seleziona tutto</string>
index 362a5fb..17616d6 100644 (file)
@@ -94,6 +94,7 @@
   <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="media_err_security_ex">Prišlo je do varnostne napake med predvajanjem %1$s</string>
   <string name="media_err_io_ex">Prišlo je do napake vhoda med predvajanjem %1$s</string>
   <string name="media_err_unexpected">Prišlo je do nepričakovane napake med predvajanjem %1$s</string>
+  <string name="media_rewind_description">Vrni nazaj</string>
   <string name="media_play_pause_description">Gumb za predvajanje in premor</string>
   <string name="media_forward_description">Gumb za hitro predvajanje naprej</string>
   <string name="auth_trying_to_login">Poskus prijave …</string>
   <string name="auth_testing_connection">Preizkušanje povezave ...</string>
   <string name="auth_not_configured_title">Napačno oblikovane nastavitve strežnika</string>
   <string name="auth_account_not_new">Na napravi račun za istega uporabnika in strežnik že obstaja</string>
+  <string name="auth_account_not_the_same">Vpisan uporabnik ni lastnik tega računa</string>
   <string name="auth_unknown_error_title">Prišlo je do neznane napake!</string>
   <string name="auth_unknown_host_title">Gostitelja ni mogoče najti</string>
   <string name="auth_incorrect_path_title">Primerka strežnika ni mogoče najti</string>
   <string name="auth_expired_basic_auth_toast">Vnesite trenutno geslo</string>
   <string name="auth_expired_saml_sso_token_toast">Seja je potekla. Ponovno je treba vzpostaviti povezavo.</string>
   <string name="auth_connecting_auth_server">Poteka povezovanje z overitvenim strežnikom ...</string>
+  <string name="auth_unsupported_auth_method">Strežnik ne podpira tega načina overitve</string>
   <string name="auth_unsupported_multiaccount">%1$s ne omogoča podpore več računom</string>
   <string name="fd_keep_in_sync">Datoteka naj bo posodobljena</string>
   <string name="common_rename">Preimenuj</string>
   <string name="preview_image_description">Predogled slike</string>
   <string name="preview_image_error_unknown_format">Te slike ni mogoče prikazati</string>
   <string name="error__upload__local_file_not_copied">Datoteke %1$s ni mogoče kopirati v krajevno mapo %2$s.</string>
+  <string name="actionbar_failed_instant_upload">Spodletelo takojšnje pošiljanje</string>
+  <string name="failed_upload_headline_text">Spodletela takojšnja pošiljanja</string>
+  <string name="failed_upload_headline_hint">Povzetek vseh spodletelih takojšnjih pošiljanj</string>
   <string name="failed_upload_all_cb">izberi vse</string>
   <string name="failed_upload_headline_retryall_btn">vse izbrane poskusi znova</string>
+  <string name="failed_upload_headline_delete_all_btn">izbriši izbrane iz vrste za pošiljanje</string>
+  <string name="failed_upload_retry_text">poskusi poslati sliko:</string>
   <string name="failed_upload_load_more_images">Naloži več slik</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>
 </resources>
index f527133..9b4a136 100644 (file)
   <string name="sync_file_fail_msg">Fjärrfilen kunde inte kontrolleras</string>
   <string name="sync_file_nothing_to_do_msg">Filinnehåll redan synkroniserat</string>
   <string name="create_dir_fail_msg">Mapp kunde inte skapas</string>
+  <string name="filename_forbidden_characters">Förbjudna tecken är: / \\ &lt; &gt; : \" | ? *</string>
   <string name="wait_a_moment">Var god vänta</string>
   <string name="filedisplay_unexpected_bad_get_content">Oväntat problem; prova annat program för aktuell fil</string>
   <string name="filedisplay_no_file_selected">Ingen fil vald</string>
   <string name="preview_image_description">Förhandsvisa bild</string>
   <string name="preview_image_error_unknown_format">Denna bild kan inte visas</string>
   <string name="error__upload__local_file_not_copied">%1$s kunde inte kopieras till %2$s lokal mapp</string>
+  <string name="actionbar_failed_instant_upload">Fel vid direktuppladdning\"</string>
   <string name="failed_upload_headline_text">Misslyckades vid direktuppladdning</string>
   <string name="failed_upload_headline_hint">Sammanfattning av alla misslyckade uppladdningar</string>
   <string name="failed_upload_all_cb">välj alla</string>
index fb55e93..042709a 100644 (file)
@@ -434,7 +434,7 @@ public class FileDataStorageManager {
                     }
                     updateFolderSize(file.getParentId());
                 }
-                if (removeLocalCopy && file.isDown()) {
+                if (removeLocalCopy && file.isDown() && file.getStoragePath() != null) {
                     boolean success = new File(file.getStoragePath()).delete();
                     if (!removeDBData && success) {
                         // maybe unnecessary, but should be checked TODO remove if unnecessary
index 34926af..0ab8ac3 100644 (file)
 
 package com.owncloud.android.operations;
 
-import org.apache.commons.httpclient.HttpStatus;
-import org.apache.jackrabbit.webdav.client.methods.DeleteMethod;
-
 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.network.webdav.WebdavUtils;
-import com.owncloud.android.utils.Log_OC;
+import com.owncloud.android.oc_framework.operations.RemoteOperationResult.ResultCode;
+import com.owncloud.android.oc_framework.operations.remote.RemoveRemoteFileOperation;
 
 
 /**
@@ -36,10 +33,7 @@ import com.owncloud.android.utils.Log_OC;
  */
 public class RemoveFileOperation extends RemoteOperation {
     
-    private static final String TAG = RemoveFileOperation.class.getSimpleName();
-
-    private static final int REMOVE_READ_TIMEOUT = 10000;
-    private static final int REMOVE_CONNECTION_TIMEOUT = 5000;
+    // private static final String TAG = RemoveFileOperation.class.getSimpleName();
     
     OCFile mFileToRemove;
     boolean mDeleteLocalCopy;
@@ -69,7 +63,6 @@ public class RemoveFileOperation extends RemoteOperation {
         return mFileToRemove;
     }
     
-    
     /**
      * Performs the remove operation
      * 
@@ -78,25 +71,14 @@ public class RemoveFileOperation extends RemoteOperation {
     @Override
     protected RemoteOperationResult run(WebdavClient client) {
         RemoteOperationResult result = null;
-        DeleteMethod delete = null;
-        try {
-            delete = new DeleteMethod(client.getBaseUri() + WebdavUtils.encodePath(mFileToRemove.getRemotePath()));
-            int status = client.executeMethod(delete, REMOVE_READ_TIMEOUT, REMOVE_CONNECTION_TIMEOUT);
-            if (delete.succeeded() || status == HttpStatus.SC_NOT_FOUND) {
-                mDataStorageManager.removeFile(mFileToRemove, true, mDeleteLocalCopy);
-            }
-            delete.getResponseBodyAsString();   // exhaust the response, although not interesting
-            result = new RemoteOperationResult((delete.succeeded() || status == HttpStatus.SC_NOT_FOUND), status, delete.getResponseHeaders());
-            Log_OC.i(TAG, "Remove " + mFileToRemove.getRemotePath() + ": " + result.getLogMessage());
-            
-        } catch (Exception e) {
-            result = new RemoteOperationResult(e);
-            Log_OC.e(TAG, "Remove " + mFileToRemove.getRemotePath() + ": " + result.getLogMessage(), e);
-            
-        } finally {
-            if (delete != null)
-                delete.releaseConnection();
+        
+        RemoveRemoteFileOperation operation = new RemoveRemoteFileOperation(mFileToRemove.getRemotePath());
+        result = operation.execute(client);
+        
+        if (result.isSuccess() || result.getCode() == ResultCode.FILE_NOT_FOUND) {
+            mDataStorageManager.removeFile(mFileToRemove, true, mDeleteLocalCopy);
         }
+        
         return result;
     }
     
index 9aa573a..be6cdcc 100644 (file)
@@ -20,7 +20,6 @@ package com.owncloud.android.operations;
 import java.io.File;
 import java.io.IOException;
 
-import org.apache.commons.httpclient.HttpException;
 import com.owncloud.android.datamodel.FileDataStorageManager;
 import com.owncloud.android.datamodel.OCFile;
 import com.owncloud.android.oc_framework.network.webdav.WebdavClient;
index 780fd42..e93736c 100644 (file)
@@ -23,6 +23,7 @@ import java.io.FileOutputStream;
 import java.io.IOException;
 import java.io.InputStream;
 import java.io.OutputStream;
+import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
@@ -30,7 +31,6 @@ import java.util.Vector;
 
 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.accounts.Account;
@@ -45,6 +45,8 @@ 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.operations.remote.ReadRemoteFolderOperation;
+import com.owncloud.android.oc_framework.operations.RemoteFile;
 import com.owncloud.android.syncadapter.FileSyncService;
 import com.owncloud.android.utils.FileStorageUtils;
 import com.owncloud.android.utils.Log_OC;
@@ -241,59 +243,25 @@ public class SynchronizeFolderOperation extends RemoteOperation {
 
 
     private RemoteOperationResult fetchAndSyncRemoteFolder(WebdavClient client) {
-        RemoteOperationResult result = null;
-        String remotePath = null;
-        PropFindMethod query = null;
-        try {
-            remotePath = mLocalFolder.getRemotePath();
-            Log_OC.d(TAG, "Synchronizing " + mAccount.name + remotePath);
-
-            // remote request 
-            query = new PropFindMethod(client.getBaseUri() + WebdavUtils.encodePath(remotePath),
-                    DavConstants.PROPFIND_ALL_PROP,
-                    DavConstants.DEPTH_1);
-            int status = client.executeMethod(query);
-
-            // check and process response
-            if (isMultiStatus(status)) {
-                synchronizeData(query.getResponseBodyAsMultiStatus(), client);
-                if (mConflictsFound > 0  || mFailsInFavouritesFound > 0) { 
-                    result = new RemoteOperationResult(ResultCode.SYNC_CONFLICT);   // should be different result, but will do the job
-                } else {
-                    result = new RemoteOperationResult(true, status, query.getResponseHeaders());
-                }
-                
-            } else {
-                // synchronization failed
-                client.exhaustResponse(query.getResponseBodyAsStream());
-                if (status == HttpStatus.SC_NOT_FOUND) {
-                    removeLocalFolder();
-                }
-                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_OC.i(TAG, "Synchronized " + mAccount.name + remotePath + ": " + result.getLogMessage());
-            } else {
-                if (result.isException()) {
-                    Log_OC.e(TAG, "Synchronized " + mAccount.name + remotePath  + ": " + result.getLogMessage(), result.getException());
-                } else {
-                    Log_OC.e(TAG, "Synchronized " + mAccount.name + remotePath + ": " + result.getLogMessage());
-                }
+        String remotePath = mLocalFolder.getRemotePath();
+        ReadRemoteFolderOperation operation = new ReadRemoteFolderOperation(remotePath);
+        RemoteOperationResult result = operation.execute(client);
+        Log_OC.d(TAG, "Synchronizing " + mAccount.name + remotePath);
+        
+        if (result.isSuccess()) {
+            synchronizeData(result.getData(), client);
+            if (mConflictsFound > 0  || mFailsInFavouritesFound > 0) { 
+                result = new RemoteOperationResult(ResultCode.SYNC_CONFLICT);   // should be different result, but will do the job
             }
-            
+        } else {
+            if (result.getCode() == ResultCode.FILE_NOT_FOUND)
+                removeLocalFolder();
         }
+        
         return result;
     }
 
-
+    
     private void removeLocalFolder() {
         if (mStorageManager.fileExists(mLocalFolder.getFileId())) {
             String currentSavePath = FileStorageUtils.getSavePath(mAccount.name);
@@ -307,26 +275,25 @@ public class SynchronizeFolderOperation extends RemoteOperation {
      *  with the current data in the local database.
      *  
      *  Grants that mChildren is updated with fresh data after execution.
-     * 
-     *  @param dataInServer     Full response got from the server with the data of the target 
-     *                          folder and its direct children.
+     *  
+     *  @param folderAndFiles   Remote folder and children files in Folder 
+     *  
      *  @param client           Client instance to the remote server where the data were 
      *                          retrieved.  
      *  @return                 'True' when any change was made in the local data, 'false' otherwise.
      */
-    private void synchronizeData(MultiStatus dataInServer, WebdavClient client) {
+    private void synchronizeData(ArrayList<RemoteFile> folderAndFiles, WebdavClient client) {
         // get 'fresh data' from the database
         mLocalFolder = mStorageManager.getFileByPath(mLocalFolder.getRemotePath());
         
         // parse data from remote folder 
-        WebdavEntry we = new WebdavEntry(dataInServer.getResponses()[0], client.getBaseUri().getPath());
-        OCFile remoteFolder = fillOCFile(we);
+        OCFile remoteFolder = fillOCFile(folderAndFiles.get(0));
         remoteFolder.setParentId(mLocalFolder.getParentId());
         remoteFolder.setFileId(mLocalFolder.getFileId());
         
         Log_OC.d(TAG, "Remote folder " + mLocalFolder.getRemotePath() + " changed - starting update of local data ");
         
-        List<OCFile> updatedFiles = new Vector<OCFile>(dataInServer.getResponses().length - 1);
+        List<OCFile> updatedFiles = new Vector<OCFile>(folderAndFiles.size() - 1);
         List<SynchronizeFileOperation> filesToSyncContents = new Vector<SynchronizeFileOperation>();
 
         // get current data about local contents of the folder to synchronize
@@ -338,10 +305,9 @@ public class SynchronizeFolderOperation extends RemoteOperation {
         
         // loop to update every child
         OCFile remoteFile = null, localFile = null;
-        for (int i = 1; i < dataInServer.getResponses().length; ++i) {
+        for (int i=1; i<folderAndFiles.size(); i++) {
             /// new OCFile instance with the data from the server
-            we = new WebdavEntry(dataInServer.getResponses()[i], client.getBaseUri().getPath());                        
-            remoteFile = fillOCFile(we);
+            remoteFile = fillOCFile(folderAndFiles.get(i));
             remoteFile.setParentId(mLocalFolder.getFileId());
 
             /// retrieve local data for the read file 
@@ -432,7 +398,7 @@ public class SynchronizeFolderOperation extends RemoteOperation {
         return (status == HttpStatus.SC_MULTI_STATUS); 
     }
 
-
+    
     /**
      * Creates and populates a new {@link OCFile} object with the data read from the server.
      * 
@@ -448,6 +414,22 @@ public class SynchronizeFolderOperation extends RemoteOperation {
         file.setEtag(we.etag());
         return file;
     }
+
+    /**
+     * Creates and populates a new {@link OCFile} object with the data read from the server.
+     * 
+     * @param remote    remote file read from the server (remote file or folder).
+     * @return          New OCFile instance representing the remote resource described by we.
+     */
+    private OCFile fillOCFile(RemoteFile remote) {
+        OCFile file = new OCFile(remote.getRemotePath());
+        file.setCreationTimestamp(remote.getCreationTimestamp());
+        file.setFileLength(remote.getLength());
+        file.setMimetype(remote.getMimeType());
+        file.setModificationTimestamp(remote.getModifiedTimestamp());
+        file.setEtag(remote.getEtag());
+        return file;
+    }
     
 
     /**
index ea0f814..e024bc6 100644 (file)
@@ -473,12 +473,10 @@ public class FileDetailFragment extends FileFragment implements
     
     @Override
     public void onNeutral(String callerTag) {
-        File f = null;
         OCFile file = getFile();
-        if (file.isDown() && (f = new File(file.getStoragePath())).exists()) {
-            f.delete();
+        mStorageManager.removeFile(file, false, true);    // TODO perform in background task / new thread
+        if (file.getStoragePath() != null) {
             file.setStoragePath(null);
-            mStorageManager.saveFile(file);
             updateFileDetails(file, mAccount);
         }
     }
index ebc17c6..0ae6868 100644 (file)
@@ -16,7 +16,6 @@
  */
 package com.owncloud.android.ui.preview;
 
-import java.io.File;
 import java.lang.ref.WeakReference;
 import java.util.ArrayList;
 import java.util.List;
@@ -388,15 +387,9 @@ public class PreviewImageFragment extends FileFragment implements   OnRemoteOper
      */
     @Override
     public void onNeutral(String callerTag) {
-        // TODO this code should be made in a secondary thread,
         OCFile file = getFile();
-        if (file.isDown()) {   // checks it is still there
-            File f = new File(file.getStoragePath());
-            f.delete();
-            file.setStoragePath(null);
-            mStorageManager.saveFile(file);
-            finish();
-        }
+        mStorageManager.removeFile(file, false, true);    // TODO perform in background task / new thread
+        finish();
     }
     
     /**
index 0cce76a..b21f333 100644 (file)
@@ -16,7 +16,6 @@
  */
 package com.owncloud.android.ui.preview;
 
-import java.io.File;
 import java.util.ArrayList;
 import java.util.List;
 
@@ -672,16 +671,10 @@ public class PreviewMediaFragment extends FileFragment implements
      */
     @Override
     public void onNeutral(String callerTag) {
-        // TODO this code should be made in a secondary thread,
         OCFile file = getFile();
-        if (file.isDown()) {   // checks it is still there
-            stopPreview(true);
-            File f = new File(file.getStoragePath());
-            f.delete();
-            file.setStoragePath(null);
-            mStorageManager.saveFile(file);
-            finish();
-        }
+        stopPreview(true);
+        mStorageManager.removeFile(file, false, true);    // TODO perform in background task / new thread
+        finish();
     }
     
     /**
index 1524d3b..03667ff 100644 (file)
 
 package com.owncloud.android.test;
 
-import android.test.AndroidTestCase;
-
 import com.owncloud.android.oc_framework.accounts.AccountUtils;
 import com.owncloud.android.oc_framework.utils.OwnCloudVersion;
 
+import android.test.AndroidTestCase;
+
+
 public class AccountUtilsTest extends AndroidTestCase {
     
     public void testGetWebdavPathAndOCVersion() {