public class DefaultURLConnectionHandler extends Object implements URLConnectionHandler, Plugin, RegistryPlugin, Reporter
handle(URLConnection)
. Be aware to call the
matches(URLConnection)
method to verify the plugin is applicable.Reporter.SetLocation
Report.Location
Modifier and Type | Field and Description |
---|---|
protected Registry |
registry |
MATCH
Constructor and Description |
---|
DefaultURLConnectionHandler() |
Modifier and Type | Method and Description |
---|---|
Reporter.SetLocation |
error(String format,
Object... args)
Create an error.
|
Reporter.SetLocation |
exception(Throwable t,
String format,
Object... args)
Dedicated message for an exception.
|
List<String> |
getErrors()
Return the errors.
|
Report.Location |
getLocation(String msg)
Return the errors for the given error or warning.
|
List<String> |
getWarnings()
Return the warnings.
|
void |
handle(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(URL url)
Verify if the URL matches one of our globs.
|
protected boolean |
matches(URLConnection connection)
Convenience method to make it easier to verify connections
|
void |
progress(float progress,
String format,
Object... args)
Deprecated.
Use SLF4J
Logger.info(aQute.libg.slf4j.GradleLogging.LIFECYCLE)
instead.
|
void |
setProperties(Map<String,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(String format,
Object... args)
Deprecated.
Use SLF4J Logger.debug instead.
|
Reporter.SetLocation |
warning(String format,
Object... args)
Create a warning.
|
protected Registry registry
public void handle(URLConnection connection) throws Exception
handle
in interface URLConnectionHandler
connection
- The connection to modifyException
public boolean matches(URL url)
matches
in interface URLConnectionHandler
url
- the url to matchprotected boolean matches(URLConnection connection)
connection
- The connection to matchpublic void setRegistry(Registry registry)
RegistryPlugin
for convenience to our subclasses.setRegistry
in interface RegistryPlugin
public void setProperties(Map<String,String> map) throws Exception
setProperties
in interface Plugin
map
- attributes and directives for this plugin's clauseException
public void setReporter(Reporter processor)
Plugin
setReporter
in interface Plugin
public List<String> getWarnings()
Report
getWarnings
in interface Report
public List<String> getErrors()
Report
public Report.Location getLocation(String msg)
Report
getLocation
in interface Report
msg
- The messagepublic boolean isOk()
Report
public Reporter.SetLocation error(String format, Object... args)
Reporter
public Reporter.SetLocation warning(String format, Object... args)
Reporter
@Deprecated public void trace(String format, Object... args)
Reporter
@Deprecated public void progress(float progress, String format, Object... args)
Reporter
public Reporter.SetLocation exception(Throwable t, String format, Object... args)
Reporter
public boolean isPedantic()
Reporter
isPedantic
in interface Reporter
Copyright © 2021 aQute SARL. All rights reserved.