Nitido Inc.

com.nitido.nimbox.http
Class UploadedFile

java.lang.Object
  extended by com.nitido.nimbox.http.UploadedFile
All Implemented Interfaces:
java.io.Serializable

public class UploadedFile
extends java.lang.Object
implements java.io.Serializable

This class provides an abstract representation of a file that was uploaded by through the MultipartRequestParser implementation.

See Also:
Serialized Form

Constructor Summary
UploadedFile(java.lang.String dir, java.lang.String fileName, java.lang.String originalName, java.lang.String contentType, long size)
          Class constructor
 
Method Summary
 void clean()
          This method is used to remove the uploaded file from the disk.
 java.io.File getFile()
          This method returns a File pointer of the uploaded file.
 java.lang.String getFileName()
          This method returns the name of the uploaded file.
 java.io.InputStream getInputStream()
          This method returns a reference to InputStream for the uploaded file.
 java.lang.String getMimeType()
          This method returns the mime type of the uploaded file.
 java.lang.String getOriginalFileName()
          This method returns the original name of the uploaded file.
 long getSize()
          This method returns the size of the uploaded file.
 java.lang.String toString()
          Override java.lang.Object's toString().
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

UploadedFile

public UploadedFile(java.lang.String dir,
                    java.lang.String fileName,
                    java.lang.String originalName,
                    java.lang.String contentType,
                    long size)
Class constructor

Parameters:
dir - The directory where the file is stored.
fileName - The name of the files as stored in the given directory.
originalName - The original name of the file.
contentType - The mime type of the uploaded file.
size - The size of the uploaded file.
Method Detail

getFileName

public java.lang.String getFileName()
This method returns the name of the uploaded file.

Returns:
The name of the uploaded file as stored in the file system.

getOriginalFileName

public java.lang.String getOriginalFileName()
This method returns the original name of the uploaded file.

Returns:
The original name of the uploaded file

getMimeType

public java.lang.String getMimeType()
This method returns the mime type of the uploaded file.

Returns:
The mime type of the uploaded file or null if the mime type was not available.

getSize

public long getSize()
This method returns the size of the uploaded file.

Returns:
The size of the uploaded file in bytes.

getFile

public java.io.File getFile()
This method returns a File pointer of the uploaded file.

Returns:
Reference to the abstract file pointer of the uploaded file.

getInputStream

public java.io.InputStream getInputStream()
                                   throws java.io.FileNotFoundException
This method returns a reference to InputStream for the uploaded file.

Returns:
Reference to a BufferedInputStream to the uploaded file
Throws:
java.io.FileNotFoundException - If the uploaded file no longer exists.

clean

public void clean()
           throws java.lang.SecurityException
This method is used to remove the uploaded file from the disk.

Throws:
java.lang.SecurityException - If a security manager exists and its SecurityManager.checkDelete(java.lang.String) method denies delete access to the file

toString

public java.lang.String toString()
Override java.lang.Object's toString(). This method is mainly used for debugging.

Overrides:
toString in class java.lang.Object

Nitido NiM 2.5 Java API

These JavaDoc pages are generated for release/nim_2_5-2.5.44

Copyright © 1999-2009 Nitido Inc.    Proprietary and Confidential.    All Rights Reserved.