public UrlFileProvider() { super(); setFileNameParser(new UrlFileNameParser()); }
/** * Attaches this file object to its file resource. This method is called before any of the doBlah() or onBlah() * methods. Sub-classes can use this method to perform lazy initialisation. */ @Override protected void doAttach() throws Exception { if (url == null) { // url = new URL(getName().getURI()); url = createURL(getName()); } }
/** * Creates a file object. */ @Override protected FileObject createFile(final AbstractFileName name) { return new UrlFileObject(this, name); }
/** * 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; }
/** * Prepares the file system manager. This implementation does nothing. */ @Override public void prepare(final DefaultFileSystemManager manager) throws Exception { manager.addProvider("file", new UrlFileProvider()); }
public UrlFileProvider() { super(); setFileNameParser(new UrlFileNameParser()); }
/** * Attaches this file object to its file resource. This method is called before any of the doBlah() or onBlah() * methods. Sub-classes can use this method to perform lazy initialisation. */ @Override protected void doAttach() throws Exception { if (url == null) { // url = new URL(getName().getURI()); url = createURL(getName()); } }
/** * Creates a file object. */ @Override protected FileObject createFile(final AbstractFileName name) { return new UrlFileObject(this, name); }
/** * 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; }
/** * Prepares the file system manager. This implementation does nothing. */ @Override public void prepare(final DefaultFileSystemManager manager) throws Exception { manager.addProvider("http", new UrlFileProvider()); }
public UrlFileProvider() { super(); setFileNameParser(new UrlFileNameParser()); }
/** * Attaches this file object to its file resource. This method is called before any of the doBlah() or onBlah() * methods. Sub-classes can use this method to perform lazy initialisation. */ @Override protected void doAttach() throws Exception { if (url == null) { // url = new URL(getName().getURI()); url = createURL(getName()); } }
/** * Creates a file object. */ @Override protected FileObject createFile(final AbstractFileName name) { return new UrlFileObject(this, name); }
/** * 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; }
/** * Prepares the file system manager. */ @Override public void prepare(final DefaultFileSystemManager manager) throws Exception { manager.addProvider("http", new UrlFileProvider()); } }
/** * Prepares the file system manager. This implementation does nothing. */ @Override public void prepare(final DefaultFileSystemManager manager) throws Exception { manager.addProvider("http", new UrlFileProvider()); }
/** * Prepares the file system manager. This implementation does nothing. */ @Override public void prepare(final DefaultFileSystemManager manager) throws Exception { manager.addProvider("file", new UrlFileProvider()); }
/** * Prepares the file system manager. */ @Override public void prepare(final DefaultFileSystemManager manager) throws Exception { manager.addProvider("http", new UrlFileProvider()); } }
/** * Prepares the file system manager. This implementation does nothing. */ @Override public void prepare(final DefaultFileSystemManager manager) throws Exception { manager.addProvider("res", new ResourceFileProvider()); manager.addProvider("file", new UrlFileProvider()); manager.addProvider("jar", new JarFileProvider()); }
/** * Prepares the file system manager. This implementation does nothing. */ @Override public void prepare(final DefaultFileSystemManager manager) throws Exception { manager.addProvider("res", new ResourceFileProvider()); manager.addProvider("file", new UrlFileProvider()); manager.addProvider("jar", new JarFileProvider()); }