All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.xbib.io.ftp.fs.LinkOptionSupport Maven / Gradle / Ivy

package org.xbib.io.ftp.fs;

import java.nio.file.LinkOption;

/**
 * A utility class for {@link LinkOption}s.
 */
public final class LinkOptionSupport {

    private LinkOptionSupport() {
        throw new Error("cannot create instances of " + getClass().getName());
    }

    /**
     * Returns whether or not the given link options indicate that links should be followed.
     *
     * @param options The link options to check.
     * @return {@code false} if one of the given link options is {@link LinkOption#NOFOLLOW_LINKS}, or {@code true} otherwise.
     */
    public static boolean followLinks(LinkOption... options) {
        for (LinkOption option : options) {
            if (option == LinkOption.NOFOLLOW_LINKS) {
                return false;
            }
        }
        return true;
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy