org.davesag.generica.controller
Class SimpleUploadController

java.lang.Object
  extended byorg.davesag.generica.controller.AbstractController
      extended byorg.davesag.generica.controller.AbstractActionController
          extended byorg.davesag.generica.controller.SimpleUploadController
All Implemented Interfaces:
ActionController, Controller, UploadController

public class SimpleUploadController
extends AbstractActionController
implements UploadController

Writes the uploaded data to a file at the path specified. Does nothing clever. This controller also saves meta data on the file to the request under the following keys.

Since:
Generica 1.0
Version:
CVS Revision $Id: SimpleUploadController.java,v 1.3 2004/03/30 13:00:40 davesag Exp $
Author:
Dave Sag http://www.davesag.com

Field Summary
 
Fields inherited from class org.davesag.generica.controller.AbstractActionController
theAction
 
Fields inherited from class org.davesag.generica.controller.AbstractController
theForm, theRequest, theResponse, theSession
 
Constructor Summary
SimpleUploadController()
           
 
Method Summary
static boolean makeFolders(String path)
          makes the directories needed to write to a file at the given path.
 void writeFormData(String path)
          Writes the uploaded data in the form to a file on disk.
 
Methods inherited from class org.davesag.generica.controller.AbstractActionController
getAction, getMessages, setAction
 
Methods inherited from class org.davesag.generica.controller.AbstractController
getApplication, getForm, getLocale, getRequest, getResponse, getSession, setForm, setRequest, setResponse
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.davesag.generica.controller.ActionController
setAction
 
Methods inherited from interface org.davesag.generica.controller.Controller
setForm, setRequest, setResponse
 

Constructor Detail

SimpleUploadController

public SimpleUploadController()
Method Detail

writeFormData

public void writeFormData(String path)
                   throws IOException
Writes the uploaded data in the form to a file on disk.

Specified by:
writeFormData in interface UploadController
Parameters:
path - The path that the form data should be written to.
Throws:
IOException - if something went wrong.

makeFolders

public static boolean makeFolders(String path)
                           throws IOException
makes the directories needed to write to a file at the given path.

Parameters:
path - The path to turn into a nested set of folders.
Returns:
true if it worked.
Throws:
IOException - if the path is not valid.


Dave Sag Generica API version 0.5.9 - (prerelease) Copyright 2003 - 2004 Dave Sag.