mainPlugin/src/main/java/org/simpleyaml/configuration/MemorySection.java
/**
     * Creates a relative path to the given {@link ConfigurationSection} from
     * the given relative section.
     * <p>
     * You may use this method for any given {@link ConfigurationSection}, not
     * only {@link MemorySection}.
     *
     * @param section    Section to create a path for.
     * @param key        Name of the specified section.
     * @param relativeTo Section to create the path relative to.
     * @return Full path of the section from its root.
     */
Creates a relative path to the given  ConfigurationSection from
the given relative section.

You may use this method for any given  ConfigurationSection, not
only  MemorySection.

@param section    Section to create a path for.
@param key        Name of the specified section.
@param relativeTo Section to create the path relative to.
@return Full path of the section from its root.
Creates a relative path to the given ConfigurationSection from the given relative section . You may use this method for any given ConfigurationSection not only MemorySection . @param section Section to create a path for . @param key Name of the specified section . @param relativeTo Section to create the path relative to . @return Full path of the section from its root .
public static String createPath(final ConfigurationSection section, final String key, final ConfigurationSection relativeTo) {
        Validate.notNull(section, "Cannot create path without a section");
        final Configuration root = section.getRoot();
        if (root == null) {
            throw new IllegalStateException("Cannot create path without a root");
        }
        final char separator = root.options().pathSeparator();
        final StringBuilder builder = new StringBuilder();
        if (section != null) {
            for (ConfigurationSection parent = section; parent != null && parent != relativeTo; parent = parent.getParent()) {
                if (builder.length() > 0) {
                    builder.insert(0, separator);
                }
                builder.insert(0, parent.getName());
            }
        }
        if (key != null && key.length() > 0) {
            if (builder.length() > 0) {
                builder.append(separator);
            }
            builder.append(key);
        }
        return builder.toString();
    }
public static String createPath ( final ConfigurationSection section , final String key , final ConfigurationSection relativeTo ) { Validate . notNull ( section , "Cannot create path without a section" ) ; final Configuration root = section . getRoot ( ) ; if ( root == null ) { throw new IllegalStateException ( "Cannot create path without a root" ) ; } final char separator = root . options ( ) . pathSeparator ( ) ; final StringBuilder builder = new StringBuilder ( ) ; if ( section != null ) { for ( ConfigurationSection parent = section ; parent != null && parent != relativeTo ; parent = parent . getParent ( ) ) { if ( builder . length ( ) > 0 ) { builder . insert ( 0 , separator ) ; } builder . insert ( 0 , parent . getName ( ) ) ; } } if ( key != null && key . length ( ) > 0 ) { if ( builder . length ( ) > 0 ) { builder . append ( separator ) ; } builder . append ( key ) ; } return builder . toString ( ) ; }
Creates a relative path to the given {@link ConfigurationSection} from
 the given relative section.
Creates a relative path to the given { @link ConfigurationSection } from the given relative section .