protected Object getData(ActivationDataFlavor aFlavor, DataSource ds) throws IOException { if (aFlavor.getRepresentationClass() == String.class) return super.getContent(ds); else if (aFlavor.getRepresentationClass() == StreamSource.class) return new StreamSource(ds.getInputStream()); else return null; // XXX - should never happen }
@Override protected Object getData(ActivationDataFlavor aFlavor, DataSource ds) throws IOException { if (aFlavor.getRepresentationClass() == String.class) return super.getContent(ds); else if (aFlavor.getRepresentationClass() == StreamSource.class) return new StreamSource(ds.getInputStream()); else return null; // XXX - should never happen }
@Override protected Object getData(ActivationDataFlavor aFlavor, DataSource ds) throws IOException { if (aFlavor.getRepresentationClass() == String.class) return super.getContent(ds); else if (aFlavor.getRepresentationClass() == StreamSource.class) return new StreamSource(ds.getInputStream()); else return null; // XXX - should never happen }
@Override protected Object getData(ActivationDataFlavor aFlavor, DataSource ds) throws IOException { if (aFlavor.getRepresentationClass() == String.class) return super.getContent(ds); else if (aFlavor.getRepresentationClass() == StreamSource.class) return new StreamSource(ds.getInputStream()); else return null; // XXX - should never happen }
/** * 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; }
@Override protected Object getData(ActivationDataFlavor aFlavor, DataSource ds) throws IOException { if (aFlavor.getRepresentationClass() == String.class) return super.getContent(ds); else if (aFlavor.getRepresentationClass() == StreamSource.class) return new StreamSource(ds.getInputStream()); else return null; // XXX - should never happen }
@Override protected Object getData(ActivationDataFlavor aFlavor, DataSource ds) throws IOException { if (aFlavor.getRepresentationClass() == String.class) return super.getContent(ds); else if (aFlavor.getRepresentationClass() == StreamSource.class) return new StreamSource(ds.getInputStream()); else return null; // XXX - should never happen }
@Override protected Object getData(ActivationDataFlavor aFlavor, DataSource ds) throws IOException { if (aFlavor.getRepresentationClass() == String.class) return super.getContent(ds); else if (aFlavor.getRepresentationClass() == StreamSource.class) return new StreamSource(ds.getInputStream()); else return null; // XXX - should never happen }
/** * 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 ds the InputStream corresponding to the data * @return the constructed Object */ public Object getTransferData(DataFlavor df, DataSource ds) throws IOException { for (int i = 0; i < flavors.length; i++) { DataFlavor aFlavor = flavors[i]; if (aFlavor.equals(df)) { if (aFlavor.getRepresentationClass() == String.class) return super.getContent(ds); else if (aFlavor.getRepresentationClass() == StreamSource.class) return new StreamSource(ds.getInputStream()); else return null; // XXX - should never happen } } return null; }