public class PacFactory
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
FILEUSER |
static int |
PROXY_ALL |
static int |
PROXY_DISABLED |
static int |
PROXY_PATTERN |
Constructor and Description |
---|
PacFactory() |
Modifier and Type | Method and Description |
---|---|
void |
addDirectMatchingRule(java.util.ArrayList<java.lang.String> rules,
java.lang.String pattern) |
void |
addProxyRule(java.util.ArrayList<java.lang.String> rules,
java.lang.String proxy) |
void |
addSocksMatchingRule(java.util.ArrayList<java.lang.String> rules,
java.lang.String pattern,
java.lang.String host,
java.lang.String port)
Add socks pattern mayching rule to a supllied list
|
void |
addSocksRule(java.util.ArrayList<java.lang.String> rules,
java.lang.String host,
java.lang.String port)
Add a socks rule to a supplied list
|
void |
addToPatternFile(java.lang.String country,
java.lang.String description,
java.lang.String pattern)
Adds pattern to an existing pattern file
|
void |
backupProxyPrefs()
Generic backup of proxy settings
|
void |
createPacFile(java.lang.String isocountry,
int port)
Create and/or activate a pacfile for a specific country
|
void |
deleteAllPAC()
Delete all pac files
|
boolean |
deletePAC(java.lang.String filename)
Delete specified pac file
|
void |
deletePatternsFile(java.lang.String country,
java.lang.String type)
Delete patterns file for a given country and type, where type is either
"def" or "user"
|
void |
deleteProxyPrefs()
Generic proxy prefs delete, for ease of use
|
void |
exportUserPatterns(java.lang.String filename,
java.io.File[] files)
Export user patterns
|
java.lang.String |
getActiveCountry()
Get the active country code
|
java.lang.String |
getDoNotProxy()
Get value of comma separated host or ip list
|
java.io.File[] |
getPatternsFiles()
Get an array of user pattern files
|
boolean |
importPatterns(java.lang.String filename)
Import patterns
|
void |
loadPatternsList(java.lang.String country,
java.util.ArrayList<java.lang.String> list)
Load a patterns list from a file
|
void |
restoreProxyPrefs(boolean resetonfail)
Generic restore of proxy settings, for ease of use
|
void |
savePatternsList(java.lang.String country,
java.lang.String type,
java.util.ArrayList<java.lang.String> list)
Save a patterns list by filename
|
void |
setBackupFolder(java.lang.String folder)
Set folder where system proxy settings will be backed up
|
void |
setDefaultProxy(java.lang.String proxyurl)
Set default proxy url
|
void |
setDoNotProxy(java.lang.String hostcsv)
Set do not proxy
|
void |
setPACFolder(java.lang.String folder)
Set folder where pac files will be generated
|
void |
setPatternsFolder(java.lang.String folder)
Create folder in which pattern files will be stored
|
void |
setProxyAutoConfigURL(java.lang.String url)
Generic set proxy config
|
void |
setTempFolder(java.lang.String path)
Set the temp folder for file extractions
|
public static final java.lang.String FILEUSER
public static final int PROXY_DISABLED
public static final int PROXY_PATTERN
public static final int PROXY_ALL
public java.lang.String getActiveCountry()
public void createPacFile(java.lang.String isocountry, int port)
isocountry
- port
- public void addProxyRule(java.util.ArrayList<java.lang.String> rules, java.lang.String proxy)
rules
- proxy
- public void addSocksRule(java.util.ArrayList<java.lang.String> rules, java.lang.String host, java.lang.String port)
rules
- host
- port
- public void addDirectMatchingRule(java.util.ArrayList<java.lang.String> rules, java.lang.String pattern)
rules
- pattern
- public void addSocksMatchingRule(java.util.ArrayList<java.lang.String> rules, java.lang.String pattern, java.lang.String host, java.lang.String port)
rules
- pattern
- host
- port
- public void loadPatternsList(java.lang.String country, java.util.ArrayList<java.lang.String> list)
country
- list
- public void deletePatternsFile(java.lang.String country, java.lang.String type)
country
- type
- public void savePatternsList(java.lang.String country, java.lang.String type, java.util.ArrayList<java.lang.String> list)
country
- list
- type
- public final void setPatternsFolder(java.lang.String folder)
folder
- public final void setPACFolder(java.lang.String folder)
folder
- public final void setBackupFolder(java.lang.String folder)
folder
- public final void setTempFolder(java.lang.String path)
path
- public void backupProxyPrefs()
public void restoreProxyPrefs(boolean resetonfail)
public void deleteProxyPrefs()
public void setProxyAutoConfigURL(java.lang.String url)
url
- public boolean deletePAC(java.lang.String filename)
filename
- public void deleteAllPAC()
public void setDefaultProxy(java.lang.String proxyurl)
proxyurl
- public void setDoNotProxy(java.lang.String hostcsv)
hostcsv
- public java.lang.String getDoNotProxy()
public void addToPatternFile(java.lang.String country, java.lang.String description, java.lang.String pattern)
country
- description
- pattern
- public java.io.File[] getPatternsFiles()
public void exportUserPatterns(java.lang.String filename, java.io.File[] files)
filename
- files
- public boolean importPatterns(java.lang.String filename)
filename
-