mirror of
https://github.com/sbt/sbt.git
synced 2026-08-29 17:38:02 +02:00
Add support for custom protocols (#327)
* Add configuration to fetch custom protcol handlers * Tweak things Co-authored-by: Alexandre Archambault <[email protected]>
This commit is contained in:
co-authored by
Alexandre Archambault
parent
2eaf7aef43
commit
92e40c2225
+18
@@ -0,0 +1,18 @@
|
||||
package coursier.cache.protocol;
|
||||
|
||||
import java.net.URL;
|
||||
import java.net.URLConnection;
|
||||
import java.net.URLStreamHandler;
|
||||
import java.net.URLStreamHandlerFactory;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
public class CustomprotocoljavaHandler implements URLStreamHandlerFactory {
|
||||
public URLStreamHandler createURLStreamHandler(String protocol) {
|
||||
return new URLStreamHandler() {
|
||||
protected URLConnection openConnection(URL url) throws IOException {
|
||||
return new URL("https://repo1.maven.org/maven2" + url.getPath()).openConnection();
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user