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

com.github.dynamicextensionsalfresco.controlpanel.AbstractResponseHelper Maven / Gradle / Ivy

Go to download

Adds an OSGi container to alfresco repository supporting dynamic code reloading, classpath isolation and a bunch of other useful features

There is a newer version: 3.1.0
Show newest version
package com.github.dynamicextensionsalfresco.controlpanel;

import com.github.dynamicextensionsalfresco.osgi.Configuration;
import org.springframework.extensions.webscripts.WebScriptException;
import org.springframework.extensions.webscripts.WebScriptRequest;
import org.springframework.extensions.webscripts.WebScriptResponse;

import javax.servlet.http.HttpServletResponse;

/**
 * Common response helper for API and MVC handlers.
 *
 * @author Laurent Van der Linden
 */
public abstract class AbstractResponseHelper {
	protected final WebScriptRequest request;

	protected final WebScriptResponse response;

	protected final Configuration configuration;

	protected AbstractResponseHelper(WebScriptRequest request, WebScriptResponse response, Configuration configuration) {
		this.request = request;
		this.response = response;
		this.configuration = configuration;
	}

	public void checkBundleInstallConfiguration() {
		if (!configuration.getHotDeployEnabled()) {
			throw new WebScriptException(
					HttpServletResponse.SC_FORBIDDEN,
					"osgi.container.control-panel.bundle-install is disabled"
			);
		}
	}
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy