本文整理汇总了Java中javax.mail.internet.ParseException类的典型用法代码示例。如果您正苦于以下问题:Java ParseException类的具体用法?Java ParseException怎么用?Java ParseException使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ParseException类属于javax.mail.internet包,在下文中一共展示了ParseException类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: sendMessage
import javax.mail.internet.ParseException; //导入依赖的package包/类
public void sendMessage (Message oMsg,
Address[] aAdrFrom, Address[] aAdrReply,
Address[] aAdrTo, Address[] aAdrCc, Address[] aAdrBcc)
throws NoSuchProviderException,SendFailedException,ParseException,
MessagingException,NullPointerException {
oMsg.addFrom(aAdrFrom);
if (null==aAdrReply)
oMsg.setReplyTo(aAdrReply);
else
oMsg.setReplyTo(aAdrFrom);
if (aAdrTo!=null) oMsg.addRecipients(javax.mail.Message.RecipientType.TO, aAdrTo);
if (aAdrCc!=null) oMsg.addRecipients(javax.mail.Message.RecipientType.CC, aAdrCc);
if (aAdrBcc!=null) oMsg.addRecipients(javax.mail.Message.RecipientType.BCC, aAdrBcc);
oMsg.setSentDate(new java.util.Date());
Transport.send(oMsg);
}
示例2: GenerateInvoiceDocumentReceiptXml
import javax.mail.internet.ParseException; //导入依赖的package包/类
public GeneratedFile GenerateInvoiceDocumentReceiptXml(String boxId, String messageId, String attachmentId, SignerProtos.Signer signer)
throws IllegalStateException, IOException, ParseException {
if (boxId == null)
throw new NullPointerException("boxId");
if (messageId == null)
throw new NullPointerException("messageId");
if (attachmentId == null)
throw new NullPointerException("attachmentId");
if (signer == null)
throw new NullPointerException("signer");
List<NameValuePair> parameters = new ArrayList<NameValuePair>();
parameters.add(new BasicNameValuePair("boxId", boxId));
parameters.add(new BasicNameValuePair("messageId", messageId));
parameters.add(new BasicNameValuePair("attachmentId", attachmentId));
HttpResponse webResponse = ReceivePostHttpResponse("/GenerateInvoiceDocumentReceiptXml", parameters, signer.toByteArray());
return new GeneratedFile(GetHttpResponseFileName(webResponse), GetResponseBytes(webResponse));
}
示例3: GenerateDocumentReceiptXml
import javax.mail.internet.ParseException; //导入依赖的package包/类
public GeneratedFile GenerateDocumentReceiptXml(String boxId, String messageId, String attachmentId, SignerProtos.Signer signer)
throws IllegalStateException, IOException, ParseException {
if (boxId == null)
throw new NullPointerException("boxId");
if (messageId == null)
throw new NullPointerException("messageId");
if (attachmentId == null)
throw new NullPointerException("attachmentId");
if (signer == null)
throw new NullPointerException("signer");
List<NameValuePair> parameters = new ArrayList<NameValuePair>();
parameters.add(new BasicNameValuePair("boxId", boxId));
parameters.add(new BasicNameValuePair("messageId", messageId));
parameters.add(new BasicNameValuePair("attachmentId", attachmentId));
HttpResponse webResponse = ReceivePostHttpResponse("/GenerateDocumentReceiptXml", parameters, signer.toByteArray());
return new GeneratedFile(GetHttpResponseFileName(webResponse), GetResponseBytes(webResponse));
}
示例4: GenerateInvoiceCorrectionRequestXml
import javax.mail.internet.ParseException; //导入依赖的package包/类
public GeneratedFile GenerateInvoiceCorrectionRequestXml(String boxId, String messageId, String attachmentId,
InvoiceCorrectionRequestInfoProtos.InvoiceCorrectionRequestInfo invoiceCorrectionInfo) throws IllegalStateException, IOException, ParseException {
if (boxId == null)
throw new NullPointerException("boxId");
if (messageId == null)
throw new NullPointerException("messageId");
if (attachmentId == null)
throw new NullPointerException("attachmentId");
List<NameValuePair> parameters = new ArrayList<NameValuePair>();
parameters.add(new BasicNameValuePair("boxId", boxId));
parameters.add(new BasicNameValuePair("messageId", messageId));
parameters.add(new BasicNameValuePair("attachmentId", attachmentId));
HttpResponse webResponse = ReceivePostHttpResponse("/GenerateInvoiceCorrectionRequestXml", parameters, invoiceCorrectionInfo.toByteArray());
return new GeneratedFile(GetHttpResponseFileName(webResponse), GetResponseBytes(webResponse));
}
示例5: GenerateRevocationRequestXml
import javax.mail.internet.ParseException; //导入依赖的package包/类
public GeneratedFile GenerateRevocationRequestXml(String boxId, String messageId, String attachmentId,
RevocationRequestInfoProtos.RevocationRequestInfo revocationRequestInfo) throws IllegalStateException, IOException, ParseException {
if (boxId == null)
throw new NullPointerException("boxId");
if (messageId == null)
throw new NullPointerException("messageId");
if (attachmentId == null)
throw new NullPointerException("attachmentId");
List<NameValuePair> parameters = new ArrayList<NameValuePair>();
parameters.add(new BasicNameValuePair("boxId", boxId));
parameters.add(new BasicNameValuePair("messageId", messageId));
parameters.add(new BasicNameValuePair("attachmentId", attachmentId));
HttpResponse webResponse = ReceivePostHttpResponse("/GenerateRevocationRequestXml", parameters, revocationRequestInfo.toByteArray());
return new GeneratedFile(GetHttpResponseFileName(webResponse), GetResponseBytes(webResponse));
}
示例6: GenerateSignatureRejectionXml
import javax.mail.internet.ParseException; //导入依赖的package包/类
public GeneratedFile GenerateSignatureRejectionXml(String boxId, String messageId, String attachmentId,
SignatureRejectionInfoProtos.SignatureRejectionInfo signatureRejectionInfo) throws IllegalStateException, IOException, ParseException {
if (boxId == null)
throw new NullPointerException("boxId");
if (messageId == null)
throw new NullPointerException("messageId");
if (attachmentId == null)
throw new NullPointerException("attachmentId");
List<NameValuePair> parameters = new ArrayList<NameValuePair>();
parameters.add(new BasicNameValuePair("boxId", boxId));
parameters.add(new BasicNameValuePair("messageId", messageId));
parameters.add(new BasicNameValuePair("attachmentId", attachmentId));
HttpResponse webResponse = ReceivePostHttpResponse("/GenerateSignatureRejectionXml", parameters, signatureRejectionInfo.toByteArray());
return new GeneratedFile(GetHttpResponseFileName(webResponse), GetResponseBytes(webResponse));
}
示例7: GenerateUniversalTransferDocumentXmlForBuyer
import javax.mail.internet.ParseException; //导入依赖的package包/类
public GeneratedFile GenerateUniversalTransferDocumentXmlForBuyer(
UniversalTransferDocumentInfoProtos.UniversalTransferDocumentBuyerTitleInfo buyerTitleInfo,
String boxId,
String sellerTitleMessageId,
String sellerTitleAttachmentId
) throws IOException, ParseException {
if (buyerTitleInfo == null) throw new NullPointerException("buyerTitleInfo");
if (boxId == null) throw new NullPointerException("boxId");
if (sellerTitleMessageId == null) throw new NullPointerException("sellerTitleMessageId");
if (sellerTitleAttachmentId == null) throw new NullPointerException("sellerTitleAttachmentId");
List<NameValuePair> parameters = new ArrayList<NameValuePair>();
parameters.add(new BasicNameValuePair("boxId", boxId));
parameters.add(new BasicNameValuePair("sellerTitleMessageId", sellerTitleMessageId));
parameters.add(new BasicNameValuePair("sellerTitleAttachmentId", sellerTitleAttachmentId));
HttpResponse httpResponse = ReceivePostHttpResponse("/GenerateUniversalTransferDocumentXmlForBuyer", parameters, buyerTitleInfo.toByteArray());
return new GeneratedFile(GetHttpResponseFileName(httpResponse), GetResponseBytes(httpResponse));
}
示例8: fromContentDisposition
import javax.mail.internet.ParseException; //导入依赖的package包/类
private static String fromContentDisposition ( final String field )
{
if ( field == null || field.isEmpty () )
{
return null;
}
try
{
final ContentDisposition cd = new ContentDisposition ( field );
return cd.getParameter ( "filename" );
}
catch ( final ParseException e )
{
return null;
}
}
示例9: processDocument
import javax.mail.internet.ParseException; //导入依赖的package包/类
public OMElement processDocument(Reader reader, String contentType,
MessageContext messageContext) throws AxisFault {
String charset;
try {
ContentType ct = new ContentType(contentType);
charset = ct.getParameter("charset");
} catch (ParseException ex) {
charset = null;
}
if (charset == null) {
charset = MessageContext.DEFAULT_CHAR_SET_ENCODING;
}
messageContext.setProperty(Constants.Configuration.CHARACTER_SET_ENCODING, charset);
return processDocument(new ReaderInputStream(reader, charset), contentType,
messageContext);
}
示例10: isAttachment
import javax.mail.internet.ParseException; //导入依赖的package包/类
@Override
public boolean isAttachment() {
boolean result = false;
String dispositionString = conn.getHeaderField(HEADER_CONTENT_DISPOSITION);
if (dispositionString != null) {
try {
ContentDisposition disposition = new ContentDisposition(dispositionString);
result = disposition.getDisposition().equals(DISPOSITION_ATTACHMENT);
} catch (ParseException e) {
}
}
return result;
}
示例11: SoapMimeMultipart
import javax.mail.internet.ParseException; //导入依赖的package包/类
public SoapMimeMultipart (@Nonnull final ESOAPVersion eSOAPVersion,
@Nonnull final Charset aCharset) throws ParseException
{
super ("related");
// type parameter is essential for Axis to work!
// But no charset! RFC 2387, section 3.4 has a special definition
final ContentType aContentType = new ContentType (contentType);
aContentType.setParameter ("type", eSOAPVersion.getMimeType ().getAsString ());
aContentType.setParameter ("charset", aCharset.name ());
contentType = aContentType.toString ();
}
示例12: GenerateTorg12XmlForBuyer
import javax.mail.internet.ParseException; //导入依赖的package包/类
public GeneratedFile GenerateTorg12XmlForBuyer(Torg12InfoProtos.Torg12BuyerTitleInfo buyerTitleInfo, String boxId, String sellerTitleMessageId, String sellerTitleAttachmentId) throws IOException, ParseException {
if (buyerTitleInfo == null) throw new NullPointerException("buyerTitleInfo");
if (boxId == null) throw new NullPointerException("boxId");
if (sellerTitleMessageId == null) throw new NullPointerException("sellerTitleMessageId");
if (sellerTitleAttachmentId == null) throw new NullPointerException("sellerTitleAttachmentId");
List<NameValuePair> parameters = new ArrayList<NameValuePair>();
parameters.add(new BasicNameValuePair("boxId", boxId));
parameters.add(new BasicNameValuePair("sellerTitleMessageId", sellerTitleMessageId));
parameters.add(new BasicNameValuePair("sellerTitleAttachmentId", sellerTitleAttachmentId));
HttpResponse httpResponse = ReceivePostHttpResponse("/GenerateTorg12XmlForBuyer", parameters, buyerTitleInfo.toByteArray());
return new GeneratedFile(GetHttpResponseFileName(httpResponse), GetResponseBytes(httpResponse));
}
示例13: GenerateTovTorg551XmlForBuyer
import javax.mail.internet.ParseException; //导入依赖的package包/类
public GeneratedFile GenerateTovTorg551XmlForBuyer(TovTorgInfoProtos.TovTorgBuyerTitleInfo buyerTitleInfo, String boxId, String sellerTitleMessageId, String sellerTitleAttachmentId) throws IOException, ParseException {
if (buyerTitleInfo == null) throw new NullPointerException("buyerTitleInfo");
if (boxId == null) throw new NullPointerException("boxId");
if (sellerTitleMessageId == null) throw new NullPointerException("sellerTitleMessageId");
if (sellerTitleAttachmentId == null) throw new NullPointerException("sellerTitleAttachmentId");
List<NameValuePair> parameters = new ArrayList<NameValuePair>();
parameters.add(new BasicNameValuePair("boxId", boxId));
parameters.add(new BasicNameValuePair("sellerTitleMessageId", sellerTitleMessageId));
parameters.add(new BasicNameValuePair("sellerTitleAttachmentId", sellerTitleAttachmentId));
HttpResponse httpResponse = ReceivePostHttpResponse("/GenerateTorg12XmlForBuyer?documentVersion=tovtorg_05_01_02", parameters, buyerTitleInfo.toByteArray());
return new GeneratedFile(GetHttpResponseFileName(httpResponse), GetResponseBytes(httpResponse));
}
示例14: GenerateAcceptanceCertificateXmlForBuyer
import javax.mail.internet.ParseException; //导入依赖的package包/类
public GeneratedFile GenerateAcceptanceCertificateXmlForBuyer(AcceptanceCertificateInfoProtos.AcceptanceCertificateBuyerTitleInfo buyerTitleInfo, String boxId, String sellerTitleMessageId,
String sellerTitleAttachmentId) throws IOException, ParseException {
if (buyerTitleInfo == null) throw new NullPointerException("buyerTitleInfo");
if (boxId == null) throw new NullPointerException("boxId");
if (sellerTitleMessageId == null) throw new NullPointerException("sellerTitleMessageId");
if (sellerTitleAttachmentId == null) throw new NullPointerException("sellerTitleAttachmentId");
List<NameValuePair> parameters = new ArrayList<NameValuePair>();
parameters.add(new BasicNameValuePair("boxId", boxId));
parameters.add(new BasicNameValuePair("sellerTitleMessageId", sellerTitleMessageId));
parameters.add(new BasicNameValuePair("sellerTitleAttachmentId", sellerTitleAttachmentId));
HttpResponse httpResponse = ReceivePostHttpResponse("/GenerateAcceptanceCertificateXmlForBuyer", parameters, buyerTitleInfo.toByteArray());
return new GeneratedFile(GetHttpResponseFileName(httpResponse), GetResponseBytes(httpResponse));
}
示例15: GenerateAcceptanceCertificate552XmlForBuyer
import javax.mail.internet.ParseException; //导入依赖的package包/类
public GeneratedFile GenerateAcceptanceCertificate552XmlForBuyer(AcceptanceCertificate552InfoProtos.AcceptanceCertificate552BuyerTitleInfo buyerTitleInfo, String boxId, String sellerTitleMessageId,
String sellerTitleAttachmentId) throws IOException, ParseException {
if (buyerTitleInfo == null) throw new NullPointerException("buyerTitleInfo");
if (boxId == null) throw new NullPointerException("boxId");
if (sellerTitleMessageId == null) throw new NullPointerException("sellerTitleMessageId");
if (sellerTitleAttachmentId == null) throw new NullPointerException("sellerTitleAttachmentId");
List<NameValuePair> parameters = new ArrayList<NameValuePair>();
parameters.add(new BasicNameValuePair("boxId", boxId));
parameters.add(new BasicNameValuePair("sellerTitleMessageId", sellerTitleMessageId));
parameters.add(new BasicNameValuePair("sellerTitleAttachmentId", sellerTitleAttachmentId));
parameters.add(new BasicNameValuePair("documentVersion", "rezru_05_01_01"));
HttpResponse httpResponse = ReceivePostHttpResponse("/GenerateAcceptanceCertificateXmlForBuyer", parameters, buyerTitleInfo.toByteArray());
return new GeneratedFile(GetHttpResponseFileName(httpResponse), GetResponseBytes(httpResponse));
}