diff options
author | kchong | 2006-08-11 19:44:22 +0000 |
---|---|---|
committer | kchong | 2006-08-11 19:44:22 +0000 |
commit | 2faa602c38ec1f581f18ae5a4c6e68536e6b953d (patch) | |
tree | 849cac71283fb4e93a38f4c5559c878d3abdde03 /bundles/org.eclipse.wst.wsi/src/org/eclipse/wst/wsi/internal/core/profile/validator/impl/message/AP1934.java | |
parent | 468603d1a8890a92ab09979f6d6d5d6a6e807f6b (diff) | |
download | webtools.webservices-200608111950.tar.gz webtools.webservices-200608111950.tar.xz webtools.webservices-200608111950.zip |
This commit was manufactured by cvs2svn to create tag 'v200608111950'.v200608111950
Diffstat (limited to 'bundles/org.eclipse.wst.wsi/src/org/eclipse/wst/wsi/internal/core/profile/validator/impl/message/AP1934.java')
-rw-r--r-- | bundles/org.eclipse.wst.wsi/src/org/eclipse/wst/wsi/internal/core/profile/validator/impl/message/AP1934.java | 103 |
1 files changed, 0 insertions, 103 deletions
diff --git a/bundles/org.eclipse.wst.wsi/src/org/eclipse/wst/wsi/internal/core/profile/validator/impl/message/AP1934.java b/bundles/org.eclipse.wst.wsi/src/org/eclipse/wst/wsi/internal/core/profile/validator/impl/message/AP1934.java deleted file mode 100644 index 1c060516d..000000000 --- a/bundles/org.eclipse.wst.wsi/src/org/eclipse/wst/wsi/internal/core/profile/validator/impl/message/AP1934.java +++ /dev/null @@ -1,103 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2002-2005 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM - Initial API and implementation - *******************************************************************************/ -package org.eclipse.wst.wsi.internal.core.profile.validator.impl.message; - -import java.util.Iterator; - -import org.eclipse.wst.wsi.internal.core.WSIException; -import org.eclipse.wst.wsi.internal.core.log.MimePart; -import org.eclipse.wst.wsi.internal.core.log.MimeParts; -import org.eclipse.wst.wsi.internal.core.profile.TestAssertion; -import org.eclipse.wst.wsi.internal.core.profile.validator.EntryContext; -import org.eclipse.wst.wsi.internal.core.profile.validator.impl.AssertionProcess; -import org.eclipse.wst.wsi.internal.core.profile.validator.impl.BaseMessageValidator; -import org.eclipse.wst.wsi.internal.core.report.AssertionResult; -import org.eclipse.wst.wsi.internal.core.util.MIMEConstants; -import org.eclipse.wst.wsi.internal.core.util.MIMEUtils; - -/** - * AP1934 - * - * <context>For a candidate part of a multipart/related message</context> - * <assertionDescription>The Content-Transfer-Encoding field of a part in a - * multipart/related message has a value of "7bit", "8bit", "binary", - * "quoted-printable" or "base64".</assertionDescription> - */ -public class AP1934 extends AssertionProcess -{ - private final BaseMessageValidator validator; - - /** - * @param WSDLValidatorImpl - */ - public AP1934(BaseMessageValidator impl) - { - super(impl); - this.validator = impl; - } - - /* Validates the test assertion. - * @see org.wsi.test.profile.validator.impl.BaseValidatorImpl.AssertionProcess#validate(org.wsi.test.profile.TestAssertion, org.wsi.test.profile.validator.EntryContext) - */ - public AssertionResult validate( - TestAssertion testAssertion, - EntryContext entryContext) - throws WSIException - { - // check for multipart/related content type - if(!entryContext.getMessageEntry().isMimeContent()) - { - result = AssertionResult.RESULT_NOT_APPLICABLE; - } - else - { - // get MIME parts - MimeParts parts = entryContext.getMessageEntry().getMimeParts(); - if(parts.count() == 0) - { - result = AssertionResult.RESULT_NOT_APPLICABLE; - } - else - { - Iterator iparts = parts.getParts().iterator(); - // check each part for the Content-Transfer-Encoding field - int i = 0; - while (iparts.hasNext()) - { - MimePart part = (MimePart)iparts.next(); - String type_value = MIMEUtils.getMimeHeaderAttribute( - part.getHeaders(), - MIMEConstants.HEADER_CONTENT_TRANSFER_ENCODING); - if (type_value != null) - { - if((type_value == null) || !(type_value.equalsIgnoreCase("7bit") || - type_value.equalsIgnoreCase("8bit") || - type_value.equalsIgnoreCase("base64") || - type_value.equalsIgnoreCase("quoted-printable") || - type_value.equalsIgnoreCase("binary"))) - { - result = AssertionResult.RESULT_FAILED; - failureDetail = validator.createFailureDetail( - "(" + (i+1) + - "), part header field \"Content-Transfer-Encoding\" has incorrect value \""+ - type_value+"\"", entryContext); - } - } - i++; - } - } - } - - // Return assertion result - return validator.createAssertionResult( - testAssertion, result, failureDetail); - } -}
\ No newline at end of file |