public class UrlGrab extends Authenticator
Usage: java -DproxySet=true -DproxyHost=YourProxyServerHostname -DproxyPort=YourProxyServerPort -DproxyUser=YourProxyUsernameIFNEEDED -DproxyPassword=YourProxyUserPasswordIFNEEDED -DnonProxyHosts=CommaSeperatedlistOfNonProxiedSites ca.bc.webarts.widgets.UrlGrab [URL location 1] [URL location2]...
Authenticator.RequestorType
Modifier and Type | Field and Description |
---|---|
private static boolean |
areWeUsingProxy_ |
static String |
DEFAULT_PROXY_HOST |
static String |
DEFAULT_PROXY_NOPROXY |
static String |
DEFAULT_PROXY_PORT |
static String |
DEFAULT_PROXY_SET |
private static String |
DEFAULT_SAVE_LOCATION
A holder for the directory location to save downloads.
|
private static String |
proxyHost_
the Proxy hostname.
|
private static String |
proxyPassword_
the class Proxy Password to authenticate with.
|
private static String |
proxyPort_
the Proxy port.
|
private static String |
proxyUsername_
the class Proxy Username to authenticate with.
|
private static String |
SYSTEM_FILE_SEPERATOR
A holder for the NA Clients System File Separator.
|
private static boolean |
useProxyAuthentication_ |
Constructor and Description |
---|
UrlGrab()
The default empty constructor for this class.
|
UrlGrab(String urlStr)
The main constructor for this class.
|
UrlGrab(String[] urlStr)
A constructor for this class that takes an array of URLs.
|
UrlGrab(String proxyUser,
String proxyPass)
A simple/useless constructor for the sole purpose of providing the
Authenticator impl to the net authentication mechanism.
|
UrlGrab(URL urlToGet,
String grabbedFilename)
The main constructor for this class.
|
Modifier and Type | Method and Description |
---|---|
protected PasswordAuthentication |
getPasswordAuthentication()
Impl for Authenticator so an authorizing proxy will work.
|
String |
grab(String urlStr)
Simple URL to String using java 8.
|
String |
grab(URL url)
Simple URL to String using java 8.
|
boolean |
grab(URL urlToGet,
String grabbedFilename) |
static void |
initProxy()
Does the gruntwork to get the proxy properties set.
|
static void |
main(String[] args)
The main entry for this app.
|
getRequestingHost, getRequestingPort, getRequestingPrompt, getRequestingProtocol, getRequestingScheme, getRequestingSite, getRequestingURL, getRequestorType, requestPasswordAuthentication, requestPasswordAuthentication, requestPasswordAuthentication, setDefault
private static final String SYSTEM_FILE_SEPERATOR
private static final String DEFAULT_SAVE_LOCATION
public static final String DEFAULT_PROXY_SET
public static final String DEFAULT_PROXY_HOST
public static final String DEFAULT_PROXY_PORT
public static final String DEFAULT_PROXY_NOPROXY
private static boolean areWeUsingProxy_
private static boolean useProxyAuthentication_
private static String proxyUsername_
private static String proxyPassword_
private static String proxyHost_
private static String proxyPort_
public UrlGrab()
public UrlGrab(String urlStr)
urlStr
- the string representation of the URL to grab.public UrlGrab(String[] urlStr)
urlStr
- the string representation of the URL to grab.public UrlGrab(URL urlToGet, String grabbedFilename)
urlToGet
- the URL to grab.grabbedFilename
- the filename of the local storage for the URL file.public UrlGrab(String proxyUser, String proxyPass)
proxyUser
- is the usernamer to pass to the proxyproxyPass
- is the password to pass to the proxypublic static void main(String[] args)
args
- are the URLs to grab.public static void initProxy()
protected PasswordAuthentication getPasswordAuthentication()
getPasswordAuthentication
in class Authenticator
WebARTS Library Licensed Under the GNU - General Public License. Other Libraries licensed under their respective Open Source Licenses