All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.springframework.oxm.mime.MimeContainer Maven / Gradle / Ivy

There is a newer version: 1.5.10
Show newest version
/*
 * Copyright 2007 the original author or authors.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package org.springframework.oxm.mime;

import javax.activation.DataHandler;

/**
 * Represents a container for MIME attachments. Concrete implementations might adapt a SOAPMesage, or an email message.
 *
 * @author Arjen Poutsma
 * @see XML-binary Optimized Packaging
 * @since 1.0.0
 */
public interface MimeContainer {

    /**
     * Indicates whether this container is a XOP package.
     *
     * @return true when the constraints specified in Identifying
     *         XOP Documents are met.
     * @see XOP Packages
     */
    boolean isXopPackage();

    /**
     * Turns this message into a XOP package.
     *
     * @return true when the message is a XOP package
     * @see XOP Packages
     */
    boolean convertToXopPackage();

    /**
     * Adds the given data handler as an attachment to this container.
     *
     * @param contentId   the content id of the attachment
     * @param dataHandler the data handler containing the data of the attachment
     */
    void addAttachment(String contentId, DataHandler dataHandler);

    /**
     * Returns the attachment with the given content id, or null if not found.
     *
     * @param contentId the content id
     * @return the attachment, as a data handler
     */
    DataHandler getAttachment(String contentId);
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy