// Path: server/core/src/main/java/org/kercoin/magrit/core/Context.java
// @Singleton
// public class Context {
// 	
// 	private final Configuration configuration = new Configuration();
// 	
// 	private Injector injector;
// 	
// 	private final GitUtils gitUtils;
// 	
// 	private final ExecutorService commandRunnerPool;
// 
// 	public Context() {
// 		gitUtils = null;
// 		commandRunnerPool = null;
// 	}
// 	
// 	public Context(GitUtils gitUtils) {
// 		this(gitUtils, null);
// 	}
// 	
// 	@Inject
// 	public Context(GitUtils gitUtils,
// 			@Named("commandRunnerPool") ExecutorService commandRunnerPool) {
// 		this.gitUtils = gitUtils;
// 		this.commandRunnerPool = commandRunnerPool;
// 	}
// 
// 	public Configuration configuration() {
// 		return configuration;
// 	}
// 	
// 	public Injector getInjector() {
// 		return injector;
// 	}
// 	
// 	public ExecutorService getCommandRunnerPool() {
// 		return commandRunnerPool;
// 	}
// 	
// 	public void setInjector(Injector injector) {
// 		this.injector = injector;
// 	}
// 	
// 	public GitUtils getGitUtils() {
// 		return gitUtils;
// 	}
// 
// }
// 
// Path: server/core/src/main/java/org/kercoin/magrit/core/build/BuildResult.java
// public class BuildResult {
// 
// 	private final String sha1;
// 	
// 	private boolean success;
// 
// 	private byte[] log;
// 
// 	private Date startDate;
// 	private Date endDate;
// 
// 	private int exitCode;
// 	
// 	public BuildResult(String sha1) {
// 		this.sha1 = sha1;
// 		success = false;
// 		exitCode = -1;
// 	}
// 
// 	public void setSuccess(boolean success) {
// 		this.success = success;
// 	}
// 	
// 	public void setLog(byte[] log) {
// 		this.log = log;
// 	}
// 	
// 	public void setStartDate(Date startDate) {
// 		this.startDate = startDate;
// 	}
// 	
// 	public void setEndDate(Date endDate) {
// 		this.endDate = endDate;
// 	}
// 	
// 	public long getDuration() {
// 		if (!endDate.after(startDate)) {
// 			throw new IllegalArgumentException("End date is before start date > incoherent!");
// 		}
// 		return endDate.getTime() - startDate.getTime();
// 	}
// 
// 	public boolean isSuccess() {
// 		return success;
// 	}
// 
// 	public byte[] getLog() {
// 		return log;
// 	}
// 
// 	public Date getStartDate() {
// 		return startDate;
// 	}
// 
// 	public Date getEndDate() {
// 		return endDate;
// 	}
// 
// 	public void setExitCode(int exitCode) {
// 		this.exitCode = exitCode;
// 	}
// 	
// 	public int getExitCode() {
// 		return exitCode;
// 	}
// 
// 	public String getCommitSha1() {
// 		return sha1;
// 	}
// 
// }
// 
// Path: server/core/src/main/java/org/kercoin/magrit/core/dao/BuildDAO.java
// public interface BuildDAO {
// 	void save(BuildResult buildResult, Repository repo, String userName, Pair<Long,Integer> when);
// 	BuildResult getLast(Repository repo, String sha1);
// 	List<BuildResult> getAll(Repository repo, String sha1);
// }


import java.io.PrintStream;
import java.util.Scanner;
import org.eclipse.jgit.lib.Repository;
import org.kercoin.magrit.core.Context;
import org.kercoin.magrit.core.build.BuildResult;
import org.kercoin.magrit.core.dao.BuildDAO;
import com.google.inject.Inject;
import com.google.inject.Singleton;
/*
Copyright 2011-2012 Frederic Menou and others referred in AUTHORS file.

This file is part of Magrit.

Magrit is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as
published by the Free Software Foundation, either version 3 of
the License, or (at your option) any later version.

Magrit is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU Affero General Public License for more details.

You should have received a copy of the GNU Affero General Public
License along with Magrit.
If not, see <http://www.gnu.org/licenses/>.
*/
package org.kercoin.magrit.sshd.commands;




public class CatBuildCommand extends AbstractCommand<CatBuildCommand> {

	@Singleton
	public static class CatBuildCommandProvider implements CommandProvider<CatBuildCommand> {

		private final Context ctx;
// Path: server/core/src/main/java/org/kercoin/magrit/core/Context.java
// @Singleton
// public class Context {
// 	
// 	private final Configuration configuration = new Configuration();
// 	
// 	private Injector injector;
// 	
// 	private final GitUtils gitUtils;
// 	
// 	private final ExecutorService commandRunnerPool;
// 
// 	public Context() {
// 		gitUtils = null;
// 		commandRunnerPool = null;
// 	}
// 	
// 	public Context(GitUtils gitUtils) {
// 		this(gitUtils, null);
// 	}
// 	
// 	@Inject
// 	public Context(GitUtils gitUtils,
// 			@Named("commandRunnerPool") ExecutorService commandRunnerPool) {
// 		this.gitUtils = gitUtils;
// 		this.commandRunnerPool = commandRunnerPool;
// 	}
// 
// 	public Configuration configuration() {
// 		return configuration;
// 	}
// 	
// 	public Injector getInjector() {
// 		return injector;
// 	}
// 	
// 	public ExecutorService getCommandRunnerPool() {
// 		return commandRunnerPool;
// 	}
// 	
// 	public void setInjector(Injector injector) {
// 		this.injector = injector;
// 	}
// 	
// 	public GitUtils getGitUtils() {
// 		return gitUtils;
// 	}
// 
// }
// 
// Path: server/core/src/main/java/org/kercoin/magrit/core/build/BuildResult.java
// public class BuildResult {
// 
// 	private final String sha1;
// 	
// 	private boolean success;
// 
// 	private byte[] log;
// 
// 	private Date startDate;
// 	private Date endDate;
// 
// 	private int exitCode;
// 	
// 	public BuildResult(String sha1) {
// 		this.sha1 = sha1;
// 		success = false;
// 		exitCode = -1;
// 	}
// 
// 	public void setSuccess(boolean success) {
// 		this.success = success;
// 	}
// 	
// 	public void setLog(byte[] log) {
// 		this.log = log;
// 	}
// 	
// 	public void setStartDate(Date startDate) {
// 		this.startDate = startDate;
// 	}
// 	
// 	public void setEndDate(Date endDate) {
// 		this.endDate = endDate;
// 	}
// 	
// 	public long getDuration() {
// 		if (!endDate.after(startDate)) {
// 			throw new IllegalArgumentException("End date is before start date > incoherent!");
// 		}
// 		return endDate.getTime() - startDate.getTime();
// 	}
// 
// 	public boolean isSuccess() {
// 		return success;
// 	}
// 
// 	public byte[] getLog() {
// 		return log;
// 	}
// 
// 	public Date getStartDate() {
// 		return startDate;
// 	}
// 
// 	public Date getEndDate() {
// 		return endDate;
// 	}
// 
// 	public void setExitCode(int exitCode) {
// 		this.exitCode = exitCode;
// 	}
// 	
// 	public int getExitCode() {
// 		return exitCode;
// 	}
// 
// 	public String getCommitSha1() {
// 		return sha1;
// 	}
// 
// }
// 
// Path: server/core/src/main/java/org/kercoin/magrit/core/dao/BuildDAO.java
// public interface BuildDAO {
// 	void save(BuildResult buildResult, Repository repo, String userName, Pair<Long,Integer> when);
// 	BuildResult getLast(Repository repo, String sha1);
// 	List<BuildResult> getAll(Repository repo, String sha1);
// }


// Path: server/sshd/src/main/java/org/kercoin/magrit/sshd/commands/CatBuildCommand.java
import java.io.PrintStream;
import java.util.Scanner;
import org.eclipse.jgit.lib.Repository;
import org.kercoin.magrit.core.Context;
import org.kercoin.magrit.core.build.BuildResult;
import org.kercoin.magrit.core.dao.BuildDAO;
import com.google.inject.Inject;
import com.google.inject.Singleton;

/*
Copyright 2011-2012 Frederic Menou and others referred in AUTHORS file.

This file is part of Magrit.

Magrit is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as
published by the Free Software Foundation, either version 3 of
the License, or (at your option) any later version.

Magrit is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU Affero General Public License for more details.

You should have received a copy of the GNU Affero General Public
License along with Magrit.
If not, see <http://www.gnu.org/licenses/>.
*/
package org.kercoin.magrit.sshd.commands;




public class CatBuildCommand extends AbstractCommand<CatBuildCommand> {

	@Singleton
	public static class CatBuildCommandProvider implements CommandProvider<CatBuildCommand> {

		private final Context ctx;
		private final BuildDAO dao;