Here you can find the source of createProperties(final Path directory, final Properties properties)
static Path createProperties(final Path directory, final Properties properties) throws ClassNotFoundException, NoSuchMethodException, IllegalAccessException, IllegalArgumentException, InvocationTargetException, IOException
//package com.java2s; //License from project: Apache License import java.io.IOException; import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; import java.nio.file.Files; import java.nio.file.Path; import java.util.Objects; import java.util.Properties; public class Main { static Path createProperties(final Path directory, final Properties properties) throws ClassNotFoundException, NoSuchMethodException, IllegalAccessException, IllegalArgumentException, InvocationTargetException, IOException { Objects.requireNonNull(directory, "directory"); Objects.requireNonNull(properties, "properties"); if (!Files.isDirectory(directory)) { throw new IllegalArgumentException("directory " + directory + " must be a directory"); }/*from w w w .j a v a2 s .c om*/ Path configurationFile = directory.resolve(getConfigurationFileName()); properties.store(Files.newOutputStream(configurationFile), "configuration"); return configurationFile; } private static String getConfigurationFileName() throws ClassNotFoundException, NoSuchMethodException, IllegalAccessException, IllegalArgumentException, InvocationTargetException { Class<?> clazz = Class.forName("com.cardshifter.core.modloader.ModLoaderHelper"); Method method = clazz.getDeclaredMethod("getConfigurationFileName"); method.setAccessible(true); return (String) method.invoke(null); } }