|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.atlassian.gadgets.util.GadgetSpecUrlBuilder
public class GadgetSpecUrlBuilder
Builds URLs to gadget specs that are hosted in plugins.
Constructor Summary | |
---|---|
GadgetSpecUrlBuilder(com.atlassian.sal.api.ApplicationProperties applicationProperties)
Constructs a new GadgetSpecUrlBuilder that uses the specified ApplicationProperties to determine
the application base URL. |
Method Summary | |
---|---|
String |
buildGadgetSpecFeedUrl()
Builds a URL for the feed containing all the gadget specs published by this application. |
String |
buildGadgetSpecUrl(String pluginKey,
String moduleKey,
String location)
Builds a URL for the gadget spec that can be found with the Plugin . |
PluginGadgetSpec.Key |
parseGadgetSpecUrl(String gadgetSpecUrl)
Parses a gadget spec URL in the format returned from #buildGadgetSpecUrl(String, String) into a PluginResourceKey containing the plugin key and resource location specified by the URL. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public GadgetSpecUrlBuilder(com.atlassian.sal.api.ApplicationProperties applicationProperties)
GadgetSpecUrlBuilder
that uses the specified ApplicationProperties
to determine
the application base URL.
applicationProperties
- ApplicationProperties
implementation of the host application. Must not be
null
, or a NullPointerException
will be thrown.
NullPointerException
- if applicationProperties
is null
Method Detail |
---|
public String buildGadgetSpecFeedUrl()
public String buildGadgetSpecUrl(String pluginKey, String moduleKey, String location)
Plugin
.
pluginKey
- key of the Plugin
in which the gadget spec can be found. Must not be null
,
or a NullPointerException
will be thrown.location
- path to the gadget spec resource in the plugin. Must not be null
, or a NullPointerException
will be thrown.moduleKey
- key of the GadgetModuleDescriptor
. Must not be null
,
or a NullPointerException
will be thrown.
NullPointerException
- if any argument is null
public PluginGadgetSpec.Key parseGadgetSpecUrl(String gadgetSpecUrl)
#buildGadgetSpecUrl(String, String)
into a PluginResourceKey
containing the plugin key and resource location specified by the URL. The URL must contain
the standard resource prefix, and both a plugin key and resource location in the path. It may contain a module
key after the plugin key separated by a colon. If the URL is absolute, it must match the base URL for this
application.
For example:
rest/gadgets/1.0/g/test.plugin/path/to/gadget.xml
http://localhost:8080/dashboards/rest/gadgets/1.0/g/test.plugin/path/to/gadget.xml
)rest/gadgets/1.0/g/test.plugin:module-key/path/to/gadget.xml
http://localhost:8080/dashboards/rest/gadgets/1.0/g/test.plugin:module-key/path/to/gadget.xml
)
gadgetSpecUrl
- a valid, URL-encoded gadget spec URL, as produced by #buildGadgetSpecUrl(String,
String)
or #buildGadgetSpecUrl(com.atlassian.gadgets.plugins.PluginGadgetSpec.Key)
.
May be absolute, if the base URL matches the base URL retrieved from the ApplicationProperties
instance this GadgetSpecUrlBuilder
was initialized with. Must
not be null
, or a NullPointerException
will be thrown.
PluginResourceKey
built from the plugin key and resource location parsed and decoded from the
URL
GadgetSpecUriNotAllowedException
- if the URL does not start with the prefix for gadget specs published from this
application, or if either the plugin key or resource location is missing or blank
NullPointerException
- if gadgetSpecUrl
is null
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |