// Path: src/main/java/org/grapheco/elfinder/controller/ErrorException.java
// public class ErrorException extends RuntimeException
// {
// 
// 	private final String error;
// 	private final String[] args;
// 
// 	/**
// 	 * See /elfinder/js/i18n/elfinder.??.js for error codes.
// 	 * 
// 	 * @param error
// 	 *            The error code.
// 	 * @param args
// 	 *            Any arguments needed by the error message.
// 	 */
// 	public ErrorException(String error, String... args)
// 	{
// 		this.error = error;
// 		this.args = args;
// 	}
// 
// 	/**
// 	 * @return The error code that will translated by elfinder to a nice
// 	 *         message.
// 	 */
// 	public String getError()
// 	{
// 		return error;
// 	}
// 
// 	/**
// 	 * @return The arguments needed by the error message.
// 	 */
// 	public String[] getArgs()
// 	{
// 		return args;
// 	}
// }
// 
// Path: src/main/java/org/grapheco/elfinder/service/FsService.java
// public interface FsService
// {
// 	FsItem fromHash(String hash) throws IOException;
// 
// 	String getHash(FsItem item) throws IOException;
// 
// 	FsSecurityChecker getSecurityChecker();
// 
// 	String getVolumeId(FsVolume volume);
// 
// 	FsVolume[] getVolumes();
// 
// 	FsServiceConfig getServiceConfig();
// 
// 	/**
// 	 * find files by name pattern, this provides a simple recursively iteration
// 	 * based method lucene engines can be introduced to improve it! This
// 	 * searches across all volumes.
// 	 *
// 	 * @param filter
// 	 *            The filter to apply to select files.
// 	 * @return A collection of files that match the filter and gave the root as
// 	 *         a parent.
// 	 */
// 	// TODO: bad designs: FsItemEx should not used here top level interfaces
// 	// should only know FsItem instead of FsItemEx
// 	FsItemEx[] find(FsItemFilter filter);
// }


import java.io.PrintWriter;
import javax.servlet.ServletContext;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.grapheco.elfinder.controller.ErrorException;
import org.json.JSONArray;
import org.json.JSONObject;
import org.grapheco.elfinder.service.FsService;
package org.grapheco.elfinder.controller.executor;





public abstract class AbstractJsonCommandExecutor extends
		AbstractCommandExecutor
{
	@Override
	final public void execute(FsService fsService, HttpServletRequest request,
			HttpServletResponse response, ServletContext servletContext)
			throws Exception
	{
		JSONObject json = new JSONObject();
		try
		{
			execute(fsService, request, servletContext, json);
		}
// Path: src/main/java/org/grapheco/elfinder/controller/ErrorException.java
// public class ErrorException extends RuntimeException
// {
// 
// 	private final String error;
// 	private final String[] args;
// 
// 	/**
// 	 * See /elfinder/js/i18n/elfinder.??.js for error codes.
// 	 * 
// 	 * @param error
// 	 *            The error code.
// 	 * @param args
// 	 *            Any arguments needed by the error message.
// 	 */
// 	public ErrorException(String error, String... args)
// 	{
// 		this.error = error;
// 		this.args = args;
// 	}
// 
// 	/**
// 	 * @return The error code that will translated by elfinder to a nice
// 	 *         message.
// 	 */
// 	public String getError()
// 	{
// 		return error;
// 	}
// 
// 	/**
// 	 * @return The arguments needed by the error message.
// 	 */
// 	public String[] getArgs()
// 	{
// 		return args;
// 	}
// }
// 
// Path: src/main/java/org/grapheco/elfinder/service/FsService.java
// public interface FsService
// {
// 	FsItem fromHash(String hash) throws IOException;
// 
// 	String getHash(FsItem item) throws IOException;
// 
// 	FsSecurityChecker getSecurityChecker();
// 
// 	String getVolumeId(FsVolume volume);
// 
// 	FsVolume[] getVolumes();
// 
// 	FsServiceConfig getServiceConfig();
// 
// 	/**
// 	 * find files by name pattern, this provides a simple recursively iteration
// 	 * based method lucene engines can be introduced to improve it! This
// 	 * searches across all volumes.
// 	 *
// 	 * @param filter
// 	 *            The filter to apply to select files.
// 	 * @return A collection of files that match the filter and gave the root as
// 	 *         a parent.
// 	 */
// 	// TODO: bad designs: FsItemEx should not used here top level interfaces
// 	// should only know FsItem instead of FsItemEx
// 	FsItemEx[] find(FsItemFilter filter);
// }


// Path: src/main/java/org/grapheco/elfinder/controller/executor/AbstractJsonCommandExecutor.java
import java.io.PrintWriter;
import javax.servlet.ServletContext;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.grapheco.elfinder.controller.ErrorException;
import org.json.JSONArray;
import org.json.JSONObject;
import org.grapheco.elfinder.service.FsService;

package org.grapheco.elfinder.controller.executor;





public abstract class AbstractJsonCommandExecutor extends
		AbstractCommandExecutor
{
	@Override
	final public void execute(FsService fsService, HttpServletRequest request,
			HttpServletResponse response, ServletContext servletContext)
			throws Exception
	{
		JSONObject json = new JSONObject();
		try
		{
			execute(fsService, request, servletContext, json);
		}
		catch (ErrorException e)