private void createParentDirectories(File file){
  if (!file.exists()) {
    String path=file.getAbsolutePath();
    String dirs=path.substring(0,path.lastIndexOf(File.separator));
    File dir=new File(dirs);
    if (dir.exists()) {
      return;
    }
    if (!dir.mkdirs()) {
      reportError("Failed to create directories: " + dir.getAbsolutePath(),new IOException("The system cannot find the path specified: " + dir.getAbsolutePath()),ErrorManager.OPEN_FAILURE);
    }
  }
}

private void createParentDirectories ( File file ) { if ( ! file . exists ( ) ) { String path = file . getAbsolutePath ( ) ; String dirs = path . substring ( 0 , path . lastIndexOf ( File . separator ) ) ; File dir = new File ( dirs ) ; if ( dir . exists ( ) ) { return ; } if ( ! dir . mkdirs ( ) ) { reportError ( "Failed to create directories: " + dir . getAbsolutePath ( ) , new IOException ( "The system cannot find the path specified: " + dir . getAbsolutePath ( ) ) , ErrorManager . OPEN_FAILURE ) ; } } }
create all directories parent to this file .
