org.melati.servlet
Class DefaultFileDataAdaptor
java.lang.Object
org.melati.servlet.BaseFileDataAdaptor
org.melati.servlet.DefaultFileDataAdaptor
- All Implemented Interfaces:
- FormDataAdaptor
public class DefaultFileDataAdaptor
- extends BaseFileDataAdaptor
The default way to save an uploaded file to disk.
We tell it what directory to save it in and the base URL
to that directory.
|
Method Summary |
protected java.io.File |
calculateLocalFile()
|
protected java.lang.String |
calculateURL()
Return a URL to the saved file, null if not appropriate. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
melati
protected Melati melati
uploadDir
protected java.lang.String uploadDir
uploadURL
protected java.lang.String uploadURL
makeUnique
protected boolean makeUnique
DefaultFileDataAdaptor
public DefaultFileDataAdaptor(Melati melatiP,
java.lang.String uploadDirP,
java.lang.String uploadUrlP)
- Constructor.
- Parameters:
melatiP - The current melatiuploadDirP - The directory to save this file inuploadUrlP - A URL pointing to this directory (null if there
isn't an appropriate URL)
DefaultFileDataAdaptor
public DefaultFileDataAdaptor(Melati melatiP,
java.lang.String uploadDir,
java.lang.String uploadURL,
boolean makeUnique)
- Constructor.
- Parameters:
melatiP - The current melatiuploadDir - The directory to save this file inuploadURL - A URL pointing to this directory (null if there
isn't an appropriate URL)makeUnique - Whether we should make sure the new file has a unique
name within the uploadDir directory
calculateLocalFile
protected java.io.File calculateLocalFile()
- Specified by:
calculateLocalFile in class BaseFileDataAdaptor
- Returns:
- The file in which to save the data
calculateURL
protected java.lang.String calculateURL()
- Description copied from class:
BaseFileDataAdaptor
- Return a URL to the saved file, null if not appropriate.
- Specified by:
calculateURL in class BaseFileDataAdaptor
- Returns:
- a URL to the saved file, null if not appropriate
Copyright © 2000-2008 PanEris. All Rights Reserved.