mirror of
https://github.com/sbt/sbt.git
synced 2026-09-03 16:39:24 +02:00
Copy local artifact to cache (#831)
This commit is contained in:
committed by
Alexandre Archambault
parent
07989f0040
commit
c469899040
@@ -36,14 +36,14 @@ public class CachePath {
|
||||
return ch > 128 || " %$&+,:;=?@<>#%".indexOf(ch) >= 0;
|
||||
}
|
||||
|
||||
public static File localFile(String url, File cache, String user) throws MalformedURLException {
|
||||
public static File localFile(String url, File cache, String user, boolean localArtifactsShouldBeCached) throws MalformedURLException {
|
||||
|
||||
// use the File constructor accepting a URI in case of problem with the two cases below?
|
||||
|
||||
if (url.startsWith("file:///"))
|
||||
if (url.startsWith("file:///") && !localArtifactsShouldBeCached)
|
||||
return new File(url.substring("file://".length()));
|
||||
|
||||
if (url.startsWith("file:/"))
|
||||
if (url.startsWith("file:/") && !localArtifactsShouldBeCached)
|
||||
return new File(url.substring("file:".length()));
|
||||
|
||||
String[] split = url.split(":", 2);
|
||||
|
||||
Reference in New Issue
Block a user