FolderPickerActivity.java 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605
  1. /*
  2. * ownCloud Android client application
  3. *
  4. * Copyright (C) 2016 ownCloud Inc.
  5. *
  6. * This program is free software: you can redistribute it and/or modify
  7. * it under the terms of the GNU General Public License version 2,
  8. * as published by the Free Software Foundation.
  9. *
  10. * This program is distributed in the hope that it will be useful,
  11. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. * GNU General Public License for more details.
  14. *
  15. * You should have received a copy of the GNU General Public License
  16. * along with this program. If not, see <http://www.gnu.org/licenses/>.
  17. *
  18. */
  19. package com.owncloud.android.ui.activity;
  20. import android.accounts.Account;
  21. import android.accounts.AuthenticatorException;
  22. import android.app.Activity;
  23. import android.content.BroadcastReceiver;
  24. import android.content.Context;
  25. import android.content.Intent;
  26. import android.content.IntentFilter;
  27. import android.content.res.Resources.NotFoundException;
  28. import android.graphics.PorterDuff;
  29. import android.graphics.drawable.Drawable;
  30. import android.os.Bundle;
  31. import android.os.Parcelable;
  32. import android.util.Log;
  33. import android.view.Menu;
  34. import android.view.MenuInflater;
  35. import android.view.MenuItem;
  36. import android.view.View;
  37. import android.view.View.OnClickListener;
  38. import android.widget.Button;
  39. import com.nextcloud.client.di.Injectable;
  40. import com.nextcloud.client.preferences.AppPreferences;
  41. import com.owncloud.android.R;
  42. import com.owncloud.android.datamodel.OCFile;
  43. import com.owncloud.android.lib.common.operations.RemoteOperation;
  44. import com.owncloud.android.lib.common.operations.RemoteOperationResult;
  45. import com.owncloud.android.lib.common.operations.RemoteOperationResult.ResultCode;
  46. import com.owncloud.android.lib.common.utils.Log_OC;
  47. import com.owncloud.android.operations.CreateFolderOperation;
  48. import com.owncloud.android.operations.RefreshFolderOperation;
  49. import com.owncloud.android.syncadapter.FileSyncAdapter;
  50. import com.owncloud.android.ui.dialog.CreateFolderDialogFragment;
  51. import com.owncloud.android.ui.dialog.SortingOrderDialogFragment;
  52. import com.owncloud.android.ui.fragment.FileFragment;
  53. import com.owncloud.android.ui.fragment.OCFileListFragment;
  54. import com.owncloud.android.utils.DataHolderUtil;
  55. import com.owncloud.android.utils.DisplayUtils;
  56. import com.owncloud.android.utils.ErrorMessageAdapter;
  57. import com.owncloud.android.utils.ThemeUtils;
  58. import java.util.ArrayList;
  59. import javax.inject.Inject;
  60. import androidx.appcompat.app.ActionBar;
  61. import androidx.fragment.app.Fragment;
  62. import androidx.fragment.app.FragmentManager;
  63. import androidx.fragment.app.FragmentTransaction;
  64. public class FolderPickerActivity extends FileActivity implements FileFragment.ContainerActivity,
  65. OnClickListener, OnEnforceableRefreshListener, Injectable {
  66. public static final String EXTRA_FOLDER = FolderPickerActivity.class.getCanonicalName() + ".EXTRA_FOLDER";
  67. public static final String EXTRA_FILES = FolderPickerActivity.class.getCanonicalName() + ".EXTRA_FILES";
  68. public static final String EXTRA_ACTION = FolderPickerActivity.class.getCanonicalName() + ".EXTRA_ACTION";
  69. public static final String EXTRA_CURRENT_FOLDER = FolderPickerActivity.class.getCanonicalName() +
  70. ".EXTRA_CURRENT_FOLDER";
  71. public static final String MOVE = "MOVE";
  72. public static final String COPY = "COPY";
  73. private SyncBroadcastReceiver mSyncBroadcastReceiver;
  74. private static final String TAG = FolderPickerActivity.class.getSimpleName();
  75. protected static final String TAG_LIST_OF_FOLDERS = "LIST_OF_FOLDERS";
  76. private boolean mSyncInProgress;
  77. private boolean mSearchOnlyFolders;
  78. private boolean mDoNotEnterEncryptedFolder;
  79. protected Button mCancelBtn;
  80. protected Button mChooseBtn;
  81. private String caption;
  82. @Inject AppPreferences preferences;
  83. @Override
  84. protected void onCreate(Bundle savedInstanceState) {
  85. Log_OC.d(TAG, "onCreate() start");
  86. super.onCreate(savedInstanceState);
  87. if (this instanceof FilePickerActivity) {
  88. setContentView(R.layout.files_picker);
  89. } else {
  90. setContentView(R.layout.files_folder_picker);
  91. }
  92. // sets callback listeners for UI elements
  93. initControls();
  94. // Action bar setup
  95. setupToolbar();
  96. if (getIntent().getStringExtra(EXTRA_ACTION) != null) {
  97. switch (getIntent().getStringExtra(EXTRA_ACTION)) {
  98. case MOVE:
  99. caption = getResources().getText(R.string.move_to).toString();
  100. mSearchOnlyFolders = true;
  101. mDoNotEnterEncryptedFolder = true;
  102. break;
  103. case COPY:
  104. caption = getResources().getText(R.string.copy_to).toString();
  105. mSearchOnlyFolders = true;
  106. mDoNotEnterEncryptedFolder = true;
  107. break;
  108. default:
  109. caption = ThemeUtils.getDefaultDisplayNameForRootFolder(this);
  110. break;
  111. }
  112. } else {
  113. caption = ThemeUtils.getDefaultDisplayNameForRootFolder(this);
  114. }
  115. if (getIntent().getParcelableExtra(EXTRA_CURRENT_FOLDER) != null) {
  116. setFile(getIntent().getParcelableExtra(EXTRA_CURRENT_FOLDER));
  117. }
  118. if (savedInstanceState == null) {
  119. createFragments();
  120. }
  121. if (getSupportActionBar() != null) {
  122. getSupportActionBar().setDisplayShowTitleEnabled(true);
  123. ThemeUtils.setColoredTitle(getSupportActionBar(), caption, this);
  124. }
  125. setIndeterminate(mSyncInProgress);
  126. // always AFTER setContentView(...) ; to work around bug in its implementation
  127. // sets message for empty list of folders
  128. setBackgroundText();
  129. Log_OC.d(TAG, "onCreate() end");
  130. }
  131. @Override
  132. protected void onStart() {
  133. super.onStart();
  134. }
  135. /**
  136. * Called when the ownCloud {@link Account} associated to the Activity was just updated.
  137. */
  138. @Override
  139. protected void onAccountSet(boolean stateWasRecovered) {
  140. super.onAccountSet(stateWasRecovered);
  141. if (getAccount() != null) {
  142. updateFileFromDB();
  143. OCFile folder = getFile();
  144. if (folder == null || !folder.isFolder()) {
  145. // fall back to root folder
  146. setFile(getStorageManager().getFileByPath(OCFile.ROOT_PATH));
  147. folder = getFile();
  148. }
  149. if (!stateWasRecovered) {
  150. OCFileListFragment listOfFolders = getListOfFilesFragment();
  151. listOfFolders.listDirectory(folder, false, false);
  152. startSyncFolderOperation(folder, false);
  153. }
  154. updateNavigationElementsInActionBar();
  155. }
  156. }
  157. private Activity getActivity() {
  158. return this;
  159. }
  160. protected void createFragments() {
  161. OCFileListFragment listOfFiles = new OCFileListFragment();
  162. Bundle args = new Bundle();
  163. args.putBoolean(OCFileListFragment.ARG_ONLY_FOLDERS_CLICKABLE, true);
  164. args.putBoolean(OCFileListFragment.ARG_HIDE_FAB, true);
  165. args.putBoolean(OCFileListFragment.ARG_HIDE_ITEM_OPTIONS, true);
  166. args.putBoolean(OCFileListFragment.ARG_SEARCH_ONLY_FOLDER, mSearchOnlyFolders);
  167. listOfFiles.setArguments(args);
  168. FragmentTransaction transaction = getSupportFragmentManager().beginTransaction();
  169. transaction.add(R.id.fragment_container, listOfFiles, TAG_LIST_OF_FOLDERS);
  170. transaction.commit();
  171. }
  172. /**
  173. * Show a text message on screen view for notifying user if content is
  174. * loading or folder is empty
  175. */
  176. private void setBackgroundText() {
  177. OCFileListFragment listFragment = getListOfFilesFragment();
  178. if (listFragment != null) {
  179. if (!mSyncInProgress) {
  180. listFragment.setMessageForEmptyList(
  181. R.string.file_list_empty_headline,
  182. R.string.file_list_empty_moving,
  183. R.drawable.ic_list_empty_create_folder,
  184. true
  185. );
  186. } else {
  187. listFragment.setEmptyListLoadingMessage();
  188. }
  189. } else {
  190. Log.e(TAG, "OCFileListFragment is null");
  191. }
  192. }
  193. protected OCFileListFragment getListOfFilesFragment() {
  194. Fragment listOfFiles = getSupportFragmentManager().findFragmentByTag(FolderPickerActivity.TAG_LIST_OF_FOLDERS);
  195. if (listOfFiles != null) {
  196. return (OCFileListFragment) listOfFiles;
  197. }
  198. Log_OC.e(TAG, "Access to non existing list of files fragment!!");
  199. return null;
  200. }
  201. /**
  202. * {@inheritDoc}
  203. * <p>
  204. * Updates action bar and second fragment, if in dual pane mode.
  205. */
  206. @Override
  207. public void onBrowsedDownTo(OCFile directory) {
  208. setFile(directory);
  209. updateNavigationElementsInActionBar();
  210. // Sync Folder
  211. startSyncFolderOperation(directory, false);
  212. }
  213. @Override
  214. public void onSavedCertificate() {
  215. startSyncFolderOperation(getCurrentDir(), false);
  216. }
  217. public void startSyncFolderOperation(OCFile folder, boolean ignoreETag) {
  218. long currentSyncTime = System.currentTimeMillis();
  219. mSyncInProgress = true;
  220. // perform folder synchronization
  221. RemoteOperation refreshFolderOperation = new RefreshFolderOperation(folder, currentSyncTime, false,
  222. ignoreETag, getStorageManager(), getAccount(), getApplicationContext());
  223. refreshFolderOperation.execute(getAccount(), this, null, null);
  224. setIndeterminate(true);
  225. setBackgroundText();
  226. }
  227. @Override
  228. protected void onResume() {
  229. super.onResume();
  230. Log_OC.e(TAG, "onResume() start");
  231. // refresh list of files
  232. refreshListOfFilesFragment(false);
  233. // Listen for sync messages
  234. IntentFilter syncIntentFilter = new IntentFilter(FileSyncAdapter.EVENT_FULL_SYNC_START);
  235. syncIntentFilter.addAction(FileSyncAdapter.EVENT_FULL_SYNC_END);
  236. syncIntentFilter.addAction(FileSyncAdapter.EVENT_FULL_SYNC_FOLDER_CONTENTS_SYNCED);
  237. syncIntentFilter.addAction(RefreshFolderOperation.EVENT_SINGLE_FOLDER_CONTENTS_SYNCED);
  238. syncIntentFilter.addAction(RefreshFolderOperation.EVENT_SINGLE_FOLDER_SHARES_SYNCED);
  239. mSyncBroadcastReceiver = new SyncBroadcastReceiver();
  240. registerReceiver(mSyncBroadcastReceiver, syncIntentFilter);
  241. Log_OC.d(TAG, "onResume() end");
  242. }
  243. @Override
  244. protected void onPause() {
  245. Log_OC.e(TAG, "onPause() start");
  246. if (mSyncBroadcastReceiver != null) {
  247. unregisterReceiver(mSyncBroadcastReceiver);
  248. //LocalBroadcastManager.getInstance(this).unregisterReceiver(mSyncBroadcastReceiver);
  249. mSyncBroadcastReceiver = null;
  250. }
  251. Log_OC.d(TAG, "onPause() end");
  252. super.onPause();
  253. }
  254. @Override
  255. public boolean onCreateOptionsMenu(Menu menu) {
  256. MenuInflater inflater = getMenuInflater();
  257. inflater.inflate(R.menu.main_menu, menu);
  258. menu.findItem(R.id.action_switch_view).setVisible(false);
  259. menu.findItem(R.id.action_sync_account).setVisible(false);
  260. menu.findItem(R.id.action_select_all).setVisible(false);
  261. // menu.findItem(R.id.action_sort).setVisible(false);
  262. return true;
  263. }
  264. @Override
  265. public boolean onOptionsItemSelected(MenuItem item) {
  266. boolean retval = true;
  267. switch (item.getItemId()) {
  268. case R.id.action_create_dir: {
  269. CreateFolderDialogFragment dialog = CreateFolderDialogFragment.newInstance(getCurrentFolder());
  270. dialog.show(getSupportFragmentManager(), CreateFolderDialogFragment.CREATE_FOLDER_FRAGMENT);
  271. break;
  272. }
  273. case android.R.id.home: {
  274. OCFile currentDir = getCurrentFolder();
  275. if (currentDir != null && currentDir.getParentId() != 0) {
  276. onBackPressed();
  277. }
  278. break;
  279. }
  280. case R.id.action_sort: {
  281. FragmentManager fm = getSupportFragmentManager();
  282. FragmentTransaction ft = fm.beginTransaction();
  283. ft.addToBackStack(null);
  284. SortingOrderDialogFragment mSortingOrderDialogFragment = SortingOrderDialogFragment.newInstance(
  285. preferences.getSortOrderByFolder(getListOfFilesFragment().getCurrentFile()));
  286. mSortingOrderDialogFragment.show(ft, SortingOrderDialogFragment.SORTING_ORDER_FRAGMENT);
  287. break;
  288. }
  289. default:
  290. retval = super.onOptionsItemSelected(item);
  291. break;
  292. }
  293. return retval;
  294. }
  295. protected OCFile getCurrentFolder() {
  296. OCFile file = getFile();
  297. if (file != null) {
  298. if (file.isFolder()) {
  299. return file;
  300. } else if (getStorageManager() != null) {
  301. String parentPath = file.getRemotePath().substring(0, file.getRemotePath().lastIndexOf(file.getFileName()));
  302. return getStorageManager().getFileByPath(parentPath);
  303. }
  304. }
  305. return null;
  306. }
  307. public void refreshListOfFilesFragment(boolean fromSearch) {
  308. OCFileListFragment fileListFragment = getListOfFilesFragment();
  309. if (fileListFragment != null) {
  310. fileListFragment.listDirectory(false, fromSearch);
  311. }
  312. }
  313. public void browseToRoot() {
  314. OCFileListFragment listOfFiles = getListOfFilesFragment();
  315. if (listOfFiles != null) { // should never be null, indeed
  316. OCFile root = getStorageManager().getFileByPath(OCFile.ROOT_PATH);
  317. listOfFiles.listDirectory(root, false, false);
  318. setFile(listOfFiles.getCurrentFile());
  319. updateNavigationElementsInActionBar();
  320. startSyncFolderOperation(root, false);
  321. }
  322. }
  323. @Override
  324. public void onBackPressed() {
  325. OCFileListFragment listOfFiles = getListOfFilesFragment();
  326. if (listOfFiles != null) { // should never be null, indeed
  327. int levelsUp = listOfFiles.onBrowseUp();
  328. if (levelsUp == 0) {
  329. finish();
  330. return;
  331. }
  332. setFile(listOfFiles.getCurrentFile());
  333. updateNavigationElementsInActionBar();
  334. }
  335. }
  336. protected void updateNavigationElementsInActionBar() {
  337. OCFile currentDir = getCurrentFolder();
  338. ActionBar actionBar = getSupportActionBar();
  339. if (actionBar != null) {
  340. boolean atRoot = currentDir == null || currentDir.getParentId() == 0;
  341. actionBar.setDisplayHomeAsUpEnabled(!atRoot);
  342. actionBar.setHomeButtonEnabled(!atRoot);
  343. Drawable backArrow = getResources().getDrawable(R.drawable.ic_arrow_back);
  344. actionBar.setHomeAsUpIndicator(ThemeUtils.tintDrawable(backArrow, ThemeUtils.fontColor(this)));
  345. ThemeUtils.setColoredTitle(getSupportActionBar(), atRoot ? caption : currentDir.getFileName(), this);
  346. }
  347. }
  348. /**
  349. * Set per-view controllers
  350. */
  351. private void initControls() {
  352. mCancelBtn = findViewById(R.id.folder_picker_btn_cancel);
  353. mChooseBtn = findViewById(R.id.folder_picker_btn_choose);
  354. if (mChooseBtn != null) {
  355. mChooseBtn.getBackground().setColorFilter(ThemeUtils.primaryColor(this, true), PorterDuff.Mode.SRC_ATOP);
  356. mChooseBtn.setOnClickListener(this);
  357. }
  358. if (mCancelBtn != null) {
  359. mCancelBtn.setTextColor(ThemeUtils.primaryColor(this, true));
  360. mCancelBtn.setOnClickListener(this);
  361. }
  362. }
  363. @Override
  364. public void onClick(View v) {
  365. if (v.equals(mCancelBtn)) {
  366. finish();
  367. } else if (v.equals(mChooseBtn)) {
  368. Intent i = getIntent();
  369. ArrayList<Parcelable> targetFiles = i.getParcelableArrayListExtra(FolderPickerActivity.EXTRA_FILES);
  370. Intent data = new Intent();
  371. data.putExtra(EXTRA_FOLDER, getCurrentFolder());
  372. data.putParcelableArrayListExtra(EXTRA_FILES, targetFiles);
  373. setResult(RESULT_OK, data);
  374. finish();
  375. }
  376. }
  377. @Override
  378. public void onRemoteOperationFinish(RemoteOperation operation, RemoteOperationResult result) {
  379. super.onRemoteOperationFinish(operation, result);
  380. if (operation instanceof CreateFolderOperation) {
  381. onCreateFolderOperationFinish((CreateFolderOperation) operation, result);
  382. }
  383. }
  384. /**
  385. * Updates the view associated to the activity after the finish of an operation trying
  386. * to create a new folder.
  387. *
  388. * @param operation Creation operation performed.
  389. * @param result Result of the creation.
  390. */
  391. private void onCreateFolderOperationFinish(
  392. CreateFolderOperation operation, RemoteOperationResult result
  393. ) {
  394. if (result.isSuccess()) {
  395. refreshListOfFilesFragment(false);
  396. } else {
  397. try {
  398. DisplayUtils.showSnackMessage(
  399. this, ErrorMessageAdapter.getErrorCauseMessage(result, operation, getResources())
  400. );
  401. } catch (NotFoundException e) {
  402. Log_OC.e(TAG, "Error while trying to show fail message ", e);
  403. }
  404. }
  405. }
  406. private class SyncBroadcastReceiver extends BroadcastReceiver {
  407. /**
  408. * {@link BroadcastReceiver} to enable syncing feedback in UI
  409. */
  410. @Override
  411. public void onReceive(Context context, Intent intent) {
  412. try {
  413. String event = intent.getAction();
  414. Log_OC.d(TAG, "Received broadcast " + event);
  415. String accountName = intent.getStringExtra(FileSyncAdapter.EXTRA_ACCOUNT_NAME);
  416. String syncFolderRemotePath = intent.getStringExtra(FileSyncAdapter.EXTRA_FOLDER_PATH);
  417. RemoteOperationResult syncResult = (RemoteOperationResult)
  418. DataHolderUtil.getInstance().retrieve(intent.getStringExtra(FileSyncAdapter.EXTRA_RESULT));
  419. boolean sameAccount = getAccount() != null && accountName.equals(getAccount().name)
  420. && getStorageManager() != null;
  421. if (sameAccount) {
  422. if (FileSyncAdapter.EVENT_FULL_SYNC_START.equals(event)) {
  423. mSyncInProgress = true;
  424. } else {
  425. OCFile currentFile = (getFile() == null) ? null :
  426. getStorageManager().getFileByPath(getFile().getRemotePath());
  427. OCFile currentDir = (getCurrentFolder() == null) ? null :
  428. getStorageManager().getFileByPath(getCurrentFolder().getRemotePath());
  429. if (currentDir == null) {
  430. // current folder was removed from the server
  431. DisplayUtils.showSnackMessage(getActivity(), R.string.sync_current_folder_was_removed,
  432. getCurrentFolder().getFileName());
  433. browseToRoot();
  434. } else {
  435. if (currentFile == null && !getFile().isFolder()) {
  436. // currently selected file was removed in the server, and now we know it
  437. currentFile = currentDir;
  438. }
  439. if (currentDir.getRemotePath().equals(syncFolderRemotePath)) {
  440. OCFileListFragment fileListFragment = getListOfFilesFragment();
  441. if (fileListFragment != null) {
  442. fileListFragment.listDirectory(currentDir, false, false);
  443. }
  444. }
  445. setFile(currentFile);
  446. }
  447. mSyncInProgress = (!FileSyncAdapter.EVENT_FULL_SYNC_END.equals(event) &&
  448. !RefreshFolderOperation.EVENT_SINGLE_FOLDER_SHARES_SYNCED.equals(event));
  449. if (RefreshFolderOperation.EVENT_SINGLE_FOLDER_CONTENTS_SYNCED.equals(event) &&
  450. /// TODO refactor and make common
  451. syncResult != null && !syncResult.isSuccess()) {
  452. if (ResultCode.UNAUTHORIZED.equals(syncResult.getCode()) || (syncResult.isException()
  453. && syncResult.getException() instanceof AuthenticatorException)) {
  454. requestCredentialsUpdate(context);
  455. } else if (RemoteOperationResult.ResultCode.SSL_RECOVERABLE_PEER_UNVERIFIED
  456. .equals(syncResult.getCode())) {
  457. showUntrustedCertDialog(syncResult);
  458. }
  459. }
  460. }
  461. removeStickyBroadcast(intent);
  462. DataHolderUtil.getInstance().delete(intent.getStringExtra(FileSyncAdapter.EXTRA_RESULT));
  463. Log_OC.d(TAG, "Setting progress visibility to " + mSyncInProgress);
  464. setIndeterminate(mSyncInProgress);
  465. setBackgroundText();
  466. }
  467. } catch (RuntimeException e) {
  468. // avoid app crashes after changing the serial id of RemoteOperationResult
  469. // in owncloud library with broadcast notifications pending to process
  470. removeStickyBroadcast(intent);
  471. DataHolderUtil.getInstance().delete(intent.getStringExtra(FileSyncAdapter.EXTRA_RESULT));
  472. }
  473. }
  474. }
  475. @Override
  476. public void showDetails(OCFile file) {
  477. // not used at the moment
  478. }
  479. @Override
  480. public void showDetails(OCFile file, int activeTab) {
  481. // not used at the moment
  482. }
  483. /**
  484. * {@inheritDoc}
  485. */
  486. @Override
  487. public void onTransferStateChanged(OCFile file, boolean downloading, boolean uploading) {
  488. // not used at the moment
  489. }
  490. @Override
  491. public void onRefresh() {
  492. refreshList(true);
  493. }
  494. @Override
  495. public void onRefresh(boolean enforced) {
  496. refreshList(enforced);
  497. }
  498. private void refreshList(boolean ignoreETag) {
  499. OCFileListFragment listOfFiles = getListOfFilesFragment();
  500. if (listOfFiles != null) {
  501. OCFile folder = listOfFiles.getCurrentFile();
  502. if (folder != null) {
  503. startSyncFolderOperation(folder, ignoreETag);
  504. }
  505. }
  506. }
  507. public boolean isDoNotEnterEncryptedFolder() {
  508. return mDoNotEnterEncryptedFolder;
  509. }
  510. }