Spring Framework CommonsMultipartFile - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Spring Framework CommonsMultipartFile class.

This code example shows how to use the following methods:getFileItem, getInputStream, isEmpty
     
    private String scenarioContent; 
    public String getScenarioContent() { 
        if (scenarioContent == null) { 
            try { 
                if (scenarioFile != null && !scenarioFile.isEmpty() && scenarioFile.getInputStream() != null) { 
                    String tmpCharset = CrawlUtils.extractCharset(scenarioFile.getInputStream()); 
                    scenarioContent = scenarioFile.getFileItem().getString(tmpCharset); 
                } 
            } catch (IOException e) {} 
        } 
        return scenarioContent; 
    } 
    /** 
     * Default constructor 
     */ 
    public AddScenarioCommand() { 
    } 
} 
5
CodeRank
This code example shows how to use the following methods:getContentType, getInputStream, getOriginalFilename
		@RequestParam("data") CommonsMultipartFile multipart, HttpServletRequest request,
		HttpServletResponse response) {
		InputStream in = null;
		OutputStream out = null;
		try { 
			in = multipart.getInputStream();
			out = this.store.write(uploadId, multipart.getOriginalFilename(), multipart.getContentType());
			IOUtils.copy(in, out);
			return this.store.getFileBean(uploadId);
		} catch (IOException e) {
			throw new RuntimeException(e.getMessage(), e);
		} finally { 
			IOUtils.closeQuietly(in);
			IOUtils.closeQuietly(out);
		} 
	} 
 
	@RequestMapping(value = "/file/status/{uploadId}", method = RequestMethod.GET)
	@ResponseBody 
	public UploadStatus getUploadStatus(@PathVariable String uploadId) {
5
CodeRank
This code example shows how to use the following methods:getInputStream
This code example shows how to use the following methods:getContentType, getOriginalFilename
     * Sets the uploaded file as a CommonsMultipartFile file.  
     *  
     * @param file  The CommonsMultipartFile file.  
     */ 
    public void setFile(CommonsMultipartFile file) {
        setOriginalName(file.getOriginalFilename());
        setMimeType(file.getContentType());
        this.file = file;
    } 
 
    /** 
     * Returns the id of the wmo table in the database. 
     *  
     * @return  The table id. 
     */ 
    public int getTableId() { 
        return tableId;
    } 
 
    /** 
4
CodeRank
This code example shows how to use the following methods:getOriginalFilename
    /** 
     * @param file the file to set 
     */ 
    public void setFile(CommonsMultipartFile file) {
        this.file = file;
        this.name = file.getOriginalFilename();
    } 
     
} 
4
CodeRank
This code example shows how to use the following methods:clone
        } 
        return fileInputList;
    } 
 
    public void setFileInputList(final CommonsMultipartFile[] fileInputList) {
        this.fileInputList = fileInputList.clone();
    } 
     
    private String scenarioName;
    public String getScenarioName() {
        return scenarioName;
    } 
 
    public void setScenarioName(String scenarioName) {
        this.scenarioName = scenarioName;
    } 
     
    private Long scenarioId;
    public Long getScenarioId() {
        return scenarioId;
3
CodeRank
See Code Examples for Spring Framework CommonsMultipartFile Methods: