// Path: src/main/java/org/grapheco/elfinder/service/FsItem.java
// public interface FsItem
// {
// 	FsVolume getVolume();
// }
// 
// Path: src/main/java/org/grapheco/elfinder/service/FsItemFilter.java
// public interface FsItemFilter
// {
// 	// TODO: bad designs: FsItemEx should not used here
// 	// top level interfaces should only know FsItem instead of FsItemEx
// 	public boolean accepts(FsItemEx item);
// }
// 
// 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/service/FsVolume.java
// public interface FsVolume
// {
// 	void createFile(FsItem fsi) throws IOException;
// 
// 	void createFolder(FsItem fsi) throws IOException;
// 
// 	void deleteFile(FsItem fsi) throws IOException;
// 
// 	void deleteFolder(FsItem fsi) throws IOException;
// 
// 	boolean exists(FsItem newFile);
// 
// 	FsItem fromPath(String relativePath);
// 
// 	String getDimensions(FsItem fsi);
// 
// 	long getLastModified(FsItem fsi);
// 
// 	String getMimeType(FsItem fsi);
// 
// 	String getName();
// 
// 	String getName(FsItem fsi);
// 
// 	FsItem getParent(FsItem fsi);
// 
// 	String getPath(FsItem fsi) throws IOException;
// 
// 	FsItem getRoot();
// 
// 	long getSize(FsItem fsi) throws IOException;
// 
// 	String getThumbnailFileName(FsItem fsi);
// 
// 	boolean hasChildFolder(FsItem fsi);
// 
// 	boolean isFolder(FsItem fsi);
// 
// 	boolean isRoot(FsItem fsi);
// 
// 	FsItem[] listChildren(FsItem fsi);
// 
// 	InputStream openInputStream(FsItem fsi) throws IOException;
// 
// 	void writeStream(FsItem f, InputStream is) throws IOException;
// 
// 	void rename(FsItem src, FsItem dst) throws IOException;
// 
// 	/**
// 	 * Gets the URL for the supplied item.
// 	 * 
// 	 * @param f
// 	 *            The item to get the URL for.
// 	 * @return An absolute URL or <code>null</code> if we should not send back a
// 	 *         URL.
// 	 */
// 	String getURL(FsItem f);
// 
// 	/**
// 	 * This allows volumes to change the options returned to the client for a
// 	 * particular item. Implementations should update the map they are passed.
// 	 * 
// 	 * @param f
// 	 *            The item to filter the options for.
// 	 * @param map
// 	 *            The options that are going to be returned.
// 	 */
// 	void filterOptions(FsItem f, Map<String, Object> map);
// }


import java.io.IOException;
import java.io.InputStream;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import org.grapheco.elfinder.service.FsItem;
import org.grapheco.elfinder.service.FsItemFilter;
import org.grapheco.elfinder.service.FsService;
import org.grapheco.elfinder.service.FsVolume;
package org.grapheco.elfinder.controller.executor;



/**
 * FsItemEx is a helper class of a FsItem, A FsItemEx wraps a FsItem and its
 * context including FsService, FsVolume, etc
 * 
 * @author bluejoe
 *
 */
public class FsItemEx
{
	private FsItem _f;

	private FsService _s;

	private FsVolume _v;

// Path: src/main/java/org/grapheco/elfinder/service/FsItem.java
// public interface FsItem
// {
// 	FsVolume getVolume();
// }
// 
// Path: src/main/java/org/grapheco/elfinder/service/FsItemFilter.java
// public interface FsItemFilter
// {
// 	// TODO: bad designs: FsItemEx should not used here
// 	// top level interfaces should only know FsItem instead of FsItemEx
// 	public boolean accepts(FsItemEx item);
// }
// 
// 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/service/FsVolume.java
// public interface FsVolume
// {
// 	void createFile(FsItem fsi) throws IOException;
// 
// 	void createFolder(FsItem fsi) throws IOException;
// 
// 	void deleteFile(FsItem fsi) throws IOException;
// 
// 	void deleteFolder(FsItem fsi) throws IOException;
// 
// 	boolean exists(FsItem newFile);
// 
// 	FsItem fromPath(String relativePath);
// 
// 	String getDimensions(FsItem fsi);
// 
// 	long getLastModified(FsItem fsi);
// 
// 	String getMimeType(FsItem fsi);
// 
// 	String getName();
// 
// 	String getName(FsItem fsi);
// 
// 	FsItem getParent(FsItem fsi);
// 
// 	String getPath(FsItem fsi) throws IOException;
// 
// 	FsItem getRoot();
// 
// 	long getSize(FsItem fsi) throws IOException;
// 
// 	String getThumbnailFileName(FsItem fsi);
// 
// 	boolean hasChildFolder(FsItem fsi);
// 
// 	boolean isFolder(FsItem fsi);
// 
// 	boolean isRoot(FsItem fsi);
// 
// 	FsItem[] listChildren(FsItem fsi);
// 
// 	InputStream openInputStream(FsItem fsi) throws IOException;
// 
// 	void writeStream(FsItem f, InputStream is) throws IOException;
// 
// 	void rename(FsItem src, FsItem dst) throws IOException;
// 
// 	/**
// 	 * Gets the URL for the supplied item.
// 	 * 
// 	 * @param f
// 	 *            The item to get the URL for.
// 	 * @return An absolute URL or <code>null</code> if we should not send back a
// 	 *         URL.
// 	 */
// 	String getURL(FsItem f);
// 
// 	/**
// 	 * This allows volumes to change the options returned to the client for a
// 	 * particular item. Implementations should update the map they are passed.
// 	 * 
// 	 * @param f
// 	 *            The item to filter the options for.
// 	 * @param map
// 	 *            The options that are going to be returned.
// 	 */
// 	void filterOptions(FsItem f, Map<String, Object> map);
// }


// Path: src/main/java/org/grapheco/elfinder/controller/executor/FsItemEx.java
import java.io.IOException;
import java.io.InputStream;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import org.grapheco.elfinder.service.FsItem;
import org.grapheco.elfinder.service.FsItemFilter;
import org.grapheco.elfinder.service.FsService;
import org.grapheco.elfinder.service.FsVolume;

package org.grapheco.elfinder.controller.executor;



/**
 * FsItemEx is a helper class of a FsItem, A FsItemEx wraps a FsItem and its
 * context including FsService, FsVolume, etc
 * 
 * @author bluejoe
 *
 */
public class FsItemEx
{
	private FsItem _f;

	private FsService _s;

	private FsVolume _v;

	public FsItemEx(FsItem fsi, FsService fsService)