PropertiesFile (@NotNull Project project, Properties properties, String fileName) { ByteArrayOutputStream stream = new ByteArrayOutputStream(); try { properties.store(stream, ""); } catch (IOException e) { throw new RuntimeException(e); } @NonNls String filename = fileName + "." + PropertiesFileType.INSTANCE.getDefaultExtension(); return (PropertiesFile)PsiFileFactory.getInstance(project) .createFileFromText(filename, PropertiesFileType.INSTANCE, stream.toString()); }