类 MockPart

    • 方法详细资料

      • getSize

        public long getSize()
        从接口复制的说明: javax.servlet.http.Part
        Returns the size of this fille.
        指定者:
        getSize 在接口中 Part
        返回:
        a long specifying the size of this part, in bytes.
      • write

        public void write​(String fileName)
                   throws IOException
        从接口复制的说明: javax.servlet.http.Part
        A convenience method to write this uploaded item to disk.

        This method is not guaranteed to succeed if called more than once for the same part. This allows a particular implementation to use, for example, file renaming, where possible, rather than copying all of the underlying data, thus gaining a significant performance benefit.

        指定者:
        write 在接口中 Part
        参数:
        fileName - The location into which the uploaded part should be stored. The value may be a file name or a path. The actual location of the file in the filesystem is relative to MultipartConfigElement.getLocation(). Absolute paths are used as provided and are relative to getLocation(). Note: that this is a system dependent string and URI notation may not be acceptable on all systems. For portability, this string should be generated with the File or Path APIs.
        抛出:
        IOException - if an error occurs.
      • getHeader

        @Nullable
        public String getHeader​(String name)
        从接口复制的说明: javax.servlet.http.Part
        Returns the value of the specified mime header as a String. If the Part did not include a header of the specified name, this method returns null. If there are multiple headers with the same name, this method returns the first header in the part. The header name is case insensitive. You can use this method with any request header.
        指定者:
        getHeader 在接口中 Part
        参数:
        name - a String specifying the header name
        返回:
        a String containing the value of the requested header, or null if the part does not have a header of that name
      • getHeaders

        public Collection<StringgetHeaders​(String name)
        从接口复制的说明: javax.servlet.http.Part
        Gets the values of the Part header with the given name.

        Any changes to the returned Collection must not affect this Part.

        Part header names are case insensitive.

        指定者:
        getHeaders 在接口中 Part
        参数:
        name - the header name whose values to return
        返回:
        a (possibly empty) Collection of the values of the header with the given name
      • getHeaderNames

        public Collection<StringgetHeaderNames()
        从接口复制的说明: javax.servlet.http.Part
        Gets the header names of this Part.

        Some servlet containers do not allow servlets to access headers using this method, in which case this method returns null

        Any changes to the returned Collection must not affect this Part.

        指定者:
        getHeaderNames 在接口中 Part
        返回:
        a (possibly empty) Collection of the header names of this Part
      • getHeaders

        public final HttpHeaders getHeaders()
        Return the HttpHeaders backing header related accessor methods, allowing for populating selected header entries.