auth.scheme = UriParser.extractScheme(uri, name);
// Expecting "//"
if (name.length() < 2 || name.charAt(0) != '/' || name.charAt(1) != '/')
{
throw new FileSystemException("vfs.provider/missing-double-slashes.error", uri);
}
name.delete(0, 2);
// Extract userinfo, and split into username and password
final String userInfo = extractUserInfo(name);
final String userName;
final String password;
if (userInfo != null)
{
int idx = userInfo.indexOf(':');
if (idx == -1)
{
userName = userInfo;
password = "";
}
else
{
userName = userInfo.substring(0, idx);
password = userInfo.substring(idx + 1);
}
}
else
{
userName = "";
password = "";
}
auth.userName = UriParser.decode(userName);
auth.password = UriParser.decode(password);
// Extract hostname, and normalise (lowercase)
final String hostName = extractHostName(name);
if (hostName == null)
{
throw new FileSystemException("vfs.provider/missing-hostname.error", uri);
}
auth.hostName = hostName; //.toLowerCase();
// Extract port
auth.port = extractPort(name, uri);
// Expecting '/' or empty name
if (name.length() > 0 && name.charAt(0) != '/')
{
throw new FileSystemException("vfs.provider/missing-hostname-path-sep.error", uri);
}
return auth;
}