public class DefaultURLConnectionHandler extends java.lang.Object implements URLConnectionHandler, Plugin, RegistryPlugin, Reporter
handle(URLConnection)
. Be aware to call the
matches(URLConnection)
method to verify the plugin is applicable.Modifier and Type | Class and Description |
---|---|
(package private) static interface |
DefaultURLConnectionHandler.Config |
Reporter.SetLocation
Report.Location
Modifier and Type | Field and Description |
---|---|
private static org.slf4j.Logger |
logger |
private java.util.Set<Glob> |
matchers |
protected Registry |
registry |
private Reporter |
reporter |
MATCH
Constructor and Description |
---|
DefaultURLConnectionHandler() |
Modifier and Type | Method and Description |
---|---|
Reporter.SetLocation |
error(java.lang.String format,
java.lang.Object... args)
Create an error.
|
Reporter.SetLocation |
exception(java.lang.Throwable t,
java.lang.String format,
java.lang.Object... args)
Dedicated message for an exception.
|
java.util.List<java.lang.String> |
getErrors()
Return the errors.
|
Report.Location |
getLocation(java.lang.String msg)
Return the errors for the given error or warning.
|
java.util.List<java.lang.String> |
getWarnings()
Return the warnings.
|
void |
handle(java.net.URLConnection connection)
Not doing anything is perfect ok
|
boolean |
isOk()
Check if this report has any relevant errors that should make the run
associated with this report invalid.
|
boolean |
isPedantic()
The provider of the reporter wants pedantic reporting, meaning every
possible warning should be reported.
|
boolean |
matches(java.net.URL url)
Verify if the URL matches one of our globs.
|
protected boolean |
matches(java.net.URLConnection connection)
Convenience method to make it easier to verify connections
|
void |
progress(float progress,
java.lang.String format,
java.lang.Object... args)
Deprecated.
Use SLF4J
Logger.info(aQute.libg.slf4j.GradleLogging.LIFECYCLE)
instead.
|
void |
setProperties(java.util.Map<java.lang.String,java.lang.String> map)
Set the properties for this plugin.
|
void |
setRegistry(Registry registry)
We are a @link
RegistryPlugin for convenience to our subclasses. |
void |
setReporter(Reporter processor)
Set the current reporter.
|
void |
trace(java.lang.String format,
java.lang.Object... args)
Deprecated.
Use SLF4J Logger.debug instead.
|
Reporter.SetLocation |
warning(java.lang.String format,
java.lang.Object... args)
Create a warning.
|
private static final org.slf4j.Logger logger
private final java.util.Set<Glob> matchers
private Reporter reporter
protected Registry registry
public void handle(java.net.URLConnection connection) throws java.lang.Exception
handle
in interface URLConnectionHandler
connection
- The connection to modifyjava.lang.Exception
public boolean matches(java.net.URL url)
matches
in interface URLConnectionHandler
url
- the url to matchprotected boolean matches(java.net.URLConnection connection)
connection
- The connection to matchpublic void setRegistry(Registry registry)
RegistryPlugin
for convenience to our subclasses.setRegistry
in interface RegistryPlugin
public void setProperties(java.util.Map<java.lang.String,java.lang.String> map) throws java.lang.Exception
setProperties
in interface Plugin
map
- attributes and directives for this plugin's clausejava.lang.Exception
public void setReporter(Reporter processor)
Plugin
setReporter
in interface Plugin
public java.util.List<java.lang.String> getWarnings()
Report
getWarnings
in interface Report
public java.util.List<java.lang.String> getErrors()
Report
public Report.Location getLocation(java.lang.String msg)
Report
getLocation
in interface Report
msg
- The messagepublic boolean isOk()
Report
public Reporter.SetLocation error(java.lang.String format, java.lang.Object... args)
Reporter
public Reporter.SetLocation warning(java.lang.String format, java.lang.Object... args)
Reporter
@Deprecated public void trace(java.lang.String format, java.lang.Object... args)
Reporter
@Deprecated public void progress(float progress, java.lang.String format, java.lang.Object... args)
Reporter
public Reporter.SetLocation exception(java.lang.Throwable t, java.lang.String format, java.lang.Object... args)
Reporter
public boolean isPedantic()
Reporter
isPedantic
in interface Reporter