本文整理了Java中com.atlassian.plugin.Plugin.getDateLoaded()
方法的一些代码示例,展示了Plugin.getDateLoaded()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Plugin.getDateLoaded()
方法的具体详情如下:
包路径:com.atlassian.plugin.Plugin
类名称:Plugin
方法名:getDateLoaded
暂无
代码示例来源:origin: com.atlassian.plugins/atlassian-plugins-webresource-common
@Override
public boolean isResourceModified(final HttpServletRequest httpServletRequest, final HttpServletResponse httpServletResponse) {
final Date resourceLastModifiedDate = (plugin.getDateLoaded() == null) ? new Date() : plugin.getDateLoaded();
final LastModifiedHandler lastModifiedHandler = new LastModifiedHandler(resourceLastModifiedDate);
return !lastModifiedHandler.checkRequest(httpServletRequest, httpServletResponse);
}
代码示例来源:origin: com.atlassian.plugins/atlassian-plugins-webresource
/**
* For SNAPSHOT plugins will return install time instead of the version.
* Needed to simplify working with SNAPSHOT plugins and flushing cache when new SNAPSHOT plugin installed
* with same version but different content.
*/
public static String getPluginVersionOrInstallTime(Plugin plugin, boolean usePluginInstallTimeInsteadOfTheVersionForSnapshotPlugins) {
PluginInformation pluginInfo = plugin.getPluginInformation();
// Seems like we need to guard against pluginInfo being null, this check has been taken from
// `WebResourceUrlProviderImpl.getStaticPluginResourceUrl` in WRM@3.5.9.
final String version = pluginInfo != null ? pluginInfo.getVersion() : "unknown";
if (usePluginInstallTimeInsteadOfTheVersionForSnapshotPlugins && SNAPSHOT_PLUGIN_REGEX.matcher(version).find()) {
final Date loadedAt = plugin.getDateLoaded() == null ? new Date() : plugin.getDateLoaded();
return version + "-" + loadedAt.getTime();
} else {
return version;
}
}
代码示例来源:origin: com.atlassian.plugins/atlassian-plugins-webresource
/**
* Get not declared Resource.
*/
public Resource getModuleResource(String completeKey, String name) {
// Confluence throws error if trying to query module with not complete key (with the plugin key for example).
if (!isWebResourceKey(completeKey)) {
return null;
}
ModuleDescriptor<?> moduleDescriptor = integration.getPluginAccessor().getEnabledPluginModule(completeKey);
// In case of virtual context or super batch resource there would be null returned.
if (moduleDescriptor == null) {
return null;
}
ResourceLocation resourceLocation = moduleDescriptor.getResourceLocation(DOWNLOAD_PARAM_VALUE, name);
if (resourceLocation == null) {
return null;
}
Plugin plugin = moduleDescriptor.getPlugin();
Date updatedAt = (plugin.getDateLoaded() == null) ? new Date() : plugin.getDateLoaded();
PluginResourceContainer resourceContainer = new PluginResourceContainer(new Snapshot(this), completeKey,
updatedAt, getPluginVersionOrInstallTime(plugin, usePluginInstallTimeInsteadOfTheVersionForSnapshotPlugins));
return buildResource(resourceContainer, resourceLocation);
}
代码示例来源:origin: com.atlassian.plugins/atlassian-plugins-webresource
Date updatedAt = (plugin.getDateLoaded() == null) ? new Date() : plugin.getDateLoaded();
String version = getPluginVersionOrInstallTime(plugin, usePluginInstallTimeInsteadOfTheVersionForSnapshotPlugins);
代码示例来源:origin: com.atlassian.plugins/atlassian-plugins-webresource
Date updatedAt = (plugin.getDateLoaded() == null) ? new Date() : plugin.getDateLoaded();
代码示例来源:origin: com.atlassian.plugins/atlassian-plugins-webresource
/**
* Get Resource for Plugin.
*/
public Resource getPluginResource(String pluginKey, String name) {
Plugin plugin = integration.getPluginAccessor().getPlugin(pluginKey);
if (plugin == null) {
return null;
}
ResourceLocation resourceLocation = plugin.getResourceLocation(DOWNLOAD_PARAM_VALUE, name);
if (resourceLocation == null) {
return null;
}
PluginResourceContainer resourceContainer = new PluginResourceContainer(new Snapshot(this), pluginKey,
plugin.getDateLoaded(), getPluginVersionOrInstallTime(plugin, usePluginInstallTimeInsteadOfTheVersionForSnapshotPlugins));
Resource resource = buildResource(resourceContainer, resourceLocation);
return resource;
}
内容来源于网络,如有侵权,请联系作者删除!