본문 바로가기
코딩/JAVA

MultipartConfig와 Part인터페이스(링크)

by letsgoit39 2021. 8. 5.
728x90

https://docs.oracle.com/javaee/7/api/javax/servlet/annotation/MultipartConfig.html

 

MultipartConfig (Java(TM) EE 7 Specification APIs)

The maximum size allowed for uploaded files. The default is -1L, which means unlimited.

docs.oracle.com

Annotation that may be specified on a Servlet class, indicating that instances of the Servlet expect requests that conform to the multipart/form-data MIME type.

Servlets annotated with MultipartConfig may retrieve the Part components of a given multipart/form-data request by calling getPart or getParts.

 

Optional Element Summary

Optional ElementsModifier and TypeOptional Element and Description

int fileSizeThresholdThe size threshold after which the file will be written to disk
String locationThe directory location where files will be stored
long maxFileSizeThe maximum size allowed for uploaded files.
long maxRequestSizeThe maximum size allowed for multipart/form-data requests

 

https://docs.oracle.com/javaee/6/api/index.html

 

 

Java EE 6

 

docs.oracle.com

Method Summary

 void addHeader(java.lang.String header_name, java.lang.String header_value)
          Add this value to the existing values for this header_name.
 java.util.Enumeration getAllHeaders()
          Return all the headers from this part as an Enumeration of Header objects.
 java.lang.Object getContent()
          Return the content as a Java object.
 java.lang.String getContentType()
          Returns the Content-Type of the content of this part.
 javax.activation.DataHandler getDataHandler()
          Return a DataHandler for the content within this part.
 java.lang.String getDescription()
          Return a description String for this part.
 java.lang.String getDisposition()
          Return the disposition of this part.
 java.lang.String getFileName()
          Get the filename associated with this part, if possible.
 java.lang.String[] getHeader(java.lang.String header_name)
          Get all the headers for this header name.
 java.io.InputStream getInputStream()
          Return an input stream for this part's "content".
 int getLineCount()
          Return the number of lines in the content of this part.
 java.util.Enumeration getMatchingHeaders(java.lang.String[] header_names)
          Return matching headers from this part as an Enumeration of Header objects.
 java.util.Enumeration getNonMatchingHeaders(java.lang.String[] header_names)
          Return non-matching headers from this envelope as an Enumeration of Header objects.
 int getSize()
          Return the size of the content of this part in bytes.
 boolean isMimeType(java.lang.String mimeType)
          Is this Part of the specified MIME type? This method compares only the primaryType and subType.
 void removeHeader(java.lang.String header_name)
          Remove all headers with this name.
 void setContent(Multipart mp)
          This method sets the given Multipart object as this message's content.
 void setContent(java.lang.Object obj, java.lang.String type)
          A convenience method for setting this part's content.
 void setDataHandler(javax.activation.DataHandler dh)
          This method provides the mechanism to set this part's content.
 void setDescription(java.lang.String description)
          Set a description String for this part.
 void setDisposition(java.lang.String disposition)
          Set the disposition of this part.
 void setFileName(java.lang.String filename)
          Set the filename associated with this part, if possible.
 void setHeader(java.lang.String header_name, java.lang.String header_value)
          Set the value for this header_name.
 void setText(java.lang.String text)
          A convenience method that sets the given String as this part's content with a MIME type of "text/plain".
 void writeTo(java.io.OutputStream os)
          Output a bytestream for this Part.
728x90