@@ -0,0 +1,2119 @@
+/**%0A * The contents of this file are subject to the OpenMRS Public License%0A * Version 1.0 (the %22License%22); you may not use this file except in%0A * compliance with the License. You may obtain a copy of the License at%0A * http://license.openmrs.org%0A *%0A * Software distributed under the License is distributed on an %22AS IS%22%0A * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the%0A * License for the specific language governing rights and limitations%0A * under the License.%0A *%0A * Copyright (C) OpenMRS, LLC.  All Rights Reserved.%0A */%0Apackage org.openmrs.customdatatype;%0A%0Aimport java.io.OutputStream;%0A%0A%0A/**%0A * Indicates that a CustomDatatypeHandler allows underlying custom values to be downloaded or streamed in some%0A * meaningful way.%0A */%0Apublic interface DownloadableDatatypeHandler%3CT%3E extends CustomDatatypeHandler%3CCustomDatatype%3CT%3E, T%3E %7B%0A%09%0A%09/**%0A     * @param dt the datatype this handler handles%0A     * @param valueReference custom value to be downloaded%0A     * @return the MIME type that should be communicated to any client downloading the given custom value.%0A     * Should not return null.%0A     */%0A    String getMimeType(CustomDatatype%3CT%3E dt, String valueReference);%0A%0A    /**%0A     * @param dt the datatype this handler handles%0A     * @param valueReference custom value to be downloaded%0A     * @return the filename that should be communicated to any client downloading the given custom value.%0A     * May return null, in which case the framework will choose a meaningless filename.%0A     */%0A    String getFilename(CustomDatatype%3CT%3E dt, String valueReference);%0A%09%0A%09/**%0A     * Writes the custom value to os. Implementations should assume that the caller has set up the stream,%0A     * calling getMimeType and getFilename if necessary.%0A     * Implementations should assume that the caller has taken care of any needed buffering on os.%0A     * %0A     * @param dt the datatype this handler handles %0A     * @param valueReference custom value to be written to os %0A     * @param os the output stream to be written to%0A     */%0A    void writeToStream(CustomDatatype%3CT%3E dt, String valueReference, OutputStream os);%0A%09%0A%7D%0A

Add DownloadableDatatypeHandler interface - TRUNK-3037