2 * ownCloud Android client application
5 * @author David A. Velasco
6 * Copyright (C) 2015 ownCloud Inc.
8 * This program is free software: you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2,
10 * as published by the Free Software Foundation.
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with this program. If not, see <http://www.gnu.org/licenses/>.
22 package com
.owncloud
.android
.files
;
24 import android
.accounts
.Account
;
25 import android
.content
.ActivityNotFoundException
;
26 import android
.content
.Context
;
27 import android
.content
.Intent
;
28 import android
.graphics
.Bitmap
;
29 import android
.content
.pm
.PackageManager
;
30 import android
.content
.pm
.ResolveInfo
;
31 import android
.graphics
.Bitmap
;
32 import android
.net
.Uri
;
33 import android
.support
.v4
.app
.DialogFragment
;
34 import android
.webkit
.MimeTypeMap
;
35 import android
.widget
.Toast
;
37 import com
.owncloud
.android
.MainApp
;
38 import com
.owncloud
.android
.R
;
39 import com
.owncloud
.android
.authentication
.AccountUtils
;
40 import com
.owncloud
.android
.datamodel
.OCFile
;
41 import com
.owncloud
.android
.datamodel
.ThumbnailsCacheManager
;
42 import com
.owncloud
.android
.files
.services
.FileDownloader
.FileDownloaderBinder
;
43 import com
.owncloud
.android
.files
.services
.FileUploader
.FileUploaderBinder
;
44 import com
.owncloud
.android
.lib
.common
.network
.WebdavUtils
;
45 import com
.owncloud
.android
.lib
.common
.utils
.Log_OC
;
46 import com
.owncloud
.android
.lib
.resources
.shares
.ShareType
;
47 import com
.owncloud
.android
.lib
.resources
.status
.OwnCloudVersion
;
48 import com
.owncloud
.android
.services
.OperationsService
;
49 import com
.owncloud
.android
.services
.observer
.FileObserverService
;
50 import com
.owncloud
.android
.ui
.activity
.FileActivity
;
51 import com
.owncloud
.android
.ui
.adapter
.DiskLruImageCacheFileProvider
;
52 import com
.owncloud
.android
.ui
.activity
.ShareActivity
;
53 import com
.owncloud
.android
.ui
.dialog
.ShareLinkToDialog
;
55 import org
.apache
.http
.protocol
.HTTP
;
58 import java
.util
.List
;
60 import java
.io
.ByteArrayOutputStream
;
62 import java
.io
.FileNotFoundException
;
63 import java
.io
.FileOutputStream
;
64 import java
.io
.IOException
;
66 import org
.apache
.http
.protocol
.HTTP
;
68 import java
.util
.ArrayList
;
69 import java
.util
.List
;
74 public class FileOperationsHelper
{
76 private static final String TAG
= FileOperationsHelper
.class.getName();
78 private static final String FTAG_CHOOSER_DIALOG
= "CHOOSER_DIALOG";
80 protected FileActivity mFileActivity
= null
;
82 /// Identifier of operation in progress which result shouldn't be lost
83 private long mWaitingForOpId
= Long
.MAX_VALUE
;
85 public FileOperationsHelper(FileActivity fileActivity
) {
86 mFileActivity
= fileActivity
;
90 public void openFile(OCFile file
) {
92 String storagePath
= file
.getStoragePath();
93 String encodedStoragePath
= WebdavUtils
.encodePath(storagePath
);
95 Intent intentForSavedMimeType
= new Intent(Intent
.ACTION_VIEW
);
96 intentForSavedMimeType
.setDataAndType(Uri
.parse("file://"+ encodedStoragePath
),
98 intentForSavedMimeType
.setFlags(
99 Intent
.FLAG_GRANT_READ_URI_PERMISSION
| Intent
.FLAG_GRANT_WRITE_URI_PERMISSION
102 Intent intentForGuessedMimeType
= null
;
103 if (storagePath
.lastIndexOf('.') >= 0) {
104 String guessedMimeType
= MimeTypeMap
.getSingleton().getMimeTypeFromExtension(
105 storagePath
.substring(storagePath
.lastIndexOf('.') + 1)
107 if (guessedMimeType
!= null
&& !guessedMimeType
.equals(file
.getMimetype())) {
108 intentForGuessedMimeType
= new Intent(Intent
.ACTION_VIEW
);
109 intentForGuessedMimeType
.
110 setDataAndType(Uri
.parse("file://"+ encodedStoragePath
),
112 intentForGuessedMimeType
.setFlags(
113 Intent
.FLAG_GRANT_READ_URI_PERMISSION
|
114 Intent
.FLAG_GRANT_WRITE_URI_PERMISSION
119 Intent openFileWithIntent
;
120 if (intentForGuessedMimeType
!= null
) {
121 openFileWithIntent
= intentForGuessedMimeType
;
123 openFileWithIntent
= intentForSavedMimeType
;
126 List
<ResolveInfo
> launchables
= mFileActivity
.getPackageManager().
127 queryIntentActivities(openFileWithIntent
, PackageManager
.GET_INTENT_FILTERS
);
129 if(launchables
!= null
&& launchables
.size() > 0) {
131 mFileActivity
.startActivity(
132 Intent
.createChooser(
133 openFileWithIntent
, mFileActivity
.getString(R
.string
.actionbar_open_with
)
136 } catch (ActivityNotFoundException anfe
) {
137 showNoAppForFileTypeToast(mFileActivity
.getApplicationContext());
140 showNoAppForFileTypeToast(mFileActivity
.getApplicationContext());
144 Log_OC
.wtf(TAG
, "Trying to open a NULL OCFile");
149 * Displays a toast stating that no application could be found to open the file.
151 * @param context the context to be able to show a toast.
153 private void showNoAppForFileTypeToast(Context context
) {
154 Toast
.makeText(context
,
155 R
.string
.file_list_no_app_for_file_type
, Toast
.LENGTH_SHORT
)
159 public void shareFileWithLink(OCFile file
) {
161 if (isSharedSupported()) {
163 String link
= "https://fake.url";
164 Intent intent
= createShareWithLinkIntent(link
);
165 String
[] packagesToExclude
= new String
[]{mFileActivity
.getPackageName()};
166 DialogFragment chooserDialog
= ShareLinkToDialog
.newInstance(intent
,
167 packagesToExclude
, file
);
168 chooserDialog
.show(mFileActivity
.getSupportFragmentManager(), FTAG_CHOOSER_DIALOG
);
171 Log_OC
.wtf(TAG
, "Trying to share a NULL OCFile");
176 Toast t
= Toast
.makeText(
177 mFileActivity
, mFileActivity
.getString(R
.string
.share_link_no_support_share_api
),
185 public void shareFileWithLinkToApp(OCFile file
, String password
, Intent sendIntent
) {
188 mFileActivity
.showLoadingDialog(mFileActivity
.getApplicationContext().
189 getString(R
.string
.wait_a_moment
));
191 Intent service
= new Intent(mFileActivity
, OperationsService
.class);
192 service
.setAction(OperationsService
.ACTION_CREATE_SHARE_VIA_LINK
);
193 service
.putExtra(OperationsService
.EXTRA_ACCOUNT
, mFileActivity
.getAccount());
194 service
.putExtra(OperationsService
.EXTRA_REMOTE_PATH
, file
.getRemotePath());
195 service
.putExtra(OperationsService
.EXTRA_PASSWORD_SHARE
, password
);
196 service
.putExtra(OperationsService
.EXTRA_SEND_INTENT
, sendIntent
);
197 mWaitingForOpId
= mFileActivity
.getOperationsServiceBinder().queueNewOperation(service
);
200 Log_OC
.wtf(TAG
, "Trying to open a NULL OCFile");
205 private Intent
createShareWithLinkIntent(String link
) {
206 Intent intentToShareLink
= new Intent(Intent
.ACTION_SEND
);
207 intentToShareLink
.putExtra(Intent
.EXTRA_TEXT
, link
);
208 intentToShareLink
.setType(HTTP
.PLAIN_TEXT_TYPE
);
209 return intentToShareLink
;
214 * Helper method to share a file with a know sharee. Starts a request to do it in {@link OperationsService}
216 * @param file The file to share.
217 * @param shareeName Name (user name or group name) of the target sharee.
218 * @param shareType The share type determines the sharee type.
220 public void shareFileWithSharee(OCFile file
, String shareeName
, ShareType shareType
) {
222 // TODO check capability?
223 mFileActivity
.showLoadingDialog(mFileActivity
.getApplicationContext().
224 getString(R
.string
.wait_a_moment
));
226 Intent service
= new Intent(mFileActivity
, OperationsService
.class);
227 service
.setAction(OperationsService
.ACTION_CREATE_SHARE_WITH_SHAREE
);
228 service
.putExtra(OperationsService
.EXTRA_ACCOUNT
, mFileActivity
.getAccount());
229 service
.putExtra(OperationsService
.EXTRA_REMOTE_PATH
, file
.getRemotePath());
230 service
.putExtra(OperationsService
.EXTRA_SHARE_WITH
, shareeName
);
231 service
.putExtra(OperationsService
.EXTRA_SHARE_TYPE
, shareType
);
232 mWaitingForOpId
= mFileActivity
.getOperationsServiceBinder().queueNewOperation(service
);
235 Log_OC
.wtf(TAG
, "Trying to share a NULL OCFile");
241 * @return 'True' if the server supports the Share API
243 public boolean isSharedSupported() {
244 if (mFileActivity
.getAccount() != null
) {
245 OwnCloudVersion serverVersion
= AccountUtils
.getServerVersion(mFileActivity
.getAccount());
246 return (serverVersion
!= null
&& serverVersion
.isSharedSupported());
252 public void unshareFileWithLink(OCFile file
) {
254 // Unshare the file: Create the intent
255 Intent unshareService
= new Intent(mFileActivity
, OperationsService
.class);
256 unshareService
.setAction(OperationsService
.ACTION_UNSHARE
);
257 unshareService
.putExtra(OperationsService
.EXTRA_ACCOUNT
, mFileActivity
.getAccount());
258 unshareService
.putExtra(OperationsService
.EXTRA_REMOTE_PATH
, file
.getRemotePath());
259 unshareService
.putExtra(OperationsService
.EXTRA_SHARE_TYPE
, ShareType
.PUBLIC_LINK
);
260 unshareService
.putExtra(OperationsService
.EXTRA_SHARE_WITH
, "");
262 unshareFile(unshareService
);
265 public void unshareFileWithUserOrGroup(OCFile file
, ShareType shareType
, String userOrGroup
){
267 // Unshare the file: Create the intent
268 Intent unshareService
= new Intent(mFileActivity
, OperationsService
.class);
269 unshareService
.setAction(OperationsService
.ACTION_UNSHARE
);
270 unshareService
.putExtra(OperationsService
.EXTRA_ACCOUNT
, mFileActivity
.getAccount());
271 unshareService
.putExtra(OperationsService
.EXTRA_REMOTE_PATH
, file
.getRemotePath());
272 unshareService
.putExtra(OperationsService
.EXTRA_SHARE_TYPE
, shareType
);
273 unshareService
.putExtra(OperationsService
.EXTRA_SHARE_WITH
, userOrGroup
);
275 unshareFile(unshareService
);
279 private void unshareFile(Intent unshareService
){
280 if (isSharedSupported()) {
282 mWaitingForOpId
= mFileActivity
.getOperationsServiceBinder().
283 queueNewOperation(unshareService
);
285 mFileActivity
.showLoadingDialog(mFileActivity
.getApplicationContext().
286 getString(R
.string
.wait_a_moment
));
290 Toast t
= Toast
.makeText(mFileActivity
,
291 mFileActivity
.getString(R
.string
.share_link_no_support_share_api
),
299 * Show an instance of {@link ShareType} for sharing or unsharing the {@OCFile} received as parameter.
301 * @param file File to share or unshare.
303 public void showShareFile(OCFile file
){
304 Intent intent
= new Intent(mFileActivity
, ShareActivity
.class);
305 intent
.putExtra(mFileActivity
.EXTRA_FILE
, file
);
306 intent
.putExtra(mFileActivity
.EXTRA_ACCOUNT
, mFileActivity
.getAccount());
307 mFileActivity
.startActivity(intent
);
313 * @return 'True' if the server supports the Search Users API
315 public boolean isSearchUsersSupportedSupported() {
316 if (mFileActivity
.getAccount() != null
) {
317 OwnCloudVersion serverVersion
= AccountUtils
.getServerVersion(mFileActivity
.getAccount());
318 return (serverVersion
!= null
&& serverVersion
.isSearchUsersSupported());
323 public void sendDownloadedFile(OCFile file
) {
325 String storagePath
= file
.getStoragePath();
326 String encodedStoragePath
= WebdavUtils
.encodePath(storagePath
);
327 Intent sendIntent
= new Intent(android
.content
.Intent
.ACTION_SEND
);
329 sendIntent
.setType(file
.getMimetype());
330 sendIntent
.putExtra(Intent
.EXTRA_STREAM
, Uri
.parse("file://" + encodedStoragePath
));
331 sendIntent
.putExtra(Intent
.ACTION_SEND
, true
); // Send Action
333 // Show dialog, without the own app
334 String
[] packagesToExclude
= new String
[]{mFileActivity
.getPackageName()};
335 DialogFragment chooserDialog
= ShareLinkToDialog
.newInstance(sendIntent
,
336 packagesToExclude
, file
);
337 chooserDialog
.show(mFileActivity
.getSupportFragmentManager(), FTAG_CHOOSER_DIALOG
);
340 Log_OC
.wtf(TAG
, "Trying to send a NULL OCFile");
344 public void setPictureAs(OCFile file
) {
347 File externalFile
= new File(file
.getStoragePath());
348 Uri sendUri
= Uri
.fromFile(externalFile
);
349 Intent intent
= new Intent(Intent
.ACTION_ATTACH_DATA
);
350 intent
.setDataAndType(sendUri
, file
.getMimetype());
351 intent
.putExtra("mimeType", file
.getMimetype());
352 mFileActivity
.startActivityForResult(Intent
.createChooser(intent
,
353 mFileActivity
.getString(R
.string
.set_as
)), 200);
355 // TODO re-enable after resized images is available
356 Uri sendUri
= Uri
.parse("content://" + DiskLruImageCacheFileProvider
.AUTHORITY
+ file
.getRemotePath());
357 Intent intent
= new Intent(Intent
.ACTION_ATTACH_DATA
);
358 intent
.setDataAndType(sendUri
, file
.getMimetype());
359 intent
.putExtra("mimeType", file
.getMimetype());
360 mFileActivity
.startActivityForResult(Intent
.createChooser(intent
, "Set As"), 200);
362 // Intent sendIntent = new Intent(android.content.Intent.ACTION_SEND);
364 // sendIntent.setType(file.getMimetype());
365 //// sendIntent.putExtra(Intent.EXTRA_STREAM, Uri.parse("content://" + DiskLruImageCacheFileProvider.AUTHORITY + "/#" + file.getRemoteId() + "#" + file.getFileName()));
366 // sendIntent.putExtra(Intent.EXTRA_STREAM, Uri.parse("content://" + DiskLruImageCacheFileProvider.AUTHORITY + file.getRemotePath()));
367 // sendIntent.putExtra(Intent.ACTION_SEND, true); // Send Action
369 // // Show dialog, without the own app
370 // String[] packagesToExclude = new String[] { mFileActivity.getPackageName() };
371 // DialogFragment chooserDialog = ShareLinkToDialog.newInstance(sendIntent, packagesToExclude, file);
372 // chooserDialog.show(mFileActivity.getSupportFragmentManager(), FTAG_CHOOSER_DIALOG);
375 Log_OC
.wtf(TAG
, "Trying to send a NULL OCFile");
379 public void sendCachedImage(OCFile file
) {
381 Intent sendIntent
= new Intent(android
.content
.Intent
.ACTION_SEND
);
383 sendIntent
.setType(file
.getMimetype());
384 // sendIntent.putExtra(Intent.EXTRA_STREAM, Uri.parse("content://" + DiskLruImageCacheFileProvider.AUTHORITY + "/#" + file.getRemoteId() + "#" + file.getFileName()));
385 sendIntent
.putExtra(Intent
.EXTRA_STREAM
, Uri
.parse("content://" + DiskLruImageCacheFileProvider
.AUTHORITY
+ file
.getRemotePath()));
386 sendIntent
.putExtra(Intent
.ACTION_SEND
, true
); // Send Action
388 // Show dialog, without the own app
389 String
[] packagesToExclude
= new String
[] { mFileActivity
.getPackageName() };
390 DialogFragment chooserDialog
= ShareLinkToDialog
.newInstance(sendIntent
, packagesToExclude
, file
);
391 chooserDialog
.show(mFileActivity
.getSupportFragmentManager(), FTAG_CHOOSER_DIALOG
);
393 Log_OC
.wtf(TAG
, "Trying to send a NULL OCFile");
397 public void syncFiles(ArrayList
<OCFile
> files
) {
398 for (OCFile file
: files
) {
404 * Request the synchronization of a file or folder with the OC server, including its contents.
406 * @param file The file or folder to synchronize
408 public void syncFile(OCFile file
) {
409 if (!file
.isFolder()){
410 Intent intent
= new Intent(mFileActivity
, OperationsService
.class);
411 intent
.setAction(OperationsService
.ACTION_SYNC_FILE
);
412 intent
.putExtra(OperationsService
.EXTRA_ACCOUNT
, mFileActivity
.getAccount());
413 intent
.putExtra(OperationsService
.EXTRA_REMOTE_PATH
, file
.getRemotePath());
414 intent
.putExtra(OperationsService
.EXTRA_SYNC_FILE_CONTENTS
, true
);
415 mWaitingForOpId
= mFileActivity
.getOperationsServiceBinder().queueNewOperation(intent
);
416 mFileActivity
.showLoadingDialog(mFileActivity
.getApplicationContext().
417 getString(R
.string
.wait_a_moment
));
420 Intent intent
= new Intent(mFileActivity
, OperationsService
.class);
421 intent
.setAction(OperationsService
.ACTION_SYNC_FOLDER
);
422 intent
.putExtra(OperationsService
.EXTRA_ACCOUNT
, mFileActivity
.getAccount());
423 intent
.putExtra(OperationsService
.EXTRA_REMOTE_PATH
, file
.getRemotePath());
424 mFileActivity
.startService(intent
);
429 public void toggleFavorites(ArrayList
<OCFile
> files
, boolean isFavorite
){
430 for (OCFile file
: files
) {
431 toggleFavorite(file
, isFavorite
);
435 public void toggleFavorite(OCFile file
, boolean isFavorite
) {
436 file
.setFavorite(isFavorite
);
437 mFileActivity
.getStorageManager().saveFile(file
);
439 /// register the OCFile instance in the observer service to monitor local updates
440 Intent observedFileIntent
= FileObserverService
.makeObservedFileIntent(
443 mFileActivity
.getAccount(),
445 mFileActivity
.startService(observedFileIntent
);
447 /// immediate content synchronization
448 if (file
.isFavorite()) {
453 public void renameFile(OCFile file
, String newFilename
) {
455 Intent service
= new Intent(mFileActivity
, OperationsService
.class);
456 service
.setAction(OperationsService
.ACTION_RENAME
);
457 service
.putExtra(OperationsService
.EXTRA_ACCOUNT
, mFileActivity
.getAccount());
458 service
.putExtra(OperationsService
.EXTRA_REMOTE_PATH
, file
.getRemotePath());
459 service
.putExtra(OperationsService
.EXTRA_NEWNAME
, newFilename
);
460 mWaitingForOpId
= mFileActivity
.getOperationsServiceBinder().queueNewOperation(service
);
462 mFileActivity
.showLoadingDialog(mFileActivity
.getApplicationContext().
463 getString(R
.string
.wait_a_moment
));
467 public void removeFile(OCFile file
, boolean onlyLocalCopy
) {
469 Intent service
= new Intent(mFileActivity
, OperationsService
.class);
470 service
.setAction(OperationsService
.ACTION_REMOVE
);
471 service
.putExtra(OperationsService
.EXTRA_ACCOUNT
, mFileActivity
.getAccount());
472 service
.putExtra(OperationsService
.EXTRA_REMOTE_PATH
, file
.getRemotePath());
473 service
.putExtra(OperationsService
.EXTRA_REMOVE_ONLY_LOCAL
, onlyLocalCopy
);
474 mWaitingForOpId
= mFileActivity
.getOperationsServiceBinder().queueNewOperation(service
);
476 mFileActivity
.showLoadingDialog(mFileActivity
.getApplicationContext().
477 getString(R
.string
.wait_a_moment
));
481 public void createFolder(String remotePath
, boolean createFullPath
) {
483 Intent service
= new Intent(mFileActivity
, OperationsService
.class);
484 service
.setAction(OperationsService
.ACTION_CREATE_FOLDER
);
485 service
.putExtra(OperationsService
.EXTRA_ACCOUNT
, mFileActivity
.getAccount());
486 service
.putExtra(OperationsService
.EXTRA_REMOTE_PATH
, remotePath
);
487 service
.putExtra(OperationsService
.EXTRA_CREATE_FULL_PATH
, createFullPath
);
488 mWaitingForOpId
= mFileActivity
.getOperationsServiceBinder().queueNewOperation(service
);
490 mFileActivity
.showLoadingDialog(mFileActivity
.getApplicationContext().
491 getString(R
.string
.wait_a_moment
));
495 * Cancel the transference in downloads (files/folders) and file uploads
498 public void cancelTransference(OCFile file
) {
499 Account account
= mFileActivity
.getAccount();
500 if (file
.isFolder()) {
501 OperationsService
.OperationsServiceBinder opsBinder
=
502 mFileActivity
.getOperationsServiceBinder();
503 if (opsBinder
!= null
) {
504 opsBinder
.cancel(account
, file
);
508 // for both files and folders
509 FileDownloaderBinder downloaderBinder
= mFileActivity
.getFileDownloaderBinder();
510 if (downloaderBinder
!= null
&& downloaderBinder
.isDownloading(account
, file
)) {
511 downloaderBinder
.cancel(account
, file
);
513 FileUploaderBinder uploaderBinder
= mFileActivity
.getFileUploaderBinder();
514 if (uploaderBinder
!= null
&& uploaderBinder
.isUploading(account
, file
)) {
515 uploaderBinder
.cancel(account
, file
);
520 * Start move file operation
522 * @param newfile File where it is going to be moved
523 * @param currentFile File with the previous info
525 public void moveFile(OCFile newfile
, OCFile currentFile
) {
527 Intent service
= new Intent(mFileActivity
, OperationsService
.class);
528 service
.setAction(OperationsService
.ACTION_MOVE_FILE
);
529 service
.putExtra(OperationsService
.EXTRA_NEW_PARENT_PATH
, newfile
.getRemotePath());
530 service
.putExtra(OperationsService
.EXTRA_REMOTE_PATH
, currentFile
.getRemotePath());
531 service
.putExtra(OperationsService
.EXTRA_ACCOUNT
, mFileActivity
.getAccount());
532 mWaitingForOpId
= mFileActivity
.getOperationsServiceBinder().queueNewOperation(service
);
534 // TODO Tobi loading dialog?
535 // mFileActivity.showLoadingDialog(mFileActivity.getApplicationContext().
536 // getString(R.string.wait_a_moment));
540 * Start copy file operation
542 * @param newfile File where it is going to be moved
543 * @param currentFile File with the previous info
545 public void copyFile(OCFile newfile
, OCFile currentFile
) {
547 Intent service
= new Intent(mFileActivity
, OperationsService
.class);
548 service
.setAction(OperationsService
.ACTION_COPY_FILE
);
549 service
.putExtra(OperationsService
.EXTRA_NEW_PARENT_PATH
, newfile
.getRemotePath());
550 service
.putExtra(OperationsService
.EXTRA_REMOTE_PATH
, currentFile
.getRemotePath());
551 service
.putExtra(OperationsService
.EXTRA_ACCOUNT
, mFileActivity
.getAccount());
552 mWaitingForOpId
= mFileActivity
.getOperationsServiceBinder().queueNewOperation(service
);
554 mFileActivity
.showLoadingDialog(mFileActivity
.getApplicationContext().
555 getString(R
.string
.wait_a_moment
));
558 public long getOpIdWaitingFor() {
559 return mWaitingForOpId
;
563 public void setOpIdWaitingFor(long waitingForOpId
) {
564 mWaitingForOpId
= waitingForOpId
;
568 * @return 'True' if the server doesn't need to check forbidden characters
570 public boolean isVersionWithForbiddenCharacters() {
571 if (mFileActivity
.getAccount() != null
) {
572 OwnCloudVersion serverVersion
=
573 AccountUtils
.getServerVersion(mFileActivity
.getAccount());
574 return (serverVersion
!= null
&& serverVersion
.isVersionWithForbiddenCharacters());