📄 attachmentpart.java
字号:
if (as != null && as.length > 0) {
return as[0];
} else {
return null;
}
}
/**
* Gets the value of the MIME header "Content-Location".
*
* @return a <CODE>String</CODE> giving the value of the "Content-Location" header or
* <CODE>null</CODE> if there is none
*/
public String getContentLocation() {
String as[] = getMimeHeader("Content-Location");
if (as != null && as.length > 0) {
return as[0];
} else {
return null;
}
}
/**
* Gets the value of the MIME header "Content-Type".
*
* @return a <CODE>String</CODE> giving the value of the "Content-Type" header or
* <CODE>null</CODE> if there is none
*/
public String getContentType() {
String as[] = getMimeHeader("Content-Type");
if (as != null && as.length > 0) {
return as[0];
} else {
return null;
}
}
/**
* Sets the MIME header "Content-Id" with the given value.
*
* @param contentId a <CODE>String</CODE> giving the value of the "Content-Id" header
* @throws IllegalArgumentException
* if there was a problem with the specified <CODE> contentId</CODE> value
* @see #getContentId() getContentId()
*/
public void setContentId(String contentId) {
setMimeHeader("Content-Id", contentId);
}
/**
* Sets the MIME header "Content-Location" with the given value.
*
* @param contentLocation a <CODE>String</CODE> giving the value of the "Content-Location"
* header
* @throws IllegalArgumentException
* if there was a problem with the specified content location
*/
public void setContentLocation(String contentLocation) {
setMimeHeader("Content-Location", contentLocation);
}
/**
* Sets the MIME header "Content-Type" with the given value.
*
* @param contentType a <CODE>String</CODE> giving the value of the "Content-Type" header
* @throws IllegalArgumentException
* if there was a problem with the specified content type
*/
public void setContentType(String contentType) {
setMimeHeader("Content-Type", contentType);
}
/**
* Removes all MIME headers that match the given name.
*
* @param header - the string name of the MIME header/s to be removed
*/
public abstract void removeMimeHeader(String header);
/** Removes all the MIME header entries. */
public abstract void removeAllMimeHeaders();
/**
* Gets all the values of the header identified by the given <CODE>String</CODE>.
*
* @param name the name of the header; example: "Content-Type"
* @return a <CODE>String</CODE> array giving the value for the specified header
* @see #setMimeHeader(String, String) setMimeHeader(java.lang.String,
* java.lang.String)
*/
public abstract String[] getMimeHeader(String name);
/**
* Changes the first header entry that matches the given name to the given value, adding a new
* header if no existing header matches. This method also removes all matching headers but the
* first.
* <p/>
* <P>Note that RFC822 headers can only contain US-ASCII characters.</P>
*
* @param name a <CODE>String</CODE> giving the name of the header for which to search
* @param value a <CODE>String</CODE> giving the value to be set for the header whose name
* matches the given name
* @throws IllegalArgumentException
* if there was a problem with the specified mime header name or value
*/
public abstract void setMimeHeader(String name, String value);
/**
* Adds a MIME header with the specified name and value to this <CODE>AttachmentPart</CODE>
* object.
* <p/>
* <P>Note that RFC822 headers can contain only US-ASCII characters.</P>
*
* @param name a <CODE>String</CODE> giving the name of the header to be added
* @param value a <CODE>String</CODE> giving the value of the header to be added
* @throws IllegalArgumentException
* if there was a problem with the specified mime header name or value
*/
public abstract void addMimeHeader(String name, String value);
/**
* Retrieves all the headers for this <CODE> AttachmentPart</CODE> object as an iterator over
* the <CODE> MimeHeader</CODE> objects.
*
* @return an <CODE>Iterator</CODE> object with all of the Mime headers for this
* <CODE>AttachmentPart</CODE> object
*/
public abstract Iterator getAllMimeHeaders();
/**
* Retrieves all <CODE>MimeHeader</CODE> objects that match a name in the given array.
*
* @param names a <CODE>String</CODE> array with the name(s) of the MIME headers to be returned
* @return all of the MIME headers that match one of the names in the given array as an
* <CODE>Iterator</CODE> object
*/
public abstract Iterator getMatchingMimeHeaders(String names[]);
/**
* Retrieves all <CODE>MimeHeader</CODE> objects whose name does not match a name in the given
* array.
*
* @param names a <CODE>String</CODE> array with the name(s) of the MIME headers not to be
* returned
* @return all of the MIME headers in this <CODE> AttachmentPart</CODE> object except those that
* match one of the names in the given array. The nonmatching MIME headers are returned
* as an <CODE>Iterator</CODE> object.
*/
public abstract Iterator getNonMatchingMimeHeaders(String names[]);
public abstract java.io.InputStream getBase64Content()
throws SOAPException;
public abstract java.io.InputStream getRawContent()
throws SOAPException;
public abstract byte[] getRawContentBytes()
throws SOAPException;
public abstract void setBase64Content(java.io.InputStream inputstream,
java.lang.String s)
throws SOAPException;
public abstract void setRawContent(java.io.InputStream inputstream,
java.lang.String s)
throws SOAPException;
public abstract void setRawContentBytes(byte[] abyte0,
int i,
int j,
java.lang.String s)
throws SOAPException;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -