code: public void writeToDirectory(@NotNull LanguageProfile languageProfile, @NotNull File fullPath) throws IOException {
          if (!fullPath.exists()) {
              throw new IOException("Path does not exist: "+fullPath);
          }
          if (!fullPath.canWrite()) {
              throw new IOException("Path not writable: "+fullPath);
          }
          File file = new File(fullPath.getAbsolutePath()+"/"+languageProfile.getLocale());
          if (file.exists()) {
              throw new IOException("File exists already, refusing to overwrite: "+file);
          }
          try (FileOutputStream output = new FileOutputStream(file)) {
              write(languageProfile, output);
          }
      }
docs: Writes a {@link LanguageProfile} to a folder using the language name as the file name.
  
  @param fullPath Must be an existing writable directory path.
  @throws java.io.IOException if such a file name exists already.