/** * Locates a file object, by absolute URI. * * @param baseFile The base FileObject. * @param uri The uri of the file to locate. * @param fileSystemOptions The FileSystemOptions * @return The FileObject * @throws FileSystemException if an error occurs. */ @Override public synchronized FileObject findFile(final FileObject baseFile, final String uri, final FileSystemOptions fileSystemOptions) throws FileSystemException { try { final URL url = new URL(uri); final URL rootUrl = new URL(url, "/"); final String key = this.getClass().getName() + rootUrl.toString(); FileSystem fs = findFileSystem(key, fileSystemOptions); if (fs == null) { final String extForm = rootUrl.toExternalForm(); final FileName rootName = getContext().parseURI(extForm); // final FileName rootName = // new BasicFileName(rootUrl, FileName.ROOT_PATH); fs = new UrlFileSystem(rootName, fileSystemOptions); addFileSystem(key, fs); } return fs.resolveFile(url.getPath()); } catch (final MalformedURLException e) { throw new FileSystemException("vfs.provider.url/badly-formed-uri.error", uri, e); } }
/** * Locates a file object, by absolute URI. * * @param baseFile The base FileObject. * @param uri The uri of the file to locate. * @param fileSystemOptions The FileSystemOptions * @return The FileObject * @throws FileSystemException if an error occurs. */ @Override public synchronized FileObject findFile(final FileObject baseFile, final String uri, final FileSystemOptions fileSystemOptions) throws FileSystemException { try { final URL url = new URL(uri); final URL rootUrl = new URL(url, "/"); final String key = this.getClass().getName() + rootUrl.toString(); FileSystem fs = findFileSystem(key, fileSystemOptions); if (fs == null) { final String extForm = rootUrl.toExternalForm(); final FileName rootName = getContext().parseURI(extForm); // final FileName rootName = // new BasicFileName(rootUrl, FileName.ROOT_PATH); fs = new UrlFileSystem(rootName, fileSystemOptions); addFileSystem(key, fs); } return fs.resolveFile(url.getPath()); } catch (final MalformedURLException e) { throw new FileSystemException("vfs.provider.url/badly-formed-uri.error", uri, e); } }
/** * Locates a file object, by absolute URI. * * @param baseFile The base FileObject. * @param fileUri The uri of the file to locate. * @param fileSystemOptions The FileSystemOptions * @return The FileObject * @throws FileSystemException if an error occurs. */ @Override public synchronized FileObject findFile(final FileObject baseFile, final String fileUri, final FileSystemOptions fileSystemOptions) throws FileSystemException { try { final URI uri = URI.create(fileUri); final URI rootUri = uri.resolve("/"); final String key = this.getClass().getName() + rootUri.toString(); FileSystem fs = findFileSystem(key, fileSystemOptions); if (fs == null) { final String extForm = rootUri.toString(); final FileName rootName = getContext().parseURI(extForm); // final FileName rootName = // new BasicFileName(rootUrl, FileName.ROOT_PATH); fs = new UrlFileSystem(rootName, fileSystemOptions); addFileSystem(key, fs); } return fs.resolveFile(uri.getPath()); } catch (final Exception e) { throw new FileSystemException("vfs.provider.url/badly-formed-uri.error", fileUri, e); } }
@Override public FileName parseChildUri(final VfsComponentContext context, final FileName base, final String filename) throws FileSystemException { final StringBuilder name = new StringBuilder(); // Extract the scheme final String scheme = UriParser.extractScheme(filename, name); // Extract the Layered file URI final String rootUriName = extractRootName(name); FileName rootUri = null; if (rootUriName != null) { rootUri = context.parseURI(rootUriName); } // Decode and normalise the path UriParser.canonicalizePath(name, 0, name.length(), this); //UriParser.fixSeparators(name); final FileType fileType = UriParser.normalisePath(name); final String path = name.toString(); return new LayeredFileName(scheme, rootUri, path, fileType); } //[IntelliJ] / in WI-2449 Invalid descendent file name "ssh:" or directory a\b (on Linux) -----
/** * Parse the base and name into a FileName. * * @param context The component context. * @param base The base FileName. * @param filename The target file name. * @return The constructed FileName. * @throws FileSystemException if an error occurs. */ @Override public FileName parseUri(final VfsComponentContext context, final FileName base, final String filename) throws FileSystemException { final StringBuilder name = new StringBuilder(); // Extract the scheme final String scheme = UriParser.extractScheme(filename, name); // Extract the Layered file URI final String rootUriName = extractRootName(name); FileName rootUri = null; if (rootUriName != null) { rootUri = context.parseURI(rootUriName); } // Decode and normalise the path UriParser.canonicalizePath(name, 0, name.length(), this); UriParser.fixSeparators(name); final FileType fileType = UriParser.normalisePath(name); final String path = name.toString(); return new LayeredFileName(scheme, rootUri, path, fileType); }
/** * Parse the base and name into a FileName. * * @param context The component context. * @param base The base FileName. * @param filename The target file name. * @return The constructed FileName. * @throws FileSystemException if an error occurs. */ @Override public FileName parseUri(final VfsComponentContext context, final FileName base, final String filename) throws FileSystemException { final StringBuilder name = new StringBuilder(); // Extract the scheme final String scheme = UriParser.extractScheme(filename, name); // Extract the Layered file URI final String rootUriName = extractRootName(name); FileName rootUri = null; if (rootUriName != null) { rootUri = context.parseURI(rootUriName); } // Decode and normalise the path UriParser.canonicalizePath(name, 0, name.length(), this); UriParser.fixSeparators(name); final FileType fileType = UriParser.normalisePath(name); final String path = name.toString(); return new LayeredFileName(scheme, rootUri, path, fileType); }
/** * Parse the base and name into a FileName. * @param context The component context. * @param base The base FileName. * @param filename The target file name. * @return The constructed FileName. * @throws FileSystemException if an error occurs. */ @Override public FileName parseUri(final VfsComponentContext context, final FileName base, final String filename) throws FileSystemException { final StringBuilder name = new StringBuilder(); // Extract the scheme final String scheme = UriParser.extractScheme(filename, name); // Extract the Layered file URI final String rootUriName = extractRootName(name); FileName rootUri = null; if (rootUriName != null) { rootUri = context.parseURI(rootUriName); } // Decode and normalise the path UriParser.canonicalizePath(name, 0, name.length(), this); UriParser.fixSeparators(name); final FileType fileType = UriParser.normalisePath(name); final String path = name.toString(); return new LayeredFileName(scheme, rootUri, path, fileType); }
/** * Parse the base and name into a FileName. * * @param context The component context. * @param base The base FileName. * @param filename The target file name. * @return The constructed FileName. * @throws FileSystemException if an error occurs. */ @Override public FileName parseUri(final VfsComponentContext context, final FileName base, final String filename) throws FileSystemException { final StringBuilder name = new StringBuilder(); // Extract the scheme final String scheme = UriParser.extractScheme(VFS.getManager().getSchemes(), filename, name); // Extract the Layered file URI final String rootUriName = extractRootName(name); FileName rootUri = null; if (rootUriName != null) { rootUri = context.parseURI(rootUriName); } // Decode and normalise the path UriParser.canonicalizePath(name, 0, name.length(), this); UriParser.fixSeparators(name); final FileType fileType = UriParser.normalisePath(name); final String path = name.toString(); return new LayeredFileName(scheme, rootUri, path, fileType); }
rootFile = getContext().getTemporaryFileStore().allocateFile("tempfs"); final FileName rootName = getContext().parseURI(scheme + ":" + FileName.ROOT_PATH);
rootFile = getContext().getTemporaryFileStore().allocateFile("tempfs"); final FileName rootName = getContext().parseURI(scheme + ":" + FileName.ROOT_PATH);
rootFile = getContext().getTemporaryFileStore().allocateFile("tempfs"); final FileName rootName = getContext().parseURI(scheme + ":" + FileName.ROOT_PATH);