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

com.ja.smarkdown.preprocessing.ProcessingContext Maven / Gradle / Ivy

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

import javax.servlet.ServletContext;

import lombok.Data;

import org.apache.commons.lang3.StringUtils;

@Data
public class ProcessingContext {

	private final String path;
	private final String directory;
	private final String baseUrl;

	public static ProcessingContext create(final String path,
			final ServletContext servletContext) {
		String directory = "";
		if (path.contains("/")) {
			directory = "/" + StringUtils.substringBefore(path, "/");
		}
		return new ProcessingContext(path, directory,
				servletContext.getContextPath());
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy