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

org.fcrepo.http.commons.responses.LinkFormatStream Maven / Gradle / Ivy

/*
 * The contents of this file are subject to the license and copyright
 * detailed in the LICENSE and NOTICE files at the root of the source
 * tree.
 */
package org.fcrepo.http.commons.responses;

import static java.util.Objects.requireNonNull;

import java.util.stream.Stream;

import javax.ws.rs.core.Link;

/**
 * Stream of links for Memento TimeMaps
 *
 * @author whikloj
 * @since 2017-10-24
 */
public class LinkFormatStream implements AutoCloseable {

    private final Stream stream;

    /**
     * Constructor
     *
     * @param stream the stream of Links
     */
    public LinkFormatStream(final Stream stream) {
        requireNonNull(stream);
        this.stream = stream;
    }

    /**
     * Generic getter
     * 
     * @return the Stream of Links
     */
    public Stream getStream() {
        return stream;
    }

    @Override
    public void close() {
        stream.close();
    }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy