private static void createFile(File file) throws IOException {
  if (!file.exists()) {
    createDirectory(file.getParent());
    if (!file.createNewFile()) {
      throw new IOException("Failed to create " + file.getPath());
    }
  }
}

private static void createFile ( File file ) throws IOException { if ( ! file . exists ( ) ) { createDirectory ( file . getParent ( ) ) ; if ( ! file . createNewFile ( ) ) { throw new IOException ( "Failed to create " + file . getPath ( ) ) ; } } }
creates a file including parent directories if it does not yet exist .
