FileObject file;
// Only use the base path if the file name doesn't have a scheme.
if (basePath != null && fileScheme == null)
{
String scheme = UriParser.extractScheme(basePath);
FileSystemOptions opts = (scheme != null) ? getOptions(scheme) : null;
FileObject base = (opts == null) ? fsManager.resolveFile(basePath)
: fsManager.resolveFile(basePath, opts);
if (base.getType() == FileType.FILE)
{
base = base.getParent();
}
file = fsManager.resolveFile(base, fileName);
}
else
{
FileSystemOptions opts = (fileScheme != null) ? getOptions(fileScheme) : null;
file = (opts == null) ? fsManager.resolveFile(fileName)
: fsManager.resolveFile(fileName, opts);
}
if (!file.exists())