+/* ownCloud Android client application
+ * Copyright (C) 2014 ownCloud Inc.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2,
+ * as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
package com.owncloud.android.files;
import java.util.ArrayList;
import android.view.Menu;
import android.view.MenuItem;
-import com.actionbarsherlock.app.SherlockFragment;
import com.owncloud.android.R;
import com.owncloud.android.datamodel.OCFile;
+import com.owncloud.android.files.services.FileDownloader;
import com.owncloud.android.files.services.FileDownloader.FileDownloaderBinder;
+import com.owncloud.android.files.services.FileUploader;
import com.owncloud.android.files.services.FileUploader.FileUploaderBinder;
import com.owncloud.android.ui.activity.ComponentsGetter;
-import com.owncloud.android.ui.fragment.FileDetailFragment;
-import com.owncloud.android.ui.fragment.OCFileListFragment;
-import com.owncloud.android.ui.preview.PreviewImageFragment;
-import com.owncloud.android.ui.preview.PreviewMediaFragment;
+/**
+ * Filters out the file actions available in a given {@link Menu} for a given {@link OCFile}
+ * according to the current state of the latest.
+ *
+ * @author David A. Velasco
+ */
public class FileMenuFilter {
private OCFile mFile;
private ComponentsGetter mComponentsGetter;
private Account mAccount;
private Context mContext;
- private SherlockFragment mFragment;
-
- public void setFile(OCFile targetFile) {
+
+ /**
+ * Constructor
+ *
+ * @param targetFile {@link OCFile} target of the action to filter in the {@link Menu}.
+ * @param account ownCloud {@link Account} holding targetFile.
+ * @param cg Accessor to app components, needed to get access the
+ * {@link FileUploader} and {@link FileDownloader} services.
+ * @param context Android {@link Context}, needed to access build setup resources.
+ */
+ public FileMenuFilter(OCFile targetFile, Account account, ComponentsGetter cg, Context context) {
mFile = targetFile;
- }
-
- public void setAccount(Account account) {
mAccount = account;
- }
-
- public void setComponentGetter(ComponentsGetter cg) {
mComponentsGetter = cg;
- }
-
- public void setContext(Context context) {
mContext = context;
}
- public void setFragment(SherlockFragment fragment) {
- mFragment = fragment;
- }
-
+
+ /**
+ * Filters out the file actions available in the passed {@link Menu} taken into account
+ * the state of the {@link OCFile} held by the filter.
+ *
+ * @param menu Options or context menu to filter.
+ */
public void filter(Menu menu) {
List<Integer> toShow = new ArrayList<Integer>();
- List<Integer> toDisable = new ArrayList<Integer>();
List<Integer> toHide = new ArrayList<Integer>();
- filter(toShow, toDisable, toHide);
+ filter(toShow, toHide);
MenuItem item = null;
for (int i : toShow) {
}
}
- for (int i : toDisable) {
- item = menu.findItem(i);
- if (item != null) {
- item.setVisible(true);
- item.setEnabled(false);
- }
- }
-
for (int i : toHide) {
item = menu.findItem(i);
if (item != null) {
}
/**
- * ActionBarSherlock...
+ * Filters out the file actions available in the passed {@link Menu} taken into account
+ * the state of the {@link OCFile} held by the filter.
*
+ * Second method needed thanks to ActionBarSherlock.
+ *
+ * TODO Get rid of it when ActionBarSherlock is replaced for newer Android Support Library.
+ *
+ * @param menu Options or context menu to filter.
*/
public void filter(com.actionbarsherlock.view.Menu menu) {
List<Integer> toShow = new ArrayList<Integer>();
- List<Integer> toDisable = new ArrayList<Integer>();
List<Integer> toHide = new ArrayList<Integer>();
- filter(toShow, toDisable, toHide);
+ filter(toShow, toHide);
com.actionbarsherlock.view.MenuItem item = null;
for (int i : toShow) {
item.setEnabled(true);
}
}
- for (int i : toDisable) {
- item = menu.findItem(i);
- if (item != null) {
- item.setVisible(true);
- item.setEnabled(false);
- }
- }
for (int i : toHide) {
item = menu.findItem(i);
if (item != null) {
}
}
- private void filter(List<Integer> toShow, List<Integer> toDisable, List <Integer> toHide) {
+ /**
+ * Performs the real filtering, to be applied in the {@link Menu} by the caller methods.
+ *
+ * Decides what actions must be shown and hidden.
+ *
+ * @param toShow List to save the options that must be shown in the menu.
+ * @param toHide List to save the options that must be shown in the menu.
+ */
+ private void filter(List<Integer> toShow, List <Integer> toHide) {
boolean downloading = false;
boolean uploading = false;
if (mComponentsGetter != null && mFile != null && mAccount != null) {
uploading = uploaderBinder != null && uploaderBinder.isUploading(mAccount, mFile);
}
- // R.id.action_download_file
- if (mFile == null || mFile.isFolder() || mFile.isDown() || downloading || uploading ||
- (mFragment != null && (
- mFragment instanceof PreviewImageFragment ||
- mFragment instanceof PreviewMediaFragment
- )
- )
- ) {
+ /// decision is taken for each possible action on a file in the menu
+
+ // DOWNLOAD
+ if (mFile == null || mFile.isFolder() || mFile.isDown() || downloading || uploading) {
toHide.add(R.id.action_download_file);
} else {
toShow.add(R.id.action_download_file);
}
- // R.id.action_rename_file
- if ((downloading || uploading) &&
- (mFragment != null && mFragment instanceof OCFileListFragment)
- ) {
- toDisable.add(R.id.action_rename_file);
-
- } else if (mFile == null || downloading || uploading ||
- (mFragment != null && (
- mFragment instanceof PreviewImageFragment ||
- mFragment instanceof PreviewMediaFragment
- )
- )
- ) {
+ // RENAME
+ if (mFile == null || downloading || uploading) {
toHide.add(R.id.action_rename_file);
} else {
toShow.add(R.id.action_rename_file);
}
- // R.id.action_remove_file
- if ((downloading || uploading) &&
- (mFragment != null && mFragment instanceof OCFileListFragment)
- ) {
- toDisable.add(R.id.action_remove_file);
-
- } else if (mFile == null || downloading || uploading) {
+ // REMOVE
+ if (mFile == null || downloading || uploading) {
toHide.add(R.id.action_remove_file);
} else {
toShow.add(R.id.action_remove_file);
}
- // R.id.action_open_file_with
- if (mFile == null || mFile.isFolder() || !mFile.isDown() || downloading || uploading ||
- (mFragment != null && mFragment instanceof OCFileListFragment)) {
+ // OPEN WITH (different to preview!)
+ if (mFile == null || mFile.isFolder() || !mFile.isDown() || downloading || uploading) {
toHide.add(R.id.action_open_file_with);
} else {
}
- // R.id.action_cancel_download
- if (mFile == null || !downloading || mFile.isFolder() ||
- (mFragment != null && (
- (mFragment instanceof PreviewImageFragment) ||
- (mFragment instanceof PreviewMediaFragment)
- )
- )
- ) {
+ // CANCEL DOWNLOAD
+ if (mFile == null || !downloading || mFile.isFolder()) {
toHide.add(R.id.action_cancel_download);
} else {
toShow.add(R.id.action_cancel_download);
}
- // R.id.action_cancel_upload
- if (mFile == null || !uploading || mFile.isFolder() ||
- (mFragment != null && (
- (mFragment instanceof PreviewImageFragment) ||
- (mFragment instanceof PreviewMediaFragment)
- )
- )
- ) {
+ // CANCEL UPLOAD
+ if (mFile == null || !uploading || mFile.isFolder()) {
toHide.add(R.id.action_cancel_upload);
} else {
toShow.add(R.id.action_cancel_upload);
}
- // R.id.action_sync_file
- if (mFile == null || mFile.isFolder() || !mFile.isDown() || downloading || uploading ||
- (mFragment != null && mFragment instanceof PreviewMediaFragment)
- ) {
+ // SYNC FILE CONTENTS
+ if (mFile == null || mFile.isFolder() || !mFile.isDown() || downloading || uploading) {
toHide.add(R.id.action_sync_file);
} else {
toShow.add(R.id.action_sync_file);
}
- // R.id.action_share_file // TODO add check on SHARE available on server side?
+ // SHARE FILE
+ // TODO add check on SHARE available on server side?
if (mFile == null) {
toHide.add(R.id.action_share_file);
} else {
toShow.add(R.id.action_share_file);
}
- // R.id.action_unshare_file // TODO add check on SHARE available on server side?
+ // UNSHARE FILE
+ // TODO add check on SHARE available on server side?
if (mFile == null || !mFile.isShareByLink()) {
toHide.add(R.id.action_unshare_file);
} else {
}
- // R.id.action_see_details
- if (mFile == null || mFile.isFolder() || (mFragment != null && mFragment instanceof FileDetailFragment)) {
- // TODO check dual pane when FileDetailFragment is shown
+ // SEE DETAILS
+ if (mFile == null || mFile.isFolder()) {
toHide.add(R.id.action_see_details);
} else {
toShow.add(R.id.action_see_details);
}
- // R.id.action_send_file
- boolean sendEnabled = (mContext != null &&
+ // SEND
+ boolean sendAllowed = (mContext != null &&
mContext.getString(R.string.send_files_to_other_apps).equalsIgnoreCase("on"));
- if (mFile != null && sendEnabled && !mFile.isFolder()) {
- toShow.add(R.id.action_send_file);
- } else {
+ if (mFile == null || !sendAllowed || mFile.isFolder() || uploading || downloading) {
toHide.add(R.id.action_send_file);
+ } else {
+ toShow.add(R.id.action_send_file);
}
}
import java.util.HashSet;
import java.util.Iterator;
import java.util.Set;
+import java.util.concurrent.atomic.AtomicBoolean;
import com.owncloud.android.datamodel.OCFile;
import com.owncloud.android.lib.common.network.OnDatatransferProgressListener;
import com.owncloud.android.lib.common.OwnCloudClient;
+import com.owncloud.android.lib.common.operations.OperationCancelledException;
import com.owncloud.android.lib.common.operations.RemoteOperation;
import com.owncloud.android.lib.common.operations.RemoteOperationResult;
import com.owncloud.android.lib.resources.files.DownloadRemoteFileOperation;
private OCFile mFile;
private Set<OnDatatransferProgressListener> mDataTransferListeners = new HashSet<OnDatatransferProgressListener>();
private long mModificationTimestamp = 0;
+ private final AtomicBoolean mCancellationRequested = new AtomicBoolean(false);
private DownloadRemoteFileOperation mDownloadOperation;
String tmpFolder = getTmpFolder();
/// perform the download
+ synchronized(mCancellationRequested) {
+ if (mCancellationRequested.get()) {
+ return new RemoteOperationResult(new OperationCancelledException());
+ }
+ }
+
mDownloadOperation = new DownloadRemoteFileOperation(mFile.getRemotePath(), tmpFolder);
Iterator<OnDatatransferProgressListener> listener = mDataTransferListeners.iterator();
while (listener.hasNext()) {
}
public void cancel() {
- mDownloadOperation.cancel();
+ mCancellationRequested.set(true); // atomic set; there is no need of synchronizing it
+ if (mDownloadOperation != null) {
+ mDownloadOperation.cancel();
+ }
}
return null;
}
- protected FileFragment getSecondFragment() {
+ public FileFragment getSecondFragment() {
Fragment second = getSupportFragmentManager().findFragmentByTag(FileDisplayActivity.TAG_SECOND_FRAGMENT);
if (second != null) {
return (FileFragment)second;
Account account = getAccount();
if (mDownloaderBinder != null && mDownloaderBinder.isDownloading(account, file)) {
mDownloaderBinder.cancel(account, file);
+ refreshListOfFilesFragment();
onTransferStateChanged(file, false, false);
} else if (mUploaderBinder != null && mUploaderBinder.isUploading(account, file)) {
mUploaderBinder.cancel(account, file);
+ refreshListOfFilesFragment();
if (!file.fileExists()) {
cleanSecondFragment();
private static final String TAG = FileDetailFragment.class.getSimpleName();
public static final String FTAG_CONFIRMATION = "REMOVE_CONFIRMATION_FRAGMENT";
+ public static final String FTAG_RENAME_FILE = "RENAME_FILE_FRAGMENT";
/**
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
- //super.onCreateView(inflater, container, savedInstanceState);
if (savedInstanceState != null) {
setFile((OCFile)savedInstanceState.getParcelable(FileActivity.EXTRA_FILE));
public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
super.onCreateOptionsMenu(menu, inflater);
inflater.inflate(R.menu.file_actions_menu, menu);
-
- /*
- TODO Maybe should stay here? It's context (fragment) specific
-
- MenuItem item = menu.findItem(R.id.action_see_details);
- if (item != null) {
- item.setVisible(false);
- item.setEnabled(false);
- }
-
- // Send file
- item = menu.findItem(R.id.action_send_file);
- boolean sendEnabled = getString(R.string.send_files_to_other_apps).equalsIgnoreCase("on");
- if (item != null) {
- if (sendEnabled) {
- item.setVisible(true);
- item.setEnabled(true);
- } else {
- item.setVisible(false);
- item.setEnabled(false);
-
- }
- }
- */
- }
+ }
/**
public void onPrepareOptionsMenu (Menu menu) {
super.onPrepareOptionsMenu(menu);
- FileMenuFilter mf = new FileMenuFilter();
- mf.setFile(getFile());
- mf.setComponentGetter(mContainerActivity);
- mf.setAccount(mContainerActivity.getStorageManager().getAccount());
- mf.setContext(getSherlockActivity());
- mf.setFragment(this);
+ FileMenuFilter mf = new FileMenuFilter(
+ getFile(),
+ mContainerActivity.getStorageManager().getAccount(),
+ mContainerActivity,
+ getSherlockActivity()
+ );
mf.filter(menu);
+
+ // additional restriction for this fragment
+ MenuItem item = menu.findItem(R.id.action_see_details);
+ if (item != null) {
+ item.setVisible(false);
+ item.setEnabled(false);
+ }
}
int extensionStart = file.isFolder() ? -1 : fileName.lastIndexOf(".");
int selectionEnd = (extensionStart >= 0) ? extensionStart : fileName.length();
EditNameDialog dialog = EditNameDialog.newInstance(getString(R.string.rename_dialog_title), fileName, 0, selectionEnd, this);
- dialog.show(getFragmentManager(), "nameeditdialog");
+ dialog.show(getFragmentManager(), FTAG_RENAME_FILE);
}
import java.util.ArrayList;
import com.owncloud.android.R;
-import com.owncloud.android.authentication.AccountUtils;
import com.owncloud.android.datamodel.FileDataStorageManager;
import com.owncloud.android.datamodel.OCFile;
import com.owncloud.android.files.FileMenuFilter;
-import com.owncloud.android.files.services.FileDownloader.FileDownloaderBinder;
-import com.owncloud.android.files.services.FileUploader.FileUploaderBinder;
import com.owncloud.android.ui.adapter.FileListListAdapter;
import com.owncloud.android.ui.activity.FileDisplayActivity;
import com.owncloud.android.ui.dialog.ConfirmationDialogFragment;
import com.owncloud.android.ui.preview.PreviewMediaFragment;
import com.owncloud.android.utils.Log_OC;
-import android.accounts.Account;
import android.app.Activity;
import android.os.Bundle;
import android.view.ContextMenu;
AdapterContextMenuInfo info = (AdapterContextMenuInfo) menuInfo;
OCFile targetFile = (OCFile) mAdapter.getItem(info.position);
- FileMenuFilter mf = new FileMenuFilter();
- mf.setFile(targetFile);
- mf.setComponentGetter(mContainerActivity);
- mf.setAccount(mContainerActivity.getStorageManager().getAccount());
- mf.setContext(getSherlockActivity());
- mf.setFragment(this);
+ FileMenuFilter mf = new FileMenuFilter(
+ targetFile,
+ mContainerActivity.getStorageManager().getAccount(),
+ mContainerActivity,
+ getSherlockActivity()
+ );
mf.filter(menu);
+
+ /// additional restrictions for this fragment
+ // TODO allow in the future 'open with' for previewable files
+ MenuItem item = menu.findItem(R.id.action_open_file_with);
+ if (item != null) {
+ item.setVisible(false);
+ item.setEnabled(false);
+ }
+ /// TODO break this direct dependency on FileDisplayActivity... if possible
+ FileFragment frag = ((FileDisplayActivity)getSherlockActivity()).getSecondFragment();
+ if (frag != null && frag instanceof FileDetailFragment &&
+ frag.getFile().getFileId() == targetFile.getFileId()) {
+ item = menu.findItem(R.id.action_see_details);
+ if (item != null) {
+ item.setVisible(false);
+ item.setEnabled(false);
+ }
+ }
+
+
}
int extensionStart = mTargetFile.isFolder() ? -1 : fileName.lastIndexOf(".");
int selectionEnd = (extensionStart >= 0) ? extensionStart : fileName.length();
EditNameDialog dialog = EditNameDialog.newInstance(getString(R.string.rename_dialog_title), fileName, 0, selectionEnd, this);
- dialog.show(getFragmentManager(), EditNameDialog.TAG);
+ dialog.show(getFragmentManager(), FileDetailFragment.FTAG_RENAME_FILE);
return true;
}
case R.id.action_remove_file: {
confDialog.show(getFragmentManager(), FileDetailFragment.FTAG_CONFIRMATION);
return true;
}
+ case R.id.action_download_file:
case R.id.action_sync_file: {
mContainerActivity.getFileOperationsHelper().syncFile(mTargetFile);
return true;
}
- case R.id.action_cancel_download: {
- FileDownloaderBinder downloaderBinder = mContainerActivity.getFileDownloaderBinder();
- Account account = AccountUtils.getCurrentOwnCloudAccount(getSherlockActivity());
- if (downloaderBinder != null && downloaderBinder.isDownloading(account, mTargetFile)) {
- downloaderBinder.cancel(account, mTargetFile);
- listDirectory();
- mContainerActivity.onTransferStateChanged(mTargetFile, false, false);
- }
- return true;
- }
+ case R.id.action_cancel_download:
case R.id.action_cancel_upload: {
- FileUploaderBinder uploaderBinder = mContainerActivity.getFileUploaderBinder();
- Account account = AccountUtils.getCurrentOwnCloudAccount(getSherlockActivity());
- if (uploaderBinder != null && uploaderBinder.isUploading(account, mTargetFile)) {
- uploaderBinder.cancel(account, mTargetFile);
- listDirectory();
- mContainerActivity.onTransferStateChanged(mTargetFile, false, false);
- }
+ ((FileDisplayActivity)mContainerActivity).cancelTransference(mTargetFile);
return true;
}
case R.id.action_see_details: {
@Override
public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
super.onCreateOptionsMenu(menu, inflater);
-
inflater.inflate(R.menu.file_actions_menu, menu);
- /*List<Integer> toHide = new ArrayList<Integer>();
- MenuItem item = null;
- toHide.add(R.id.action_cancel_download);
- toHide.add(R.id.action_cancel_upload);
- toHide.add(R.id.action_download_file);
- toHide.add(R.id.action_rename_file); // by now
-
- // Send file
- boolean sendEnabled = getString(R.string.send_files_to_other_apps).equalsIgnoreCase("on");
- if (!sendEnabled) {
- toHide.add(R.id.action_send_file);
- }
-
- for (int i : toHide) {
- item = menu.findItem(i);
- if (item != null) {
- item.setVisible(false);
- item.setEnabled(false);
- }
- }
- */
-
}
/**
public void onPrepareOptionsMenu(Menu menu) {
super.onPrepareOptionsMenu(menu);
- FileMenuFilter mf = new FileMenuFilter();
- mf.setFile(getFile());
- mf.setComponentGetter(mContainerActivity);
- mf.setAccount(mContainerActivity.getStorageManager().getAccount());
- mf.setContext(getSherlockActivity());
- mf.setFragment(this);
+ FileMenuFilter mf = new FileMenuFilter(
+ getFile(),
+ mContainerActivity.getStorageManager().getAccount(),
+ mContainerActivity,
+ getSherlockActivity()
+ );
mf.filter(menu);
-
- /*
- MenuItem item = menu.findItem(R.id.action_unshare_file);
- // Options shareLink
- if (!getFile().isShareByLink()) {
+
+ // additional restriction for this fragment
+ // TODO allow renaming in PreviewImageFragment
+ MenuItem item = menu.findItem(R.id.action_rename_file);
+ if (item != null) {
item.setVisible(false);
item.setEnabled(false);
- } else {
- item.setVisible(true);
- item.setEnabled(true);
}
- */
}
mContainerActivity.getFileOperationsHelper().sendDownloadedFile(getFile());
return true;
}
+ case R.id.action_sync_file: {
+ mContainerActivity.getFileOperationsHelper().syncFile(getFile());
+ return true;
+ }
default:
return false;
@Override
public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
super.onCreateOptionsMenu(menu, inflater);
-
inflater.inflate(R.menu.file_actions_menu, menu);
- /*
- List<Integer> toHide = new ArrayList<Integer>();
-
- MenuItem item = null;
- toHide.add(R.id.action_cancel_download);
- toHide.add(R.id.action_cancel_upload);
- toHide.add(R.id.action_download_file);
- toHide.add(R.id.action_sync_file);
- toHide.add(R.id.action_rename_file); // by now
-
- // Options shareLink
- if (!getFile().isShareByLink()) {
- toHide.add(R.id.action_unshare_file);
- }
-
- // Send file
- boolean sendEnabled = getString(R.string.send_files_to_other_apps).equalsIgnoreCase("on");
- if (!sendEnabled) {
- toHide.add(R.id.action_send_file);
- }
-
- for (int i : toHide) {
- item = menu.findItem(i);
- if (item != null) {
- item.setVisible(false);
- item.setEnabled(false);
- }
- }
- */
-
}
public void onPrepareOptionsMenu(Menu menu) {
super.onPrepareOptionsMenu(menu);
- FileMenuFilter mf = new FileMenuFilter();
- mf.setFile(getFile());
- mf.setComponentGetter(mContainerActivity);
- mf.setAccount(mContainerActivity.getStorageManager().getAccount());
- mf.setContext(getSherlockActivity());
- mf.setFragment(this);
+ FileMenuFilter mf = new FileMenuFilter(
+ getFile(),
+ mContainerActivity.getStorageManager().getAccount(),
+ mContainerActivity,
+ getSherlockActivity()
+ );
mf.filter(menu);
- /*
- MenuItem item = menu.findItem(R.id.action_unshare_file);
- // Options shareLink
- if (!getFile().isShareByLink()) {
+ // additional restriction for this fragment
+ // TODO allow renaming in PreviewImageFragment
+ MenuItem item = menu.findItem(R.id.action_rename_file);
+ if (item != null) {
item.setVisible(false);
item.setEnabled(false);
- } else {
- item.setVisible(true);
- item.setEnabled(true);
}
- */
}
public boolean onOptionsItemSelected(MenuItem item) {
switch (item.getItemId()) {
case R.id.action_share_file: {
- shareFileWithLink();
+ stopPreview(false);
+ mContainerActivity.getFileOperationsHelper().shareFileWithLink(getFile());
return true;
}
case R.id.action_unshare_file: {
- unshareFileWithLink();
+ stopPreview(false);
+ mContainerActivity.getFileOperationsHelper().unshareFileWithLink(getFile());
return true;
}
case R.id.action_open_file_with: {
case R.id.action_send_file: {
sendFile();
}
-
+ case R.id.action_sync_file: {
+ mContainerActivity.getFileOperationsHelper().syncFile(getFile());
+ return true;
+ }
+
default:
return false;
}
setFile(file);
}
- private void unshareFileWithLink() {
- stopPreview(false);
- mContainerActivity.getFileOperationsHelper().unshareFileWithLink(getFile());
- }
-
- private void shareFileWithLink() {
- stopPreview(false);
- mContainerActivity.getFileOperationsHelper().shareFileWithLink(getFile());
-
- }
-
private void sendFile() {
stopPreview(false);
mContainerActivity.getFileOperationsHelper().sendDownloadedFile(getFile());