|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.cocoon.servlet.multipart.Part org.apache.cocoon.servlet.multipart.RejectedPart
public class RejectedPart
An upload part that was rejected because request length exceeded the maximum upload size.
Field Summary | |
---|---|
int |
contentLength
|
int |
maxContentLength
|
Fields inherited from class org.apache.cocoon.servlet.multipart.Part |
---|
headers |
Constructor Summary | |
---|---|
RejectedPart(Map headers,
int partSize,
int contentLength,
int maxContentLength)
|
Method Summary | |
---|---|
void |
dispose()
Dispose any resources held by this part, such as a file or memory buffer. |
int |
getContentLength()
Get the content length of the request that cause this part to be rejected. |
String |
getFileName()
Returns the filename |
InputStream |
getInputStream()
Always throw an IOException as this part was rejected. |
int |
getMaxContentLength()
Get the maximum allowed upload size. |
int |
getSize()
Get the size of this part. |
boolean |
isRejected()
Always return true |
Methods inherited from class org.apache.cocoon.servlet.multipart.Part |
---|
copyToFile, copyToSource, disposeWithRequest, getHeaders, getMimeType, getUploadName, setDisposeWithRequest |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public int contentLength
public int maxContentLength
Constructor Detail |
---|
public RejectedPart(Map headers, int partSize, int contentLength, int maxContentLength)
Method Detail |
---|
public String getFileName()
Part
getFileName
in class Part
public int getSize()
getSize
in class Part
public int getMaxContentLength()
This means that an upload part can be rejected although it's individual size is (a bit) smaller
than the maximum size. It is therefore advisable to use getContentLength()
to build
error messages rather than getSize()
.
public int getContentLength()
public InputStream getInputStream() throws IOException
IOException
as this part was rejected.
getInputStream
in class Part
IOException
public boolean isRejected()
true
isRejected
in class Part
true
if this part was rejectedpublic void dispose()
Part
Disposal occurs in all cases when the part is garbage collected, but calling it explicitely allows to cleanup resources more quickly.
dispose
in interface Disposable
dispose
in class Part
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |