/** * This is a convenience method that can be used to determine * the length of the message body. This will determine if there * is a <code>Content-Length</code> header, if it does then the * length can be determined, if not then this returns -1. * * @return the content length, or -1 if it cannot be determined */ protected long getContentLength() { return segment.getContentLength(); } }
/** * This is used to acquire the content type for this part. This * is typically the type of content for a file part, as provided * by a MIME type from the HTTP "Content-Type" header. * * @return this returns the content type for the part object */ public ContentType getContentType() { return segment.getContentType(); }
/** * This is used to acquire the content disposition for the part. * The content disposition contains the Content-Disposition header * details sent with the part in the multipart request body. * * @return value of the header mapped to the specified name */ public ContentDisposition getDisposition() { return segment.getDisposition(); }
/** * This is used to acquire the header value for the specified * header name. Providing the header values through this method * ensures any special processing for a know content type can be * handled by an application. * * @param name the name of the header to get the value for * * @return value of the header mapped to the specified name */ public String getHeader(String name) { return segment.getValue(name); } }
/** * This is used to extract information from the HTTP header that * can be used to determine the type of the body. This will look * at the HTTP headers provided to find a specific token which * enables it to determine how to consume the body. * * @param segment this is the header associated with the body * * @return true if the body is to be consumed as a chunked body */ protected boolean isChunked(Segment segment) { String encoding = segment.getTransferEncoding(); if(encoding != null) { if(encoding.equals(CHUNKED)) { return true; } } return false; }
/** * This is used to acquire the header value for the specified * header name. Providing the header values through this method * ensures any special processing for a know content type can be * handled by an application. * * @param name the name of the header to get the value for * * @return value of the header mapped to the specified name */ public String getHeader(String name) { return segment.getValue(name); } }
/** * This is used to extract information from the HTTP header that * can be used to determine the type of the body. This will look * at the HTTP headers provided to find a specific token which * enables it to determine how to consume the body. * * @param segment this is the header associated with the body * * @return true if the body is to be consumed as a chunked body */ protected boolean isChunked(Segment segment) { String encoding = segment.getTransferEncoding(); if(encoding != null) { if(encoding.equals(CHUNKED)) { return true; } } return false; }
/** * This is used to acquire the content type for this part. This * is typically the type of content for a file part, as provided * by a MIME type from the HTTP "Content-Type" header. * * @return this returns the content type for the part object */ public ContentType getContentType() { return segment.getContentType(); }
/** * This is a convenience method that can be used to determine * the length of the message body. This will determine if there * is a <code>Content-Length</code> header, if it does then the * length can be determined, if not then this returns -1. * * @return the content length, or -1 if it cannot be determined */ protected long getContentLength() { return segment.getContentLength(); } }
/** * This is used to acquire the content disposition for the part. * The content disposition contains the Content-Disposition header * details sent with the part in the multipart request body. * * @return value of the header mapped to the specified name */ public ContentDisposition getDisposition() { return segment.getDisposition(); }
/** * This is used to acquire the header value for the specified * header name. Providing the header values through this method * ensures any special processing for a know content type can be * handled by an application. * * @param name the name of the header to get the value for * * @return value of the header mapped to the specified name */ public String getHeader(String name) { return segment.getValue(name); } }
/** * This is used to extract information from the HTTP header that * can be used to determine the type of the body. This will look * at the HTTP headers provided to find a specific token which * enables it to determine how to consume the body. * * @param segment this is the header associated with the body * * @return true if the body is to be consumed as a chunked body */ protected boolean isChunked(Segment segment) { String encoding = segment.getTransferEncoding(); if(encoding != null) { if(encoding.equals(CHUNKED)) { return true; } } return false; }
/** * This is used to acquire the content type for this part. This * is typically the type of content for a file part, as provided * by a MIME type from the HTTP "Content-Type" header. * * @return this returns the content type for the part object */ public ContentType getContentType() { return segment.getContentType(); }
/** * This is a convenience method that can be used to determine * the length of the message body. This will determine if there * is a <code>Content-Length</code> header, if it does then the * length can be determined, if not then this returns -1. * * @return the content length, or -1 if it cannot be determined */ protected long getContentLength() { return segment.getContentLength(); } }
/** * This is used to acquire the content disposition for the part. * The content disposition contains the Content-Disposition header * details sent with the part in the multipart request body. * * @return value of the header mapped to the specified name */ public ContentDisposition getDisposition() { return segment.getDisposition(); }
/** * This is used to extract information from the HTTP header that * can be used to determine the type of the body. This will look * at the HTTP headers provided to find a specific token which * enables it to determine how to consume the body. * * @param segment this is the header associated with the body * * @return true if the content type is that of a multipart body */ protected boolean isUpload(Segment segment) { ContentType type = segment.getContentType(); if(type != null) { String token = type.getPrimary(); if(token.equals(MULTIPART)) { return true; } } return false; }
/** * This is used to extract information from the HTTP header that * can be used to determine the type of the body. This will look * at the HTTP headers provided to find a specific token which * enables it to determine how to consume the body. * * @param segment this is the header associated with the body * * @return true if there was a content length in the header */ protected boolean isFixed(Segment segment) { long length = segment.getContentLength(); if(length > 0) { return true; } return false; }
/** * This is used to extract information from the HTTP header that * can be used to determine the type of the body. This will look * at the HTTP headers provided to find a specific token which * enables it to determine how to consume the body. * * @param segment this is the header associated with the body * * @return true if the content type is that of a multipart body */ protected boolean isUpload(Segment segment) { ContentType type = segment.getContentType(); if(type != null) { String token = type.getPrimary(); if(token.equals(MULTIPART)) { return true; } } return false; }
/** * This is used to extract information from the HTTP header that * can be used to determine the type of the body. This will look * at the HTTP headers provided to find a specific token which * enables it to determine how to consume the body. * * @param segment this is the header associated with the body * * @return true if there was a content length in the header */ protected boolean isFixed(Segment segment) { long length = segment.getContentLength(); if(length > 0) { return true; } return false; }
/** * This is used to extract information from the HTTP header that * can be used to determine the type of the body. This will look * at the HTTP headers provided to find a specific token which * enables it to determine how to consume the body. * * @param header this is the header associated with the body * * @return the boundary for a multipart upload body */ protected byte[] getBoundary(Segment header) { ContentType type = header.getContentType(); if(type != null) { String token = type.getParameter(BOUNDARY); if(token != null) { return token.getBytes(); } } return null; }