feat: add parse function to Filename

This commit is contained in:
TopchetoEU 2023-11-25 18:44:27 +02:00
parent 86d205e521
commit e1ce384815
Signed by: topchetoeu
GPG Key ID: 6531B8583E5F6ED4

View File

@ -51,4 +51,10 @@ public class Filename {
this.protocol = protocol;
this.path = path;
}
public static Filename parse(String val) {
var i = val.indexOf("://");
if (i >= 0) return new Filename(val.substring(0, i).trim(), val.substring(i + 3).trim());
else return new Filename("file", val.trim());
}
}