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

com.ja.smarkdown.location.http.HttpLocation Maven / Gradle / Ivy

There is a newer version: 0.8.0
Show newest version
package com.ja.smarkdown.location.http;

import java.util.concurrent.TimeUnit;

import com.ja.smarkdown.model.config.Location;

public class HttpLocation extends Location {

	private static final String PREFIX = "http";

	private final String prefix;

	public HttpLocation(final Location location) {
		this(location, PREFIX);
	}

	protected HttpLocation(final Location location, final String prefix) {
		this.prefix = prefix;
		setConfig(location.getConfig());
		setMountPoint(location.getMountPoint());
		setUrl(location.getUrl());
		setIncludes(location.getIncludes());
		setExcludes(location.getExcludes());
		if (location.getCacheDuration() == 0) {
			setCacheDuration(TimeUnit.MINUTES.toMillis(1));
		}
	}

	public boolean isAcceptable() {
		return getUrl().startsWith(prefix);
	}

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy