com.seajas.search.bridge.contender.metadata.URIReadConverter.java Source code

Java tutorial

Introduction

Here is the source code for com.seajas.search.bridge.contender.metadata.URIReadConverter.java

Source

/**
 * Copyright (C) 2013 Seajas, the Netherlands.
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 3, as
 * published by the Free Software Foundation.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
package com.seajas.search.bridge.contender.metadata;

import com.sun.syndication.feed.synd.SyndEntry;
import com.sun.syndication.io.FeedException;
import com.sun.syndication.io.SyndFeedInput;
import java.io.StringReader;
import java.net.URI;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.core.convert.converter.Converter;
import org.springframework.data.convert.ReadingConverter;

/**
 * Convert the given URI to a Mongo object.
 *
 * @author Jasper van Veghel <jasper@seajas.com>
 */
@ReadingConverter
public class URIReadConverter implements Converter<String, URI> {
    /**
     * The logger.
     */
    private static final Logger logger = LoggerFactory.getLogger(URIReadConverter.class);

    /**
     * {@inheritDoc}
     */
    @Override
    public URI convert(final String source) {
        return URI.create(source);
    }
}