/*
 * $Id: StreamConversionRequest.java,v 1.3 2004/02/25 18:35:08 koppy Exp $
 *
 * Copyright (c) Siemens AG 2008 
 *           (c) Universität Paderborn 2008 
 * Licensed under EUPL 1.1. 
 *
 * $Log: StreamConversionRequest.java,v $
 * Revision 1.3  2004/02/25 18:35:08  koppy
 * Bestimmung der docTypeId
 *
 * Revision 1.2  2004/02/24 09:23:22  koppy
 * + toString()
 *
 * Revision 1.1  2004/01/16 14:19:40  koppy
 * Initiale Version
 *
 */
package vkc.converter.common;


import java.util.Collection;

import vkc.util.VKCInputStream;


/**
 * This class represents a request for the ConverterServer.
 * It contains all neccessary information for a conversion
 * of a file
 * 
 * @author koppy
 */
public class StreamConversionRequest extends ConversionRequest {

	private transient VKCInputStream is;
	private boolean zipped = false;	
	private String rootFilename = null;
	private long size = 0;
	private int docType;
	
	/**
	 * Constructs a converter request 
	 *
	 * @param is for this inputstream 
	 * @param docType for this docType
	 */
	public StreamConversionRequest( VKCInputStream is , int docType){
		super();
		this.docType = docType;	
		this.is = is;
		this.size = is.getLength();
	}

	/**
	 * Constructs a converter request 
	 *	 
	 * @param is for this inputstream	 
	 * @param docType for this docType
	 * @param conversions for this desired output conversions
	 * (collection of type VKCDocumentType)
	 */
	public StreamConversionRequest( VKCInputStream is, int docType, Collection conversions){
		super( conversions );
		this.docType = docType;
		this.is = is;
		this.size = is.getLength();
	}
	
	
	
	/**
	 * Returns the inputstream of the file to be converted
	 * @return
	 */
	public VKCInputStream getInputStream() {
		return is;
	}

	/**
	 * @return
	 */
	public String getRootFilename() {
		return rootFilename;
	}

	/**
	 * @return
	 */
	public boolean isZipped() {
		return zipped;
	}

	/**
	 * @param string
	 */
	public void setRootFilename(String string) {
		rootFilename = string;
	}

	/**
	 * @param b
	 */
	public void setZipped(boolean b) {
		zipped = b;
	}
	
	
	/**
	 * Returns the length of the inputstream
	 * @return
	 */
	public long getSize(){
		return size;	
	}

	/* (non-Javadoc)
	 * @see java.lang.Object#toString()
	 */
	public String toString() {
		return "Streamconversion: docTypeId=" + this.getDocTypeId() + ", size=" + this.getSize();
	}

	/**
	 * @return
	 */
	public int getDocTypeId() {
		return docType;
	}

}
