// Path: src/main/java/net/pterodactylus/fcp/FileEntry.java
// static class DirectFileEntry extends FileEntry {
// 
// 	/** The content type of the data. */
// 	private final String contentType;
// 
// 	/** The length of the data. */
// 	private final long length;
// 
// 	/** The input stream of the data. */
// 	private final InputStream inputStream;
// 
// 	/**
// 	 * Creates a new direct file entry with content type auto-detection.
// 	 *
// 	 * @param name
// 	 *            The name of the file
// 	 * @param length
// 	 *            The length of the file
// 	 * @param inputStream
// 	 *            The input stream of the file
// 	 */
// 	public DirectFileEntry(String name, long length, InputStream inputStream) {
// 		this(name, null, length, inputStream);
// 	}
// 
// 	/**
// 	 * Creates a new direct file entry.
// 	 *
// 	 * @param name
// 	 *            The name of the file
// 	 * @param contentType
// 	 *            The content type of the file, or <code>null</code> to let
// 	 *            the node auto-detect it
// 	 * @param length
// 	 *            The length of the file
// 	 * @param inputStream
// 	 *            The input stream of the file
// 	 */
// 	public DirectFileEntry(String name, String contentType, long length, InputStream inputStream) {
// 		super(name, UploadFrom.direct);
// 		this.contentType = contentType;
// 		this.length = length;
// 		this.inputStream = inputStream;
// 	}
// 
// 	/**
// 	 * {@inheritDoc}
// 	 */
// 	@Override
// 	Map<String, String> getFields() {
// 		Map<String, String> fields = new HashMap<String, String>();
// 		fields.put("Name", name);
// 		fields.put("UploadFrom", String.valueOf(uploadFrom));
// 		fields.put("DataLength", String.valueOf(length));
// 		if (contentType != null) {
// 			fields.put("Metadata.ContentType", contentType);
// 		}
// 		return fields;
// 	}
// 
// 	/**
// 	 * Returns the input stream of the file.
// 	 *
// 	 * @return The input stream of the file
// 	 */
// 	InputStream getInputStream() {
// 		return inputStream;
// 	}
// 
// }


import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.SequenceInputStream;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import net.pterodactylus.fcp.FileEntry.DirectFileEntry;
	 *            <code>true</code> to encode the complete data early,
	 *            <code>false</code> otherwise
	 */
	public void setEarlyEncode(boolean earlyEncode) {
		setField("EarlyEncode", String.valueOf(earlyEncode));
	}

	/**
	 * Sets the default name. This is the name of the file that should be shown
	 * if no file was specified.
	 *
	 * @param defaultName
	 *            The default name
	 */
	public void setDefaultName(String defaultName) {
		setField("DefaultName", defaultName);
	}

	/**
	 * Adds an entry for a file.
	 *
	 * @param fileEntry
	 *            The file entry to add
	 */
	public void addFileEntry(FileEntry fileEntry) {
		Map<String, String> fields = fileEntry.getFields();
		for (Entry<String, String> fieldEntry : fields.entrySet()) {
			setField("Files." + fileIndex + "." + fieldEntry.getKey(), fieldEntry.getValue());
		}
		fileIndex++;
// Path: src/main/java/net/pterodactylus/fcp/FileEntry.java
// static class DirectFileEntry extends FileEntry {
// 
// 	/** The content type of the data. */
// 	private final String contentType;
// 
// 	/** The length of the data. */
// 	private final long length;
// 
// 	/** The input stream of the data. */
// 	private final InputStream inputStream;
// 
// 	/**
// 	 * Creates a new direct file entry with content type auto-detection.
// 	 *
// 	 * @param name
// 	 *            The name of the file
// 	 * @param length
// 	 *            The length of the file
// 	 * @param inputStream
// 	 *            The input stream of the file
// 	 */
// 	public DirectFileEntry(String name, long length, InputStream inputStream) {
// 		this(name, null, length, inputStream);
// 	}
// 
// 	/**
// 	 * Creates a new direct file entry.
// 	 *
// 	 * @param name
// 	 *            The name of the file
// 	 * @param contentType
// 	 *            The content type of the file, or <code>null</code> to let
// 	 *            the node auto-detect it
// 	 * @param length
// 	 *            The length of the file
// 	 * @param inputStream
// 	 *            The input stream of the file
// 	 */
// 	public DirectFileEntry(String name, String contentType, long length, InputStream inputStream) {
// 		super(name, UploadFrom.direct);
// 		this.contentType = contentType;
// 		this.length = length;
// 		this.inputStream = inputStream;
// 	}
// 
// 	/**
// 	 * {@inheritDoc}
// 	 */
// 	@Override
// 	Map<String, String> getFields() {
// 		Map<String, String> fields = new HashMap<String, String>();
// 		fields.put("Name", name);
// 		fields.put("UploadFrom", String.valueOf(uploadFrom));
// 		fields.put("DataLength", String.valueOf(length));
// 		if (contentType != null) {
// 			fields.put("Metadata.ContentType", contentType);
// 		}
// 		return fields;
// 	}
// 
// 	/**
// 	 * Returns the input stream of the file.
// 	 *
// 	 * @return The input stream of the file
// 	 */
// 	InputStream getInputStream() {
// 		return inputStream;
// 	}
// 
// }


// Path: src/main/java/net/pterodactylus/fcp/ClientPutComplexDir.java
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.SequenceInputStream;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import net.pterodactylus.fcp.FileEntry.DirectFileEntry;

	 *            <code>true</code> to encode the complete data early,
	 *            <code>false</code> otherwise
	 */
	public void setEarlyEncode(boolean earlyEncode) {
		setField("EarlyEncode", String.valueOf(earlyEncode));
	}

	/**
	 * Sets the default name. This is the name of the file that should be shown
	 * if no file was specified.
	 *
	 * @param defaultName
	 *            The default name
	 */
	public void setDefaultName(String defaultName) {
		setField("DefaultName", defaultName);
	}

	/**
	 * Adds an entry for a file.
	 *
	 * @param fileEntry
	 *            The file entry to add
	 */
	public void addFileEntry(FileEntry fileEntry) {
		Map<String, String> fields = fileEntry.getFields();
		for (Entry<String, String> fieldEntry : fields.entrySet()) {
			setField("Files." + fileIndex + "." + fieldEntry.getKey(), fieldEntry.getValue());
		}
		fileIndex++;
		if (fileEntry instanceof FileEntry.DirectFileEntry) {