All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.silentgo.servlet.http.MultiPartRequest Maven / Gradle / Ivy

There is a newer version: 0.0.49
Show newest version
package com.silentgo.servlet.http;

import javax.servlet.http.HttpServletRequest;
import java.util.HashMap;
import java.util.List;

/**
 * Project : silentgo
 * com.silentgo.servlet.http
 *
 * @author teddyzhu
 *         

* Created by teddyzhu on 16/9/1. */ public class MultiPartRequest extends Request { private HashMap files; public MultiPartRequest(HttpServletRequest request, List orifiles) { super(request); this.files = new HashMap<>(); orifiles.forEach(file -> files.put(file.getFormName(), file)); } public void delete() { if (files != null && files.size() > 0) { files.forEach((k, v) -> { if (v.file.exists()) v.file.delete(); }); } } public MultiPartRequest(HttpServletRequest request) { super(request); } public MultiFile getFile(String name) { return files.get(name); } }





© 2015 - 2024 Weber Informatics LLC | Privacy Policy