ro.polak.littleServlet
Class UploadedFile

java.lang.Object
  extended by ro.polak.littleServlet.UploadedFile

public class UploadedFile
extends java.lang.Object

Uploaded file

Java Little Web Server Homepage

Version:
1.0/21.02.2008
Author:
Piotr Polak www.polak.ro

Constructor Summary
UploadedFile(MultipartHeaders h, java.io.File file)
          Constructs uploaded file
 
Method Summary
 boolean destroy()
          Deletes temporary file if unused
 java.lang.String getFileName()
          Returns the name of uploaded file
 java.lang.String getName()
          Returns the HTML form name
 boolean moveTo(java.io.File dest)
          Moves the uploaded file to the specified destination
 boolean moveTo(java.lang.String path)
          Moves the uploaded file to the specified destination
 long size()
          Returns the size (length) of uploaded file in bytes
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

UploadedFile

public UploadedFile(MultipartHeaders h,
                    java.io.File file)
Constructs uploaded file

Parameters:
h - multipart headers
file - uploaded file (temp)
Method Detail

moveTo

public boolean moveTo(java.lang.String path)
Moves the uploaded file to the specified destination

Parameters:
path - file destination
Returns:
true if file moved

moveTo

public boolean moveTo(java.io.File dest)
Moves the uploaded file to the specified destination

Parameters:
dest - file destination
Returns:
true if file moved

destroy

public boolean destroy()
Deletes temporary file if unused

Returns:
true if deleted

getName

public java.lang.String getName()
Returns the HTML form name

Returns:
the HTML form name

getFileName

public java.lang.String getFileName()
Returns the name of uploaded file

Returns:
the name of uploaded file

size

public long size()
Returns the size (length) of uploaded file in bytes

Returns:
the size (length) of uploaded file in bytes