Skip to content

Instantly share code, notes, and snippets.

View fappel's full-sized avatar

Frank Appel fappel

View GitHub Profile
@rponte
rponte / DownloadFileHttpHandler.java
Last active January 23, 2022 16:30
Simple jUnit Rule to create a HttpServer
package base.junitrules;
import java.io.File;
import java.io.IOException;
import org.apache.commons.io.FileUtils;
import java.net.HttpURLConnection;
import com.sun.net.httpserver.HttpExchange;
/*******************************************************************************
* Copyright (c) 2013,2014 Rüdiger Herrmann
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Rüdiger Herrmann - initial API and implementation
* Matt Morrissette - allow to use non-static inner IgnoreConditions