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

org.ansj.dic.impl.Url2Stream Maven / Gradle / Ivy

There is a newer version: 5.1.6
Show newest version
package org.ansj.dic.impl;

import java.io.InputStream;
import java.net.URL;

import org.ansj.dic.PathToStream;
import org.ansj.exception.LibraryException;

/**
 * url://http://maven.nlpcn.org/down/library/default.dic
 * 
 * @author ansj
 *
 */
public class Url2Stream extends PathToStream {

	@Override
	public InputStream toStream(String path) {
		try {
			URL url = new URL(path);
			return url.openStream();
		} catch (Exception e) {
			throw new LibraryException("err to load by http " + path + " message : " + e.getMessage());
		}

	}

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy