Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7802035
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T01:08:10+00:00 2026-06-02T01:08:10+00:00

In ubuntu, isFile() and isDirectory() don’t work perfectly. I used this code to find

  • 0

In ubuntu, isFile() and isDirectory() don’t work perfectly. I used this code to find out if something is a file or directory:

boolean fileName= file.getName().lastIndexOf('.') == -1;

But the problem is that I made a folder named bhargav.panchal. With the above function, this folder is considered as a file, not a folder.

File file=new File("/home/asd/My_Shared_File/bhargav.panchal");

if(file.exists()){
    if(!file.isDirectory()) {
        Toast.makeText(activity, "This is File", Toast.LENGTH_SHORT).show();
    } else {
        Toast.makeText(activity, "This is Directory", Toast.LENGTH_SHORT).show();
    }
} else {
    Toast.makeText(activity, "File or Directory doesn't exist.", Toast.LENGTH_SHORT).show();
}

In this condition, the isDirectory() and isFile() methods always return false.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-02T01:08:12+00:00Added an answer on June 2, 2026 at 1:08 am

    No, you are wrong somewhere. On the contrary you cant access external environment with DVM.

    reason : it is not possible for applications to interfere with each other based on the OS level
    security and Dalvik VMs are confined to a single OS process, Dalvik itself is not concerned with
    runtime security
    . Although Dalvik is not relied upon for security, it is interesting to note that most
    of the standard Java security classes remain in the Android distribution. These include the
    java.lang.SecurityManager and some of the classes in the java.security package. In standard Java
    environments, the SecurityManger plays the role analogous to the OS process-level security in
    Android. The SecurityManager typically controls access to resources external to the JVM such as
    files, processes, and the network
    . In the Android distribution, the standard security framework is
    apparently present for applications to use within their own application space but is neither fully
    implemented nor configured (no java.policy files are present) for interprocess security.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Ubuntu 11.04, G++, freeglut and GLUT. I don't understand this at all. Here's the
Ubuntu Server 9.10, Here is my file, test.py import commands blkid = commands.getoutput('blkid') print
On Ubuntu, I am trying to download a file (from a script) using wget.
Ubuntu Server 11.10 How to rename file .test to test ? rename .test test
Ubuntu: Jaunty Mercurial: 1.3.1 Access: ssh (users john and bob) File permission: -rw-rw---- 1
I'm writing a program that uses File I/O to traverse through a directory given
My ubuntu setup, has various shell-scripts that help me get my work done. Of
Ubuntu Maverick w/Python 2.7: I can't figure out what to do to resolve the
The Ubuntu equivalent would be libc6-dev , but I can't seem to find it
OS: ubuntu 11.10 Webserver: Apache Code: PHP I am trying to display the output

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.