/** * Guess if the given file name is an URL with host or not. * <p> * VFS treats such URLs differently. * <p> * A file name is URL-based if the base is a {@code URLFileName} or there are only 2 slashes after the scheme. e.g: * {@code http://host/path}, {@code file:/path/to/file}, {@code file:///path/to/file}. * * @param base The filename is relative to this base. * @param filename The filename. * @return true if filename contains two slashes or base was URLFileName. */ protected boolean isUrlBased(final FileName base, final String filename) { if (base instanceof URLFileName) { return true; } return countSlashes(filename) == 2; }
/** * Guess if the given file name is an URL with host or not. * <p> * VFS treats such URLs differently. * <p> * A file name is URL-based if the base is a {@code URLFileName} or there are only 2 slashes after the scheme. e.g: * {@code http://host/path}, {@code file:/path/to/file}, {@code file:///path/to/file}. * * @param base The filename is relative to this base. * @param filename The filename. * @return true if filename contains two slashes or base was URLFileName. */ protected boolean isUrlBased(final FileName base, final String filename) { if (base instanceof URLFileName) { return true; } return countSlashes(filename) == 2; }
/** * Guess if the given file name is an URL with host or not. * <p> * VFS treats such URLs differently. * <p> * A file name is URL-based if the base is a {@code URLFileName} or there are only 2 slashes after the scheme. e.g: * {@code http://host/path}, {@code file:/path/to/file}, {@code file:///path/to/file}. * * @param base The filename is relative to this base. * @param filename The filename. * @return true if filename contains two slashes or base was URLFileName. */ protected boolean isUrlBased(final FileName base, final String filename) { if (base instanceof URLFileName) { return true; } return countSlashes(filename) == 2; }