code: public static void createParentDirectoryIfNecessary(final File file) {
          final File parentDirectory = file.getParentFile();
          if (parentDirectory == null || parentDirectory.mkdirs() || parentDirectory.exists()) {
              return;
  	}
          throw new SdkClientException("Unable to create directory in the path: " + parentDirectory.getAbsolutePath());
      }
docs: Creates the parent directory for a file if it doesn't already exist.
  @param file
  @throws SdkClientException when creation of parent directory failed.