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

org.unitedinternet.cosmo.ext.UrlContentSource Maven / Gradle / Ivy

package org.unitedinternet.cosmo.ext;

import java.util.Set;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;
import org.unitedinternet.cosmo.model.NoteItem;

/**
 * ContentSource component that can read ICS content from public URL-s like HTTP URL-s or local file URL-s.
 * 
 * @author daniel grigore
 * @author corneliu dobrota
 *
 */
@Component
public class UrlContentSource implements ContentSource {

    private final UrlContentReader contentReader;

    @Value("${external.content.connection.timeout}")
    private int timeoutInMillis;

    public UrlContentSource(UrlContentReader contentReader) {
        super();
        this.contentReader = contentReader;
    }

    @Override
    public Set getContent(String url) {
        return this.contentReader.getContent(url, this.timeoutInMillis);
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy