org.apache.cocoon.components.source.impl
Class PartSource

java.lang.Object
  extended byorg.apache.cocoon.components.source.impl.PartSource
All Implemented Interfaces:
Source

public class PartSource
extends Object
implements Source

Implementation of a Source that gets its content from a PartOnDisk or PartInMemory held in the Request when a file is uploaded.

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

Constructor Summary
PartSource(String uri, Map objectModel)
          Builds a PartSource given an URI.
 
Method Summary
 boolean exists()
           
 long getContentLength()
           
 InputStream getInputStream()
           
 long getLastModified()
           
 String getMimeType()
           
 Part getPart()
           
 String getScheme()
           
 String getURI()
           
 SourceValidity getValidity()
           
 void refresh()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PartSource

public PartSource(String uri,
                  Map objectModel)
           throws MalformedURLException,
                  SourceException
Builds a PartSource given an URI.

Parameters:
uri - e.g., upload://formField1
Throws:
SourceException
MalformedURLException
Method Detail

getInputStream

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

getMimeType

public String getMimeType()
Specified by:
getMimeType in interface Source
See Also:
Source.getMimeType()

exists

public boolean exists()
Specified by:
exists in interface Source
Returns:
true if the resource exists.

getURI

public String getURI()
Specified by:
getURI in interface Source

getScheme

public String getScheme()
Specified by:
getScheme in interface Source

getValidity

public SourceValidity getValidity()
Specified by:
getValidity in interface Source

refresh

public void refresh()
Specified by:
refresh in interface Source
See Also:
Source.refresh()

getContentLength

public long getContentLength()
Specified by:
getContentLength in interface Source
See Also:
Source.getContentLength()

getLastModified

public long getLastModified()
Specified by:
getLastModified in interface Source
See Also:
Source.getLastModified()

getPart

public Part getPart()


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