org.apache.cocoon.servlet.multipart
Class PartOnDisk

java.lang.Object
  extended by org.apache.cocoon.servlet.multipart.Part
      extended by org.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 1304258 2012-03-23 10:09:27Z ilgrosso $
Author:
Jeroen ter Voorde

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

Overrides:
toString in class Object

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

Overrides:
finalize in class Object
Throws:
Throwable


Copyright © 1999-2010 The Apache Software Foundation. All Rights Reserved.