/** * Return the DataFlavors for this <code>DataContentHandler</code>. * * @return The DataFlavors */ public DataFlavor[] getTransferDataFlavors() { // throws Exception; return new DataFlavor[] { getDF() }; }
/** * Return the DataFlavors for this <code>DataContentHandler</code>. * * @return The DataFlavors */ public DataFlavor[] getTransferDataFlavors() { // throws Exception; return new DataFlavor[] { getDF() }; }
/** * Write the object to the output stream, using the specified MIME type. */ public void writeTo(Object obj, String type, OutputStream os) throws IOException { if (!(obj instanceof Image)) throw new IOException("\"" + getDF().getMimeType() + "\" DataContentHandler requires Image object, " + "was given object of type " + obj.getClass().toString()); throw new IOException(getDF().getMimeType() + " encoding not supported"); } }
/** * Write the object to the output stream, using the specified MIME type. */ public void writeTo(Object obj, String type, OutputStream os) throws IOException { if (!(obj instanceof Image)) throw new IOException("\"" + getDF().getMimeType() + "\" DataContentHandler requires Image object, " + "was given object of type " + obj.getClass().toString()); throw new IOException(getDF().getMimeType() + " encoding not supported"); } }
/** * Return the Transfer Data of type DataFlavor from InputStream. * * @param df The DataFlavor * @param ds The DataSource corresponding to the data * @return String object */ public Object getTransferData(DataFlavor df, DataSource ds) throws IOException { // use myDF.equals to be sure to get ActivationDataFlavor.equals, // which properly ignores Content-Type parameters in comparison if (getDF().equals(df)) return getContent(ds); else return null; }
/** * Return the Transfer Data of type DataFlavor from InputStream. * * @param df The DataFlavor * @param ins The InputStream corresponding to the data * @return String object */ public Object getTransferData(DataFlavor df, DataSource ds) throws IOException { // use myDF.equals to be sure to get ActivationDataFlavor.equals, // which properly ignores Content-Type parameters in comparison if (getDF().equals(df)) return getContent(ds); else return null; }