org.dbdoclet.doclet.util.ReleaseServices Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of dbdoclet Show documentation
Show all versions of dbdoclet Show documentation
dbdoclet is a javadoc doclet, which creates DocBook XML
and UML class diagrams from javadoc comments.
The newest version!
package org.dbdoclet.doclet.util;
import java.util.Properties;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.dbdoclet.service.ResourceServices;
public class ReleaseServices {
private static Log logger = LogFactory.getLog(ReleaseServices.class);
Properties releaseProperties = null;
public String getVersion() {
return getReleaseProperties().getProperty("version");
}
private Properties getReleaseProperties() {
if (releaseProperties == null) {
releaseProperties = new Properties();
try {
releaseProperties.load(ResourceServices.getResourceAsStream("/release.properties"));
} catch (Throwable oops) {
logger.error("", oops);
}
}
return releaseProperties;
}
public String getBuild() {
return getReleaseProperties().getProperty("build");
}
public String getTimestamp() {
return getReleaseProperties().getProperty("timestamp");
}
}