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
, "Set As"), 200);
354 // TODO re-enable after resized images is available
355 Uri sendUri
= Uri
.parse("content://" + DiskLruImageCacheFileProvider
.AUTHORITY
+ file
.getRemotePath());
356 Intent intent
= new Intent(Intent
.ACTION_ATTACH_DATA
);
357 intent
.setDataAndType(sendUri
, file
.getMimetype());
358 intent
.putExtra("mimeType", file
.getMimetype());
359 mFileActivity
.startActivityForResult(Intent
.createChooser(intent
, "Set As"), 200);
361 // Intent sendIntent = new Intent(android.content.Intent.ACTION_SEND);
363 // sendIntent.setType(file.getMimetype());
364 //// sendIntent.putExtra(Intent.EXTRA_STREAM, Uri.parse("content://" + DiskLruImageCacheFileProvider.AUTHORITY + "/#" + file.getRemoteId() + "#" + file.getFileName()));
365 // sendIntent.putExtra(Intent.EXTRA_STREAM, Uri.parse("content://" + DiskLruImageCacheFileProvider.AUTHORITY + file.getRemotePath()));
366 // sendIntent.putExtra(Intent.ACTION_SEND, true); // Send Action
368 // // Show dialog, without the own app
369 // String[] packagesToExclude = new String[] { mFileActivity.getPackageName() };
370 // DialogFragment chooserDialog = ShareLinkToDialog.newInstance(sendIntent, packagesToExclude, file);
371 // chooserDialog.show(mFileActivity.getSupportFragmentManager(), FTAG_CHOOSER_DIALOG);
374 Log_OC
.wtf(TAG
, "Trying to send a NULL OCFile");
378 public void sendCachedImage(OCFile file
) {
380 Intent sendIntent
= new Intent(android
.content
.Intent
.ACTION_SEND
);
382 sendIntent
.setType(file
.getMimetype());
383 // sendIntent.putExtra(Intent.EXTRA_STREAM, Uri.parse("content://" + DiskLruImageCacheFileProvider.AUTHORITY + "/#" + file.getRemoteId() + "#" + file.getFileName()));
384 sendIntent
.putExtra(Intent
.EXTRA_STREAM
, Uri
.parse("content://" + DiskLruImageCacheFileProvider
.AUTHORITY
+ file
.getRemotePath()));
385 sendIntent
.putExtra(Intent
.ACTION_SEND
, true
); // Send Action
387 // Show dialog, without the own app
388 String
[] packagesToExclude
= new String
[] { mFileActivity
.getPackageName() };
389 DialogFragment chooserDialog
= ShareLinkToDialog
.newInstance(sendIntent
, packagesToExclude
, file
);
390 chooserDialog
.show(mFileActivity
.getSupportFragmentManager(), FTAG_CHOOSER_DIALOG
);
392 Log_OC
.wtf(TAG
, "Trying to send a NULL OCFile");
396 public void syncFiles(ArrayList
<OCFile
> files
) {
397 for (OCFile file
: files
) {
403 * Request the synchronization of a file or folder with the OC server, including its contents.
405 * @param file The file or folder to synchronize
407 public void syncFile(OCFile file
) {
408 if (!file
.isFolder()){
409 Intent intent
= new Intent(mFileActivity
, OperationsService
.class);
410 intent
.setAction(OperationsService
.ACTION_SYNC_FILE
);
411 intent
.putExtra(OperationsService
.EXTRA_ACCOUNT
, mFileActivity
.getAccount());
412 intent
.putExtra(OperationsService
.EXTRA_REMOTE_PATH
, file
.getRemotePath());
413 intent
.putExtra(OperationsService
.EXTRA_SYNC_FILE_CONTENTS
, true
);
414 mWaitingForOpId
= mFileActivity
.getOperationsServiceBinder().queueNewOperation(intent
);
415 mFileActivity
.showLoadingDialog(mFileActivity
.getApplicationContext().
416 getString(R
.string
.wait_a_moment
));
419 Intent intent
= new Intent(mFileActivity
, OperationsService
.class);
420 intent
.setAction(OperationsService
.ACTION_SYNC_FOLDER
);
421 intent
.putExtra(OperationsService
.EXTRA_ACCOUNT
, mFileActivity
.getAccount());
422 intent
.putExtra(OperationsService
.EXTRA_REMOTE_PATH
, file
.getRemotePath());
423 mFileActivity
.startService(intent
);
428 public void toggleFavorites(ArrayList
<OCFile
> files
, boolean isFavorite
){
429 for (OCFile file
: files
) {
430 toggleFavorite(file
, isFavorite
);
434 public void toggleFavorite(OCFile file
, boolean isFavorite
) {
435 file
.setFavorite(isFavorite
);
436 mFileActivity
.getStorageManager().saveFile(file
);
438 /// register the OCFile instance in the observer service to monitor local updates
439 Intent observedFileIntent
= FileObserverService
.makeObservedFileIntent(
442 mFileActivity
.getAccount(),
444 mFileActivity
.startService(observedFileIntent
);
446 /// immediate content synchronization
447 if (file
.isFavorite()) {
452 public void renameFile(OCFile file
, String newFilename
) {
454 Intent service
= new Intent(mFileActivity
, OperationsService
.class);
455 service
.setAction(OperationsService
.ACTION_RENAME
);
456 service
.putExtra(OperationsService
.EXTRA_ACCOUNT
, mFileActivity
.getAccount());
457 service
.putExtra(OperationsService
.EXTRA_REMOTE_PATH
, file
.getRemotePath());
458 service
.putExtra(OperationsService
.EXTRA_NEWNAME
, newFilename
);
459 mWaitingForOpId
= mFileActivity
.getOperationsServiceBinder().queueNewOperation(service
);
461 mFileActivity
.showLoadingDialog(mFileActivity
.getApplicationContext().
462 getString(R
.string
.wait_a_moment
));
466 public void removeFile(OCFile file
, boolean onlyLocalCopy
) {
468 Intent service
= new Intent(mFileActivity
, OperationsService
.class);
469 service
.setAction(OperationsService
.ACTION_REMOVE
);
470 service
.putExtra(OperationsService
.EXTRA_ACCOUNT
, mFileActivity
.getAccount());
471 service
.putExtra(OperationsService
.EXTRA_REMOTE_PATH
, file
.getRemotePath());
472 service
.putExtra(OperationsService
.EXTRA_REMOVE_ONLY_LOCAL
, onlyLocalCopy
);
473 mWaitingForOpId
= mFileActivity
.getOperationsServiceBinder().queueNewOperation(service
);
475 mFileActivity
.showLoadingDialog(mFileActivity
.getApplicationContext().
476 getString(R
.string
.wait_a_moment
));
480 public void createFolder(String remotePath
, boolean createFullPath
) {
482 Intent service
= new Intent(mFileActivity
, OperationsService
.class);
483 service
.setAction(OperationsService
.ACTION_CREATE_FOLDER
);
484 service
.putExtra(OperationsService
.EXTRA_ACCOUNT
, mFileActivity
.getAccount());
485 service
.putExtra(OperationsService
.EXTRA_REMOTE_PATH
, remotePath
);
486 service
.putExtra(OperationsService
.EXTRA_CREATE_FULL_PATH
, createFullPath
);
487 mWaitingForOpId
= mFileActivity
.getOperationsServiceBinder().queueNewOperation(service
);
489 mFileActivity
.showLoadingDialog(mFileActivity
.getApplicationContext().
490 getString(R
.string
.wait_a_moment
));
494 * Cancel the transference in downloads (files/folders) and file uploads
497 public void cancelTransference(OCFile file
) {
498 Account account
= mFileActivity
.getAccount();
499 if (file
.isFolder()) {
500 OperationsService
.OperationsServiceBinder opsBinder
=
501 mFileActivity
.getOperationsServiceBinder();
502 if (opsBinder
!= null
) {
503 opsBinder
.cancel(account
, file
);
507 // for both files and folders
508 FileDownloaderBinder downloaderBinder
= mFileActivity
.getFileDownloaderBinder();
509 if (downloaderBinder
!= null
&& downloaderBinder
.isDownloading(account
, file
)) {
510 downloaderBinder
.cancel(account
, file
);
512 FileUploaderBinder uploaderBinder
= mFileActivity
.getFileUploaderBinder();
513 if (uploaderBinder
!= null
&& uploaderBinder
.isUploading(account
, file
)) {
514 uploaderBinder
.cancel(account
, file
);
519 * Start move file operation
521 * @param newfile File where it is going to be moved
522 * @param currentFile File with the previous info
524 public void moveFile(OCFile newfile
, OCFile currentFile
) {
526 Intent service
= new Intent(mFileActivity
, OperationsService
.class);
527 service
.setAction(OperationsService
.ACTION_MOVE_FILE
);
528 service
.putExtra(OperationsService
.EXTRA_NEW_PARENT_PATH
, newfile
.getRemotePath());
529 service
.putExtra(OperationsService
.EXTRA_REMOTE_PATH
, currentFile
.getRemotePath());
530 service
.putExtra(OperationsService
.EXTRA_ACCOUNT
, mFileActivity
.getAccount());
531 mWaitingForOpId
= mFileActivity
.getOperationsServiceBinder().queueNewOperation(service
);
533 // TODO Tobi loading dialog?
534 // mFileActivity.showLoadingDialog(mFileActivity.getApplicationContext().
535 // getString(R.string.wait_a_moment));
539 * Start copy file operation
541 * @param newfile File where it is going to be moved
542 * @param currentFile File with the previous info
544 public void copyFile(OCFile newfile
, OCFile currentFile
) {
546 Intent service
= new Intent(mFileActivity
, OperationsService
.class);
547 service
.setAction(OperationsService
.ACTION_COPY_FILE
);
548 service
.putExtra(OperationsService
.EXTRA_NEW_PARENT_PATH
, newfile
.getRemotePath());
549 service
.putExtra(OperationsService
.EXTRA_REMOTE_PATH
, currentFile
.getRemotePath());
550 service
.putExtra(OperationsService
.EXTRA_ACCOUNT
, mFileActivity
.getAccount());
551 mWaitingForOpId
= mFileActivity
.getOperationsServiceBinder().queueNewOperation(service
);
553 mFileActivity
.showLoadingDialog(mFileActivity
.getApplicationContext().
554 getString(R
.string
.wait_a_moment
));
557 public long getOpIdWaitingFor() {
558 return mWaitingForOpId
;
562 public void setOpIdWaitingFor(long waitingForOpId
) {
563 mWaitingForOpId
= waitingForOpId
;
567 * @return 'True' if the server doesn't need to check forbidden characters
569 public boolean isVersionWithForbiddenCharacters() {
570 if (mFileActivity
.getAccount() != null
) {
571 OwnCloudVersion serverVersion
=
572 AccountUtils
.getServerVersion(mFileActivity
.getAccount());
573 return (serverVersion
!= null
&& serverVersion
.isVersionWithForbiddenCharacters());