@Override protected URLConnection openConnection(final URL url) throws IOException { final FileObject entry = context.resolveFile(url.toExternalForm(), fileSystemOptions); return new DefaultURLConnection(url, entry.getContent()); }
@Override protected URLConnection openConnection(final URL url) throws IOException { final FileObject entry = context.resolveFile(url.toExternalForm(), fileSystemOptions); return new DefaultURLConnection(url, entry.getContent()); }
@Override protected URLConnection openConnection(final URL url) throws IOException { final FileObject entry = context.resolveFile(url.toExternalForm(), fileSystemOptions); return new DefaultURLConnection(url, entry.getContent()); }
@Override protected URLConnection openConnection(final URL url) throws IOException { final FileObject entry = context.resolveFile(url.toExternalForm(), fileSystemOptions); return new DefaultURLConnection(url, entry.getContent()); }
@Override protected void parseURL(final URL u, final String spec, final int start, final int limit) { try { final FileObject old = context.resolveFile(u.toExternalForm(), fileSystemOptions); FileObject newURL; if (start > 0 && spec.charAt(start - 1) == ':') { newURL = context.resolveFile(old, spec, fileSystemOptions); } else { if (old.isFile() && old.getParent() != null) { // for files we have to resolve relative newURL = old.getParent().resolveFile(spec); } else { newURL = old.resolveFile(spec); } } final String url = newURL.getName().getURI(); final StringBuilder filePart = new StringBuilder(); final String protocolPart = UriParser.extractScheme(url, filePart); setURL(u, protocolPart, "", -1, null, null, filePart.toString(), null, null); } catch (final FileSystemException fse) { // This is rethrown to MalformedURLException in URL anyway throw new RuntimeException(fse.getMessage()); } }
@Override protected void parseURL(final URL u, final String spec, final int start, final int limit) { try { final FileObject old = context.resolveFile(u.toExternalForm(), fileSystemOptions); FileObject newURL; if (start > 0 && spec.charAt(start - 1) == ':') { newURL = context.resolveFile(old, spec, fileSystemOptions); } else { if (old.isFile() && old.getParent() != null) { // for files we have to resolve relative newURL = old.getParent().resolveFile(spec); } else { newURL = old.resolveFile(spec); } } final String url = newURL.getName().getURI(); final StringBuilder filePart = new StringBuilder(); final String protocolPart = UriParser.extractScheme(url, filePart); setURL(u, protocolPart, "", -1, null, null, filePart.toString(), null, null); } catch (final FileSystemException fse) { // This is rethrown to MalformedURLException in URL anyway throw new RuntimeException(fse.getMessage()); } }
@Override protected void parseURL(final URL u, final String spec, final int start, final int limit) { try { final FileObject old = context.resolveFile(u.toExternalForm(), fileSystemOptions); FileObject newURL; if (start > 0 && spec.charAt(start - 1) == ':') { newURL = context.resolveFile(old, spec, fileSystemOptions); } else { if (old.isFile() && old.getParent() != null) { // for files we have to resolve relative newURL = old.getParent().resolveFile(spec); } else { newURL = old.resolveFile(spec); } } final String url = newURL.getName().getURI(); final StringBuilder filePart = new StringBuilder(); final String protocolPart = UriParser.extractScheme(VFS.getManager().getSchemes(), url, filePart); setURL(u, protocolPart, "", -1, null, null, filePart.toString(), null, null); } catch (final FileSystemException fse) { // This is rethrown to MalformedURLException in URL anyway throw new RuntimeException(fse.getMessage()); } }
final FileObject old = context.resolveFile(u.toExternalForm(), fileSystemOptions); newURL = context.resolveFile(old, spec, fileSystemOptions);
/** * Locates a file object, by absolute URI. * @param baseFile The base FileObject. * @param uri The name of the file to locate. * @param fileSystemOptions The FileSystemOptions. * @return The FileObject if it is located, null otherwise. * @throws FileSystemException if an error occurs. */ @Override public FileObject findFile(final FileObject baseFile, final String uri, final FileSystemOptions fileSystemOptions) throws FileSystemException { // Split the URI up into its parts final LayeredFileName name = (LayeredFileName) parseUri(baseFile != null ? baseFile.getName() : null, uri); // Make the URI canonical // Resolve the outer file name final FileName fileName = name.getOuterName(); final FileObject file = getContext().resolveFile(baseFile, fileName.getURI(), fileSystemOptions); // Create the file system final FileObject rootFile = createFileSystem(name.getScheme(), file, fileSystemOptions); // Resolve the file return rootFile.resolveFile(name.getPath()); }
/** * Locates a file object, by absolute URI. * * @param baseFile The base FileObject. * @param uri The name of the file to locate. * @param fileSystemOptions The FileSystemOptions. * @return The FileObject if it is located, null otherwise. * @throws FileSystemException if an error occurs. */ @Override public FileObject findFile(final FileObject baseFile, final String uri, final FileSystemOptions fileSystemOptions) throws FileSystemException { // Split the URI up into its parts final LayeredFileName name = (LayeredFileName) parseUri(baseFile != null ? baseFile.getName() : null, uri); // Make the URI canonical // Resolve the outer file name final FileName fileName = name.getOuterName(); final FileObject file = getContext().resolveFile(baseFile, fileName.getURI(), fileSystemOptions); // Create the file system final FileObject rootFile = createFileSystem(name.getScheme(), file, fileSystemOptions); // Resolve the file return rootFile.resolveFile(name.getPath()); }
/** * Locates a file object, by absolute URI. * * @param baseFile The base FileObject. * @param uri The name of the file to locate. * @param fileSystemOptions The FileSystemOptions. * @return The FileObject if it is located, null otherwise. * @throws FileSystemException if an error occurs. */ @Override public FileObject findFile(final FileObject baseFile, final String uri, final FileSystemOptions fileSystemOptions) throws FileSystemException { // Split the URI up into its parts final LayeredFileName name = (LayeredFileName) parseUri(baseFile != null ? baseFile.getName() : null, uri); // Make the URI canonical // Resolve the outer file name final FileName fileName = name.getOuterName(); final FileObject file = getContext().resolveFile(baseFile, fileName.getURI(), fileSystemOptions); // Create the file system final FileObject rootFile = createFileSystem(name.getScheme(), file, fileSystemOptions); // Resolve the file return rootFile.resolveFile(name.getPath()); }
/** * Locates a file object, by absolute URI. * * @param baseFile The base FileObject. * @param uri The name of the file to locate. * @param fileSystemOptions The FileSystemOptions. * @return The FileObject if it is located, null otherwise. * @throws FileSystemException if an error occurs. */ @Override public FileObject findFile(final FileObject baseFile, final String uri, final FileSystemOptions fileSystemOptions) throws FileSystemException { // Split the URI up into its parts final LayeredFileName name = (LayeredFileName) parseUri(baseFile != null ? baseFile.getName() : null, uri); // Make the URI canonical // Resolve the outer file name final FileName fileName = name.getOuterName(); final FileObject file = getContext().resolveFile(baseFile, fileName.getURI(), fileSystemOptions); // Create the file system final FileObject rootFile = createFileSystem(name.getScheme(), file, fileSystemOptions); // Resolve the file return rootFile.resolveFile(name.getPath()); }
@Override public FileSystem findOrCreateFileSystem(String uri, FileSystemOptions fileSystemOptions, boolean onlyCached) throws FileSystemException { /* mimic FileObject findFile(final FileObject baseFile, final String uri, final FileSystemOptions fileSystemOptions) */ // Split the URI up into its parts final LayeredFileName name = (LayeredFileName) parseUri(null, uri); // Make the URI canonical // Resolve the outer file name final FileName fileName = name.getOuterName(); final FileObject file = getContext().resolveFile(null, fileName.getURI(), fileSystemOptions); // Create the file system // Check if cached final FileName rootName = file.getName(); FileSystem fs = findFileSystem(rootName, null); if (fs == null && !onlyCached) { // Create the file system fs = doCreateFileSystem(name.getScheme(), file, fileSystemOptions); fs = addFileSystem(rootName, fs); //[IntelliJ] WI-31041 } return fs; } //[IntelliJ] better FileSystem management -----