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

net.anotheria.anosite.cms.action.filehandling.ShowTmpFileAction Maven / Gradle / Ivy

The newest version!
package net.anotheria.anosite.cms.action.filehandling;

import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;

import net.anotheria.asg.util.filestorage.TemporaryFileHolder;
import net.anotheria.maf.action.ActionCommand;
import net.anotheria.maf.action.ActionMapping;

/**
 * @author another
 */
public class ShowTmpFileAction extends BaseFileHandlingAction {

	public ActionCommand execute(ActionMapping mapping, HttpServletRequest req, HttpServletResponse res) throws Exception {
		TemporaryFileHolder h = getTemporaryFile(req);
		byte[] data = h.getData();
		res.getOutputStream().write(data);
		res.getOutputStream().flush();
		return null;
	}
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy