private static boolean checkFileParentExists(final String file){
  String fileName=PathUtils.removeSlashFromEnd(file);
  File dir=new File(fileName.substring(0,fileName.lastIndexOf("/") + 1));
  return dir.exists() && dir.isDirectory();
}

private static boolean checkFileParentExists ( final String file ) { String fileName = PathUtils . removeSlashFromEnd ( file ) ; File dir = new File ( fileName . substring ( 0 , fileName . lastIndexOf ( "/" ) + 1 ) ) ; return dir . exists ( ) && dir . isDirectory ( ) ; }
check if parent of file in param exists and is directory .
