From 6ae090ae2e692e10b600d5dc35e7647918f957a0 Mon Sep 17 00:00:00 2001 From: Sebastian Sdorra Date: Thu, 5 May 2011 13:46:09 +0200 Subject: [PATCH] improve cgi api --- .../scm/web/cgi/AbstractCGIExecutor.java | 54 +++++++++++++++++++ .../java/sonia/scm/web/cgi/CGIExecutor.java | 37 ++++++++++++- 2 files changed, 90 insertions(+), 1 deletion(-) diff --git a/scm-core/src/main/java/sonia/scm/web/cgi/AbstractCGIExecutor.java b/scm-core/src/main/java/sonia/scm/web/cgi/AbstractCGIExecutor.java index 10ef6981d6..e461bc3d33 100644 --- a/scm-core/src/main/java/sonia/scm/web/cgi/AbstractCGIExecutor.java +++ b/scm-core/src/main/java/sonia/scm/web/cgi/AbstractCGIExecutor.java @@ -92,6 +92,30 @@ public abstract class AbstractCGIExecutor implements CGIExecutor return workDirectory; } + /** + * Method description + * + * + * @return + */ + @Override + public boolean isIgnoreExitCode() + { + return ignoreExitCode; + } + + /** + * Method description + * + * + * @return + */ + @Override + public boolean isPassShellEnvironment() + { + return passShellEnvironment; + } + //~--- set methods ---------------------------------------------------------- /** @@ -118,6 +142,18 @@ public abstract class AbstractCGIExecutor implements CGIExecutor this.environment = environment; } + /** + * Method description + * + * + * @param ignoreExitCode + */ + @Override + public void setIgnoreExitCode(boolean ignoreExitCode) + { + this.ignoreExitCode = ignoreExitCode; + } + /** * Method description * @@ -130,6 +166,18 @@ public abstract class AbstractCGIExecutor implements CGIExecutor this.interpreter = interpreter; } + /** + * Method description + * + * + * @param passShellEnvironment + */ + @Override + public void setPassShellEnvironment(boolean passShellEnvironment) + { + this.passShellEnvironment = passShellEnvironment; + } + /** * Method description * @@ -150,9 +198,15 @@ public abstract class AbstractCGIExecutor implements CGIExecutor /** Field description */ protected EnvList environment; + /** Field description */ + protected boolean ignoreExitCode; + /** Field description */ protected String interpreter; + /** Field description */ + protected boolean passShellEnvironment; + /** Field description */ protected File workDirectory; } diff --git a/scm-core/src/main/java/sonia/scm/web/cgi/CGIExecutor.java b/scm-core/src/main/java/sonia/scm/web/cgi/CGIExecutor.java index e1b04d5c5c..5ee852d010 100644 --- a/scm-core/src/main/java/sonia/scm/web/cgi/CGIExecutor.java +++ b/scm-core/src/main/java/sonia/scm/web/cgi/CGIExecutor.java @@ -111,11 +111,14 @@ public interface CGIExecutor public static final String ENV_SERVER_SOFTWARE = "SERVER_SOFTWARE"; /** Field description */ - public static final String RESPONSE_HEADER_CONTENT_LENGTH = "Content-Length"; + public static final String ENV_SYSTEM_ROOT = "SystemRoot"; /** Field description */ public static final String REPSONSE_HEADER_CONTENT_TYPE = "Content-Type"; + /** Field description */ + public static final String RESPONSE_HEADER_CONTENT_LENGTH = "Content-Length"; + /** Field description */ public static final String RESPONSE_HEADER_HTTP_PREFIX = "HTTP"; @@ -172,6 +175,22 @@ public interface CGIExecutor */ public File getWorkDirectory(); + /** + * Method description + * + * + * @return + */ + public boolean isIgnoreExitCode(); + + /** + * Method description + * + * + * @return + */ + public boolean isPassShellEnvironment(); + //~--- set methods ---------------------------------------------------------- /** @@ -190,6 +209,14 @@ public interface CGIExecutor */ public void setEnvironment(EnvList environment); + /** + * Method description + * + * + * @param ignoreExitCode + */ + public void setIgnoreExitCode(boolean ignoreExitCode); + /** * Method description * @@ -198,6 +225,14 @@ public interface CGIExecutor */ public void setInterpreter(String interpreter); + /** + * Method description + * + * + * @param passShellEnvironment + */ + public void setPassShellEnvironment(boolean passShellEnvironment); + /** * Method description *