Search in sources :

Example 1 with ReaderInputStream

use of org.adempiere.webui.util.ReaderInputStream in project adempiere by adempiere.

the class WFileImport method cmd_loadFile.

/**************************************************************************
	 *	Load File
	 */
private void cmd_loadFile() {
    Media media = null;
    media = Fileupload.get();
    if (media == null)
        return;
    if (media.isBinary()) {
        m_file_istream = media.getStreamData();
    } else {
        ListItem listitem = fCharset.getSelectedItem();
        if (listitem == null) {
            m_file_istream = new ReaderInputStream(media.getReaderData());
        } else {
            Charset charset = (Charset) listitem.getValue();
            m_file_istream = new ReaderInputStream(media.getReaderData(), charset.name());
        }
    }
    log.config(media.getName());
    bFile.setLabel(media.getName());
    cmd_reloadFile();
}
Also used : ReaderInputStream(org.adempiere.webui.util.ReaderInputStream) Media(org.zkoss.util.media.Media) Charset(java.nio.charset.Charset) ListItem(org.adempiere.webui.component.ListItem)

Aggregations

Charset (java.nio.charset.Charset)1 ListItem (org.adempiere.webui.component.ListItem)1 ReaderInputStream (org.adempiere.webui.util.ReaderInputStream)1 Media (org.zkoss.util.media.Media)1