src/main/java/me/matata/matamenu/general/config/Config.java
public static void save(File file, Class root) {
        try {
            if (!file.exists()) {
                file.getParentFile().mkdirs();
                file.createNewFile();
            }
            try (PrintWriter writer = new PrintWriter(file)) {
                Object instance = root.newInstance();
                save(writer, root, instance, 0);
            }
        } catch (Throwable e) {
            e.printStackTrace();
        }
    }
/**
     * Set all values in the file (load first to avoid overwriting)
     *
     * @param file
     * @param root
     */
Set all values in the file (load first to avoid overwriting)
@param file
@param root
Set all values in the file ( load first to avoid overwriting ) @param file @param root
public static void save(File file, Class root) {
        try {
            if (!file.exists()) {
                file.getParentFile().mkdirs();
                file.createNewFile();
            }
            try (PrintWriter writer = new PrintWriter(file)) {
                Object instance = root.newInstance();
                save(writer, root, instance, 0);
            }
        } catch (Throwable e) {
            e.printStackTrace();
        }
    }
public static void save ( File file , Class root ) { try { if ( ! file . exists ( ) ) { file . getParentFile ( ) . mkdirs ( ) ; file . createNewFile ( ) ; } try ( PrintWriter writer = new PrintWriter ( file ) ) { Object instance = root . newInstance ( ) ; save ( writer , root , instance , 0 ) ; } } catch ( Throwable e ) { e . printStackTrace ( ) ; } }
Set all values in the file (load first to avoid overwriting)
 @param file
 @param root
Set all values in the file ( load first to avoid overwriting ) @param file @param root