public static boolean dirExist(String path)
    {
	if(isPathValid(path))
	{
	    File dir = new File(path);

	    try
	    {
		if(!dir.getCanonicalPath().equals(path))
		    return false;

		if ( dir.exists() && dir.isDirectory() ){return true;}
		else{return false;}
	    }
	    catch (IOException e){return false;}
	}
	else
	    return false;
    }