/*
 * $Id: ArchiveProjectForm.java,v 1.2 2007/10/12 12:38:47 korowa Exp $
 *
 * Copyright (c) Siemens AG 2008 
 *           (c) Universität Paderborn 2008 
 * Licensed under EUPL 1.1. 
 * 
 * $Log: ArchiveProjectForm.java,v $
 * Revision 1.2  2007/10/12 12:38:47  korowa
 * Beim Archivieren eines Projektes wird im Anschluss ein Link angeboten um das Archiv runterzuladen
 *
 * Revision 1.1  2006/10/04 03:14:47  marbobo
 * + Vollständige Unterstützung für Templates implementiert
 * + Alles von Virtoweb auf ProCoBa umgestellt
 *
 * Revision 1.3  2006/05/09 15:29:19  marbobo
 * + Refactoring
 *
 * Revision 1.2  2004/07/20 09:00:51  jonyp
 * added copyright info + cvs log
 *
 *
 */
package vkc.procoba.project;

import java.io.File;
import java.io.IOException;

import javax.servlet.http.HttpServletRequest;

import org.apache.struts.action.ActionMapping;

import vkc.util.VKCStringUtils;
import vkc.view.form.BasicActionForm;

public class ArchiveProjectForm extends BasicActionForm {
	protected Integer projectId = null;

	protected String archiveFilename = "";
	protected String fileSize = "";
	protected String projectName = "";
	private File archiveFile = null;

	public void reset(ActionMapping mapping, HttpServletRequest request) {
		super.reset(mapping, request);

		projectId = null;

		archiveFilename = "";
		fileSize = "";
		projectName = "";
	}

	public Integer getProjectId() {
		return projectId;
	}

	public String getProjectName() {
		return projectName;
	}

	public String getArchiveFilename() {
		return archiveFilename;
	}

	public String getFileSize() {
		return fileSize;
	}

	public void setProjectId(Integer integer) {
		projectId = integer;
	}

	public void setProjectName(String string) {
		projectName = string;
	}

	public void setArchiveFilename(String string) {
		archiveFilename = string;
	}

	public void setFileSize(String string) {
		fileSize = string;
	}
	
	public String getEncodedArchiveFilename() throws IOException {
		String name = VKCStringUtils.filterUnicodeChars(getArchiveFile().getCanonicalPath());
        
        return VKCStringUtils.base64Encode(name);
	}

	public File getArchiveFile() {
		return archiveFile;
	}

	public void setArchiveFile(File archiveFile) {
		this.archiveFile = archiveFile;
	}
}