org.eclipse.jetty.util
Class MultiPartInputStream.MultiPart

java.lang.Object
  extended by org.eclipse.jetty.util.MultiPartInputStream.MultiPart
All Implemented Interfaces:
Part
Enclosing class:
MultiPartInputStream

public class MultiPartInputStream.MultiPart
extends Object
implements Part


Field Summary
protected  String _contentType
           
protected  File _file
           
protected  String _filename
           
protected  MultiMap<String> _headers
           
protected  String _name
           
protected  OutputStream _out
           
protected  long _size
           
 
Constructor Summary
MultiPartInputStream.MultiPart(String name, String filename)
           
 
Method Summary
protected  void close()
           
protected  void createFile()
           
 void delete()
           
 String getContentDispositionFilename()
          Get the filename from the content-disposition.
 String getContentType()
           
 File getFile()
          Get the file, if any, the data has been written to.
 String getHeader(String name)
           
 Collection<String> getHeaderNames()
           
 Collection<String> getHeaders(String name)
           
 InputStream getInputStream()
           
 String getName()
           
 long getSize()
           
protected  void open()
           
protected  void setContentType(String contentType)
           
protected  void setHeaders(MultiMap<String> headers)
           
protected  void write(byte[] bytes, int offset, int length)
           
protected  void write(int b)
           
 void write(String fileName)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_name

protected String _name

_filename

protected String _filename

_file

protected File _file

_out

protected OutputStream _out

_contentType

protected String _contentType

_headers

protected MultiMap<String> _headers

_size

protected long _size
Constructor Detail

MultiPartInputStream.MultiPart

public MultiPartInputStream.MultiPart(String name,
                                      String filename)
                               throws IOException
Throws:
IOException
Method Detail

setContentType

protected void setContentType(String contentType)

open

protected void open()
             throws FileNotFoundException,
                    IOException
Throws:
FileNotFoundException
IOException

close

protected void close()
              throws IOException
Throws:
IOException

write

protected void write(int b)
              throws IOException,
                     ServletException
Throws:
IOException
ServletException

write

protected void write(byte[] bytes,
                     int offset,
                     int length)
              throws IOException,
                     ServletException
Throws:
IOException
ServletException

createFile

protected void createFile()
                   throws IOException
Throws:
IOException

setHeaders

protected void setHeaders(MultiMap<String> headers)

getContentType

public String getContentType()
Specified by:
getContentType in interface Part
See Also:
Part.getContentType()

getHeader

public String getHeader(String name)
Specified by:
getHeader in interface Part
See Also:
Part.getHeader(java.lang.String)

getHeaderNames

public Collection<String> getHeaderNames()
Specified by:
getHeaderNames in interface Part
See Also:
Part.getHeaderNames()

getHeaders

public Collection<String> getHeaders(String name)
Specified by:
getHeaders in interface Part
See Also:
Part.getHeaders(java.lang.String)

getInputStream

public InputStream getInputStream()
                           throws IOException
Specified by:
getInputStream in interface Part
Throws:
IOException
See Also:
Part.getInputStream()

getName

public String getName()
Specified by:
getName in interface Part
See Also:
Part.getName()

getSize

public long getSize()
Specified by:
getSize in interface Part
See Also:
Part.getSize()

write

public void write(String fileName)
           throws IOException
Specified by:
write in interface Part
Throws:
IOException
See Also:
Part.write(java.lang.String)

delete

public void delete()
            throws IOException
Specified by:
delete in interface Part
Throws:
IOException
See Also:
Part.delete()

getFile

public File getFile()
Get the file, if any, the data has been written to.

Returns:

getContentDispositionFilename

public String getContentDispositionFilename()
Get the filename from the content-disposition.

Returns:
null or the filename


Copyright © 1995-2010 Mort Bay Consulting. All Rights Reserved.