当前位置: 首页>>代码示例>>Java>>正文


Java UploadItem.getData方法代码示例

本文整理汇总了Java中org.richfaces.model.UploadItem.getData方法的典型用法代码示例。如果您正苦于以下问题:Java UploadItem.getData方法的具体用法?Java UploadItem.getData怎么用?Java UploadItem.getData使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.richfaces.model.UploadItem的用法示例。


在下文中一共展示了UploadItem.getData方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: onReadAvailableLanguages

import org.richfaces.model.UploadItem; //导入方法依赖的package包/类
public void onReadAvailableLanguages(ActionEvent event) throws IOException {
    this.availableLanguages.clear();

    for (UploadItem item : this.uploadedConcepts) {
        byte[] fileData;
        if (item.isTempFile()) {
            fileData = FileUtils.readFileToByteArray(item.getFile());
        } else {
            fileData = item.getData();
        }

        String xml = new String(fileData);

        String[] languages = metaDataFacade.getLanguagesAvailableForImport(
                xml);

        for (String lang : languages) {
            lang = lang.replaceAll("-", "_");
            Locale locale = LocaleUtils.toLocale(lang);
            this.availableLanguages.put(locale.getDisplayLanguage(), lang);
        }
    }
}
 
开发者ID:getconverge,项目名称:converge-1.x,代码行数:24,代码来源:Concepts.java

示例2: onImport

import org.richfaces.model.UploadItem; //导入方法依赖的package包/类
/**
 * Event handler for importing the uploaded subject files.
 *
 * @param event Event that invoked the handler
 * @throws IOException If any of the uploaded files could not be read
 */
public void onImport(ActionEvent event) throws IOException {
    int imported = 0;
    for (UploadItem item : this.uploadedConcepts) {

        byte[] fileData;
        if (item.isTempFile()) {
            fileData = FileUtils.readFileToByteArray(item.getFile());
        } else {
            fileData = item.getData();
        }

        String xml = new String(fileData);

        if (getImportLanguage() != null) {
            imported += metaDataFacade.importKnowledgeItem(xml,
                    getImportLanguage());
        }
    }

    JsfUtils.createMessage("frmSubjects", FacesMessage.SEVERITY_INFO, Bundle.i18n.name(),
            "Concepts_X_SUBJECTS_IMPORTED", new Object[]{imported});
}
 
开发者ID:getconverge,项目名称:converge-1.x,代码行数:29,代码来源:Concepts.java

示例3: carregaFoto

import org.richfaces.model.UploadItem; //导入方法依赖的package包/类
public void carregaFoto(UploadEvent event) throws Exception {
	UploadItem item = event.getUploadItem();
	foto = new Foto();
	foto.setTamanho(item.getData().length);
	foto.setArquivo(item.getFileName());
	foto.setDados(item.getData());
	ImageIcon temp = new ImageIcon(item.getData());
	foto.setLargura(temp.getIconWidth());
	foto.setAltura(temp.getIconHeight());
	listaFoto.add(foto);
	contaArquivos--;
}
 
开发者ID:herculeshssj,项目名称:imobiliariaweb,代码行数:13,代码来源:ImovelController.java

示例4: attachQuestionImage

import org.richfaces.model.UploadItem; //导入方法依赖的package包/类
/**
 * @param editQuestion
 * @param uploadItem
 * @throws IOException
 */
protected void attachQuestionImage(QuestionVO editQuestion, UploadItem uploadItem) throws IOException {
	byte[] imgBytes = uploadItem.getData();
	
	ByteArrayInputStream inputStream = new ByteArrayInputStream(imgBytes);
	
	BufferedImage bufferedImage = ImageIO.read(inputStream);
	
	List<ImageVO> images = editQuestion.getImageVOs();
	
	ImageVO imageVO = new ImageVO();
	
	imageVO.setImage(bufferedImage);
	
	images.add(imageVO);
	
}
 
开发者ID:darciopacifico,项目名称:omr,代码行数:22,代码来源:QuestionnaireJSFBean.java


注:本文中的org.richfaces.model.UploadItem.getData方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。