org.paneris.bibliomania
Class BibliomaniaFileFormDataAdaptor

java.lang.Object
  extended by org.melati.servlet.BaseFileFormDataAdaptor
      extended by org.paneris.bibliomania.BibliomaniaFileFormDataAdaptor
All Implemented Interfaces:
org.melati.servlet.FormDataAdaptor

public class BibliomaniaFileFormDataAdaptor
extends org.melati.servlet.BaseFileFormDataAdaptor

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


Field Summary
protected  boolean makeUnique
           
protected  java.lang.String path
           
protected  java.lang.String uploadDir
           
protected  java.lang.String uploadURL
           
 
Fields inherited from class org.melati.servlet.BaseFileFormDataAdaptor
BUFSIZE, field, file, url
 
Constructor Summary
BibliomaniaFileFormDataAdaptor(java.lang.String uploadDir, Book book)
          Constructor
BibliomaniaFileFormDataAdaptor(java.lang.String uploadDir, boolean makeUnique, Book book)
          Constructor
 
Method Summary
protected  java.io.File calculateLocalFile()
           
protected  java.lang.String calculateURL()
           
 
Methods inherited from class org.melati.servlet.BaseFileFormDataAdaptor
getData, getFile, getSize, getURL, readData
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

uploadDir

protected java.lang.String uploadDir

uploadURL

protected java.lang.String uploadURL

makeUnique

protected boolean makeUnique

path

protected java.lang.String path
Constructor Detail

BibliomaniaFileFormDataAdaptor

public BibliomaniaFileFormDataAdaptor(java.lang.String uploadDir,
                                      Book book)
Constructor

Parameters:
uploadDir - The directory to save this file in
book - - the book the upload is for

BibliomaniaFileFormDataAdaptor

public BibliomaniaFileFormDataAdaptor(java.lang.String uploadDir,
                                      boolean makeUnique,
                                      Book book)
Constructor

Parameters:
uploadDir - The directory to save this file in
makeUnique - Whether we should make sure the new file has a unique name within the uploadDir directory
book - - the book the upload is for
Method Detail

calculateLocalFile

protected java.io.File calculateLocalFile()
Specified by:
calculateLocalFile in class org.melati.servlet.BaseFileFormDataAdaptor

calculateURL

protected java.lang.String calculateURL()
Specified by:
calculateURL in class org.melati.servlet.BaseFileFormDataAdaptor


Copyright © 2000-2009 PanEris. All Rights Reserved.