Пример #1
0
  /**
   * Return the DataFlavors for this <code>DataContentHandler</code>.
   *
   * @return the DataFlavors
   */
  public DataFlavor[] getTransferDataFlavors() {

    if (transferFlavors == null) {
      if (dch != null) { // is there a dch?
        transferFlavors = dch.getTransferDataFlavors();
      } else {
        transferFlavors = new DataFlavor[1];
        transferFlavors[0] = new ActivationDataFlavor(ds.getContentType(), ds.getContentType());
      }
    }
    return transferFlavors;
  }
Пример #2
0
 /** Write the object to the output stream. */
 public void writeTo(Object obj, String mimeType, OutputStream os) throws IOException {
   if (dch != null) dch.writeTo(obj, mimeType, os);
   else throw new UnsupportedDataTypeException("no DCH for content type " + ds.getContentType());
 }
Пример #3
0
 /**
  * Return the MIME type of this object as retrieved from the source object. Note that this is the
  * <i>full</i> type with parameters.
  *
  * @return the MIME type
  */
 public String getContentType() {
   if (dataSource != null) // data source case
   return dataSource.getContentType();
   else return objectMimeType; // obj/type case
 }