org.davesag.generica.controller
Class SimpleUploadController
java.lang.Object
org.davesag.generica.controller.AbstractController
org.davesag.generica.controller.AbstractActionController
org.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.
Constants.UPLOADED_FILE_NAME - the name of the file
Constants.UPLOADED_FILE_PATH - the full path to the
file
Constants.UPLOADED_FILE_SIZE - the file size in
bytes
Constants.UPLOADED_FILE_TYPE - the file content type
- 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
|
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 java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
SimpleUploadController
public SimpleUploadController()
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.