@Override public FileName parseUri(final VfsComponentContext context, final FileName base, final String filename) throws FileSystemException { final StringBuilder name = new StringBuilder(); // Extract the scheme and authority parts final Authority auth = extractToPath(filename, name); // extract domain String username = auth.getUserName(); final String domain = extractDomain(username); if (domain != null) { username = username.substring(domain.length() + 1); } // Decode and adjust separators UriParser.canonicalizePath(name, 0, name.length(), this); UriParser.fixSeparators(name); // Extract the share final String share = UriParser.extractFirstElement(name); if (share == null || share.length() == 0) { throw new FileSystemException("vfs.provider.smb/missing-share-name.error", filename); } // Normalise the path. Do this after extracting the share name, // to deal with things like smb://hostname/share/.. final FileType fileType = UriParser.normalisePath(name); final String path = name.toString(); return new SmbFileName(auth.getScheme(), auth.getHostName(), auth.getPort(), username, auth.getPassword(), domain, share, path, fileType); }
String username = auth.getUserName(); String domain = extractDomain(username); if (domain != null)
@Override public FileName parseUri(final VfsComponentContext context, final FileName base, final String filename) throws FileSystemException { // FTP URI are generic URI (as per RFC 2396) final StringBuilder name = new StringBuilder(); // Extract the scheme and authority parts final Authority auth = extractToPath(filename, name); // Extract the queryString final String queryString = UriParser.extractQueryString(name); // Decode and normalise the file name UriParser.canonicalizePath(name, 0, name.length(), this); UriParser.fixSeparators(name); final FileType fileType = UriParser.normalisePath(name); final String path = name.toString(); return new URLFileName(auth.getScheme(), auth.getHostName(), auth.getPort(), getDefaultPort(), auth.getUserName(), auth.getPassword(), path, fileType, queryString); } }
@Override public FileName parseUri(final VfsComponentContext context, final FileName base, final String filename) throws FileSystemException { // FTP URI are generic URI (as per RFC 2396) final StringBuilder name = new StringBuilder(); // Extract the scheme and authority parts final Authority auth = extractToPath(filename, name); // Extract the queryString final String queryString = UriParser.extractQueryString(name); // Decode and normalise the file name UriParser.canonicalizePath(name, 0, name.length(), this); UriParser.fixSeparators(name); final FileType fileType = UriParser.normalisePath(name); final String path = name.toString(); return new URLFileName(auth.getScheme(), auth.getHostName(), auth.getPort(), getDefaultPort(), auth.getUserName(), auth.getPassword(), path, fileType, queryString); } }
@Override public FileName parseUri(final VfsComponentContext context, final FileName base, final String filename) throws FileSystemException { // FTP URI are generic URI (as per RFC 2396) final StringBuilder name = new StringBuilder(); // Extract the scheme and authority parts final Authority auth = extractToPath(filename, name); // Extract the queryString final String queryString = UriParser.extractQueryString(name); // Decode and normalise the file name UriParser.canonicalizePath(name, 0, name.length(), this); UriParser.fixSeparators(name); final FileType fileType = UriParser.normalisePath(name); final String path = name.toString(); return new URLFileName(auth.getScheme(), auth.getHostName(), auth.getPort(), getDefaultPort(), auth.getUserName(), auth.getPassword(), path, fileType, queryString); } }
@Override public FileName parseUri(final VfsComponentContext context, final FileName base, final String filename) throws FileSystemException { // FTP URI are generic URI (as per RFC 2396) final StringBuilder name = new StringBuilder(); // Extract the scheme and authority parts final Authority auth = extractToPath(filename, name); // Extract the queryString final String queryString = UriParser.extractQueryString(name); // Decode and normalise the file name UriParser.canonicalizePath(name, 0, name.length(), this); UriParser.fixSeparators(name); final FileType fileType = UriParser.normalisePath(name); final String path = name.toString(); return new GenericURLFileName(auth.getScheme(), auth.getHostName(), auth.getPort(), getDefaultPort(), auth.getUserName(), auth.getPassword(), path, fileType, queryString); } }