isDirectory() Tests whether the file denoted by this abstract pathname is a directory. isFile() Tests whether the file denoted by this abstract pathname is a normal file.
File file = new File("c://rea.txt"); if( file.isDirectory() ) { ..Directory } if (file.isFile()) { ..File()
Tests whether the file denoted by this abstract pathname is a directory.
isFile()
Tests whether the file denoted by this abstract pathname is a normal file.
if( file.isDirectory() )
{
..Directory
}
if (file.isFile())
{
..File()
}