This commit is contained in:
comp500 2019-06-01 12:41:33 +01:00
parent 86c2349fd3
commit 2118a8fda1
3 changed files with 5 additions and 2 deletions

View File

@ -30,6 +30,10 @@ public abstract class HandlerManager {
}
return loc;
}
// TODO: What if files are read multiple times??
// Zip handler discards once read, requesting multiple times on other handlers would cause multiple downloads
// Caching system? Copy from already downloaded files?
public static InputStream getFileInputStream(URI loc) throws Exception {
for (IRequestHandler handler : handlers) {

View File

@ -16,6 +16,7 @@ public interface IRequestHandler {
/**
* Gets the InputStream for a location. Must be threadsafe.
* It is assumed that each location is read only once for the duration of an IRequestHandler.
* @param loc The location to be read
* @return The InputStream containing the data of the file
* @throws Exception

View File

@ -1,8 +1,6 @@
package link.infra.packwiz.installer.request.handlers;
import java.io.IOException;
import java.io.InputStream;
import java.net.MalformedURLException;
import java.net.URI;
import java.net.URLConnection;