FileSystemObject fso = null;
try {
fso = CommandHelper.getFileInfo(this, path, false, null);
+ if (fso == null) {
+ throw new NoSuchFileOrDirectory(path);
+ }
} catch (Exception e) {
// Notify the user
FileSystemObject fso = null;
try {
fso = CommandHelper.getFileInfo(this, item.getFullPath(), false, null);
+ if (fso == null) {
+ throw new NoSuchFileOrDirectory(item.getFullPath());
+ }
} catch (Exception e) {
// Notify the user
throw this.mListener.mCause;
}
- // Check that the operation was completed retrieving the extracted file or folder
- boolean failed = true;
+ // Check that the operation was completed retrieving the compressed file or folder
+ boolean failed = false;
try {
- CommandHelper.getFileInfo(ctx, out, false, null);
+ FileSystemObject fso = CommandHelper.getFileInfo(ctx, out, false, null);
+ if (fso == null) {
+ // Failed. The file or folder not exists
+ failed = true;
+ }
- // Failed. The file exists
- failed = false;
+ // Operation complete successfully
} catch (Throwable e) {
- // Operation complete successfully
+ // Failed. The file or folder not exists
+ failed = true;
}
if (failed) {
throw new ExecutionException(
throw this.mListener.mCause;
}
- // Check that the operation was completed retrieving the extracted file or folder
- boolean failed = true;
+ // Check that the operation was completed retrieving the uncompressed
+ // file or folder
+ boolean failed = false;
try {
- CommandHelper.getFileInfo(ctx, out, false, null);
+ FileSystemObject fso2 = CommandHelper.getFileInfo(ctx, out, false, null);
+ if (fso2 == null) {
+ // Failed. The file or folder not exists
+ failed = true;
+ }
- // Failed. The file exists
- failed = false;
+ // Operation complete successfully
} catch (Throwable e) {
- // Operation complete successfully
+ // Failed. The file or folder not exists
+ failed = true;
}
if (failed) {
throw new ExecutionException(
import android.text.Spanned;
import com.cyanogenmod.explorer.R;
+import com.cyanogenmod.explorer.console.NoSuchFileOrDirectory;
import com.cyanogenmod.explorer.console.RelaunchableException;
import com.cyanogenmod.explorer.listeners.OnRequestRefreshListener;
import com.cyanogenmod.explorer.listeners.OnSelectionListener;
}
// Check that the operation was completed retrieving the fso modified
- CommandHelper.getFileInfo(ctx, dst.getAbsolutePath(), false, null);
+ FileSystemObject fso =
+ CommandHelper.getFileInfo(ctx, dst.getAbsolutePath(), false, null);
+ if (fso == null) {
+ throw new NoSuchFileOrDirectory(dst.getAbsolutePath());
+ }
}
};
final BackgroundAsyncTask task = new BackgroundAsyncTask(ctx, callable);
boolean failed = false;
try {
CommandHelper.getFileInfo(ctx, fso.getFullPath(), false, null);
-
- // Failed. The file still exists
- failed = true;
+ FileSystemObject fso2 =
+ CommandHelper.getFileInfo(ctx, fso.getFullPath(), false, null);
+ if (fso2 != null) {
+ // Failed. The file still exists
+ failed = true;
+ }
} catch (Throwable e) {
// Operation complete successfully
FileSystemObject fso = null;
try {
fso = CommandHelper.getFileInfo(ctx, newName, false, null);
- } catch (Throwable ex2) {
- /**NON BLOCK**/
- }
+ } catch (Throwable ex2) {/**NON BLOCK**/}
onRequestRefreshListener.onRequestRefresh(fso);
}
showOperationSuccessMsg(ctx);
if (onRequestRefreshListener != null) {
FileSystemObject fso = null;
try {
- fso =
- CommandHelper.getFileInfo(ctx, newName, false, null);
- } catch (Throwable ex2) {
- /**NON BLOCK**/
- }
+ fso = CommandHelper.getFileInfo(ctx, newName, false, null);
+ } catch (Throwable ex2) {/**NON BLOCK**/}
onRequestRefreshListener.onRequestRefresh(fso);
}
return Boolean.TRUE;
FileSystemObject fso = null;
try {
fso = CommandHelper.getFileInfo(ctx, link, false, null);
- } catch (Throwable ex2) {
- /**NON BLOCK**/
- }
+ } catch (Throwable ex2) {/**NON BLOCK**/}
onRequestRefreshListener.onRequestRefresh(fso);
}
return Boolean.TRUE;
FileSystemObject fso =
CommandHelper.getFileInfo(getContext(), PATH_LINK_OK, false, getConsole());
assertTrue("response==false", ret); //$NON-NLS-1$
+ assertNotNull("fso==null", fso); //$NON-NLS-1$
assertTrue("fso not is Symlink", fso instanceof Symlink); //$NON-NLS-1$
} finally {
try {