org.apache.cocoon.servlet.multipart
Class PartOnDisk

java.lang.Object
  extended byorg.apache.cocoon.servlet.multipart.Part
      extended byorg.apache.cocoon.servlet.multipart.PartOnDisk
All Implemented Interfaces:
Disposable

public class PartOnDisk
extends Part

This class represents a file part parsed from a http post stream.

Version:
$Id: PartOnDisk.html 1304280 2012-03-23 11:18:01Z ilgrosso $

Field Summary
 
Fields inherited from class org.apache.cocoon.servlet.multipart.Part
headers
 
Constructor Summary
PartOnDisk(Map headers, File file)
          Constructor PartOnDisk
 
Method Summary
 void dispose()
          Delete the underlying file.
 void finalize()
          Ensures the underlying file has been deleted
 File getFile()
          Returns the file
 String getFileName()
          Returns the file name
 InputStream getInputStream()
          Returns a (ByteArray)InputStream containing the file data
 int getSize()
          Returns the file size in bytes
 String toString()
          Returns the filename
 
Methods inherited from class org.apache.cocoon.servlet.multipart.Part
copyToFile, copyToSource, disposeWithRequest, getHeaders, getMimeType, getUploadName, isRejected, setDisposeWithRequest
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

PartOnDisk

public PartOnDisk(Map headers,
                  File file)
Constructor PartOnDisk

Parameters:
headers -
file -
Method Detail

getFileName

public String getFileName()
Returns the file name

Specified by:
getFileName in class Part

getSize

public int getSize()
Returns the file size in bytes

Specified by:
getSize in class Part

getFile

public File getFile()
Returns the file


getInputStream

public InputStream getInputStream()
                           throws IOException
Returns a (ByteArray)InputStream containing the file data

Specified by:
getInputStream in class Part
Throws:
IOException

toString

public String toString()
Returns the filename


dispose

public void dispose()
Delete the underlying file.

Specified by:
dispose in interface Disposable
Specified by:
dispose in class Part

finalize

public void finalize()
              throws Throwable
Ensures the underlying file has been deleted

Throws:
Throwable


Copyright 1999-2008 The Apache Software Foundation. All Rights Reserved.