Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

org.enhydra.httpServerTest.server.common
Class FileUploadMangler  view FileUploadMangler download FileUploadMangler.java

java.lang.Object
  extended byorg.enhydra.httpServerTest.server.common.FileUploadMangler
All Implemented Interfaces:
HTTPClient.FilenameMangler

public class FileUploadMangler
extends java.lang.Object
implements HTTPClient.FilenameMangler

This file implements the FilenameMangler to ensure that files uploaded to the server are save with unique file names on the file system.


Field Summary
static java.lang.Long fileNameCnt
          A static counter variable that increments for every time the mangleFilename is called.
 
Constructor Summary
FileUploadMangler()
           
 
Method Summary
 java.lang.String mangleFilename(java.lang.String filename, java.lang.String fieldname)
          This function is automatically invoked by the Codecs class when parsing multi-part mime encodings.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

fileNameCnt

public static java.lang.Long fileNameCnt
A static counter variable that increments for every time the mangleFilename is called. This object is synchronized on for thread safty.

Constructor Detail

FileUploadMangler

public FileUploadMangler()
Method Detail

mangleFilename

public java.lang.String mangleFilename(java.lang.String filename,
                                       java.lang.String fieldname)
This function is automatically invoked by the Codecs class when parsing multi-part mime encodings. This function will produce a unique extension to the supplied file name.

Specified by:
mangleFilename in interface HTTPClient.FilenameMangler