// If we get here, aSpecifier is supported by this implementation.
FileResourceSpecifier spec = (FileResourceSpecifier) aSpecifier;
// Get Relative Path Resolver
RelativePathResolver relPathResolver = null;
if (aAdditionalParams != null) {
relPathResolver = (RelativePathResolver) aAdditionalParams.get(PARAM_RELATIVE_PATH_RESOLVER);
}
if (relPathResolver == null) {
relPathResolver = new RelativePathResolver_impl();
}
// Get the file URL, resolving relative path as necessary
IOException ioEx = null;
try {
// Get the file URL from the specifier. If the user has passed a file path
// (e.g. c:\Program Files\...) instead of a URL, be lenient and convert it to
// a URL
URL relativeUrl;
try {
relativeUrl = new URL(spec.getFileUrl());
}
catch (MalformedURLException e) {
//try to treat the URL as a file name.
File file = new File(spec.getFileUrl());
if (file.isAbsolute()) {
//for absolute paths, use File.toURL(), which handles
//windows absolute paths correctly
relativeUrl = file.toURL();
} else {
//for relative paths, we can' use File.toURL() because it always
//produces an absolute URL. Instead we do the following, which
//won't work for windows absolute paths (but that's OK, since we
//know we're working with a relative path)
relativeUrl = new URL("file", "", spec.getFileUrl());
}
}
//resolve relative paths
mFileUrl = relPathResolver.resolveRelativePath(relativeUrl);
// Store local cache info, even though it is not used
if (spec.getLocalCache() == null) {
mLocalCache = null;
} else {