Spring Framework ByteArrayMultipartFileEditor - 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 ByteArrayMultipartFileEditor class.

This code example shows how to use the following methods:
	private IndexAccessorService indexAccessorService;
 
	protected void initBinder(HttpServletRequest request,
			ServletRequestDataBinder binder) throws ServletException {
 
		binder.registerCustomEditor(byte[].class, new ByteArrayMultipartFileEditor());
	} 
 
	public ModelAndView onSubmit(Object command) throws Exception {
		FileDocumentHolder holder=(FileDocumentHolder)command;
		try { 
			indexAccessorService.addDocument(holder);
		} catch(FileExtensionNotSupportedException ex) {
			return new ModelAndView("indexing/documentNotAdded", "filename", holder.getFilename());
		} 
		return new ModelAndView("indexing/documentAdded", "filename", holder.getFilename());
	} 
 
	public IndexAccessorService getIndexAccessorService() { 
		return indexAccessorService;
5
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:
@RequestMapping("/metadatas") 
@Controller 
public class MetadataController implements UiController { 
    @InitBinder 
    void initBinder(WebDataBinder binder) {
        binder.registerCustomEditor(byte[].class, new ByteArrayMultipartFileEditor());
    } 
 
    @ModelAttribute("datasets") 
    public Collection<Dataset> populateDatasets(@RequestParam(value = "dataset", required = false) Long datasetId) throws SecurityException {
        Dataset dataset = Dataset.findDataset(datasetId);
        if (dataset != null)
            SecurityUtils.checkDatasetOwnership(dataset);
        return Arrays.asList(dataset);
    } 
     
    @RequestMapping(method = RequestMethod.POST)
    public String create(@Valid Metadata metadata, BindingResult bindingResult, Model uiModel, HttpServletRequest httpServletRequest) throws SecurityException {
        SecurityUtils.checkDatasetOwnership(metadata.getDataset());
        if (bindingResult.hasErrors()) {
4
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:
        binder.registerCustomEditor(Integer.class, null, 
                                    new CustomNumberEditor(Integer.class, null, true)); 
        binder.registerCustomEditor(Long.class, null, 
                                    new CustomNumberEditor(Long.class, null, true)); 
        binder.registerCustomEditor(byte[].class, 
                                    new ByteArrayMultipartFileEditor()); 
        SimpleDateFormat dateFormat =  
            new SimpleDateFormat(getText("date.format", request.getLocale())); 
        dateFormat.setLenient(false); 
        binder.registerCustomEditor(Date.class, null,  
                                    new CustomDateEditor(dateFormat, true)); 
    } 
 
    /** 
     * Convenience message to send messages to users, includes app URL as footer. 
     * @param user the user to send a message to. 
     * @param msg the message to send. 
     * @param url the URL of the application. 
     */ 
    protected void sendUserMessage(User user, String msg, String url) { 
4
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:
        binder.registerCustomEditor(Integer.class, null, 
                                    new CustomNumberEditor(Integer.class, null, true)); 
        binder.registerCustomEditor(Long.class, null, 
                                    new CustomNumberEditor(Long.class, null, true)); 
        binder.registerCustomEditor(byte[].class, 
                                    new ByteArrayMultipartFileEditor()); 
        SimpleDateFormat dateFormat =  
            new SimpleDateFormat(getText("date.format", request.getLocale())); 
        dateFormat.setLenient(false); 
        binder.registerCustomEditor(Date.class, null,  
                                    new CustomDateEditor(dateFormat, true)); 
    } 
 
    /** 
     * Convenience message to send messages to users, includes app URL as footer. 
     * @param user the user to send a message to. 
     * @param msg the message to send. 
     * @param url the URL of the application. 
     */ 
    protected void sendUserMessage(User user, String msg, String url) { 
4
CodeRank
Experience pair programming with AI  Get Codota for Java