protected HttpFileObject(final AbstractFileName name, final FS fileSystem, final HttpFileSystemConfigBuilder builder) { super(name, fileSystem); final FileSystemOptions fileSystemOptions = fileSystem.getFileSystemOptions(); urlCharset = builder.getUrlCharset(fileSystemOptions); userAgent = builder.getUserAgent(fileSystemOptions); followRedirect = builder.getFollowRedirect(fileSystemOptions); }
public static HttpClient createConnection(final String scheme, final String hostname, final int port, final String username, final String password, final FileSystemOptions fileSystemOptions) throws FileSystemException { return createConnection(HttpFileSystemConfigBuilder.getInstance(), scheme, hostname, port, username, password, fileSystemOptions); }
/** * Constructs a new provider. */ public HttpFileProvider() { super(); setFileNameParser(HttpFileNameParser.getInstance()); }
vfs.addProvider("file", new org.apache.commons.vfs2.provider.local.DefaultLocalFileProvider()); vfs.addProvider("jar", new org.apache.commons.vfs2.provider.jar.JarFileProvider()); vfs.addProvider("http", new org.apache.commons.vfs2.provider.http.HttpFileProvider()); vfs.addProvider("https", new org.apache.commons.vfs2.provider.https.HttpsFileProvider()); vfs.addProvider("ftp", new org.apache.commons.vfs2.provider.ftp.FtpFileProvider());
/** * Retrieve the maximum number of connections allowed. * * @param opts The FileSystemOptions. * @return The maximum number of connections allowed. * @since 2.0 */ public int getMaxTotalConnections(final FileSystemOptions opts) { return getInteger(opts, HttpConnectionManagerParams.MAX_TOTAL_CONNECTIONS, DEFAULT_MAX_CONNECTIONS); }
/** * Set the proxy authenticator where the system should get the credentials from. * * @param opts The FileSystem options. * @param authenticator The UserAuthenticator. */ public void setProxyAuthenticator(final FileSystemOptions opts, final UserAuthenticator authenticator) { setParam(opts, "proxyAuthenticator", authenticator); }
/** * Gets whether to follow redirects for the connection. * * @param opts The FileSystem options. * @return {@code true} to follow redirects, {@code false} not to. * @see #setFollowRedirect * @since 2.1 */ public boolean getFollowRedirect(final FileSystemOptions opts) { return getBoolean(opts, KEY_FOLLOW_REDIRECT, DEFAULT_FOLLOW_REDIRECT); }
@Override protected HttpClient getClient() { // make accessible return super.getClient(); }
/** * Creates a file object. This method is called only if the requested file is not cached. */ @Override protected FileObject createFile(final AbstractFileName name) throws Exception { return new HttpFileObject(name, this); } }
/** * Set the charset used for url encoding.<br> * * @param opts The FileSystem options. * @return the chaset */ public String getUrlCharset(final FileSystemOptions opts) { return getString(opts, "urlCharset"); }
protected HttpFileObject(final AbstractFileName name, final FS fileSystem, final HttpFileSystemConfigBuilder builder) { super(name, fileSystem); final FileSystemOptions fileSystemOptions = fileSystem.getFileSystemOptions(); urlCharset = builder.getUrlCharset(fileSystemOptions); userAgent = builder.getUserAgent(fileSystemOptions); followRedirect = builder.getFollowRedirect(fileSystemOptions); }
public static HttpClient createConnection(final String scheme, final String hostname, final int port, final String username, final String password, final FileSystemOptions fileSystemOptions) throws FileSystemException { return createConnection(HttpFileSystemConfigBuilder.getInstance(), scheme, hostname, port, username, password, fileSystemOptions); }
vfs.addProvider("file", new org.apache.commons.vfs2.provider.local.DefaultLocalFileProvider()); vfs.addProvider("jar", new org.apache.commons.vfs2.provider.jar.JarFileProvider()); vfs.addProvider("http", new org.apache.commons.vfs2.provider.http.HttpFileProvider()); vfs.addProvider("https", new org.apache.commons.vfs2.provider.https.HttpsFileProvider()); vfs.addProvider("ftp", new org.apache.commons.vfs2.provider.ftp.FtpFileProvider());
/** * Constructs a new provider. */ public HttpFileProvider() { super(); setFileNameParser(HttpFileNameParser.getInstance()); }
/** * Get the proxy-port to use for http the connection. You have to set the ProxyHost too if you would like to have * the proxy really used. * * @param opts The FileSystem options. * @return proxyPort: the port number or 0 if it is not set * @see #setProxyHost */ public int getProxyPort(final FileSystemOptions opts) { return getInteger(opts, "proxyPort", 0); }
/** * Set the charset used for url encoding.<br> * * @param opts The FileSystem options. * @param chaset the chaset */ public void setUrlCharset(final FileSystemOptions opts, final String chaset) { setParam(opts, "urlCharset", chaset); }
protected HttpFileObject(final AbstractFileName name, final FS fileSystem, final HttpFileSystemConfigBuilder builder) { super(name, fileSystem); final FileSystemOptions fileSystemOptions = fileSystem.getFileSystemOptions(); urlCharset = builder.getUrlCharset(fileSystemOptions); userAgent = builder.getUserAgent(fileSystemOptions); followRedirect = builder.getFollowRedirect(fileSystemOptions); }
public static HttpClient createConnection(final String scheme, final String hostname, final int port, final String username, final String password, final FileSystemOptions fileSystemOptions) throws FileSystemException { return createConnection(HttpFileSystemConfigBuilder.getInstance(), scheme, hostname, port, username, password, fileSystemOptions); }
/** * Constructs a new provider. */ public HttpFileProvider() { super(); setFileNameParser(HttpFileNameParser.getInstance()); }
/** * Retrieve the socket timeout. * * @param opts The FileSystemOptions. * @return The socket timeout. * @since 2.1 */ public int getSoTimeout(final FileSystemOptions opts) { return getInteger(opts, HttpConnectionParams.SO_TIMEOUT, DEFAULT_SO_TIMEOUT); }