本文整理匯總了Java中net.sourceforge.subsonic.domain.LicenseInfo類的典型用法代碼示例。如果您正苦於以下問題:Java LicenseInfo類的具體用法?Java LicenseInfo怎麽用?Java LicenseInfo使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
LicenseInfo類屬於net.sourceforge.subsonic.domain包,在下文中一共展示了LicenseInfo類的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: getLicense
import net.sourceforge.subsonic.domain.LicenseInfo; //導入依賴的package包/類
@SuppressWarnings("UnusedDeclaration")
public void getLicense(HttpServletRequest request, HttpServletResponse response) throws Exception {
request = wrapRequest(request);
License license = new License();
LicenseInfo licenseInfo = settingsService.getLicenseInfo();
license.setEmail(licenseInfo.getLicenseEmail());
license.setValid(licenseInfo.isLicenseValid());
license.setLicenseExpires(jaxbWriter.convertDate(licenseInfo.getLicenseExpires()));
license.setTrialExpires(jaxbWriter.convertDate(licenseInfo.getTrialExpires()));
Response res = createResponse();
res.setLicense(license);
jaxbWriter.writeResponse(request, response, res);
}
示例2: checkLicense
import net.sourceforge.subsonic.domain.LicenseInfo; //導入依賴的package包/類
private RESTController.ErrorCode checkLicense(String client) {
LicenseInfo licenseInfo = settingsService.getLicenseInfo();
if (licenseInfo.isLicenseOrTrialValid()) {
return null;
}
LOG.info("REST access for client '" + client + "' has expired.");
return RESTController.ErrorCode.NOT_LICENSED;
}
示例3: getLicenseInfo
import net.sourceforge.subsonic.domain.LicenseInfo; //導入依賴的package包/類
public LicenseInfo getLicenseInfo() {
Date trialExpires = getTrialExpires();
Date now = new Date();
boolean trialValid = trialExpires.after(now);
long trialDaysLeft = trialValid ? (trialExpires.getTime() - now.getTime()) / (24L * 3600L * 1000L) : 0L;
return new LicenseInfo(getLicenseEmail(), isLicenseValid(), trialExpires, trialDaysLeft, licenseExpires);
}
示例4: getLicenseInfo
import net.sourceforge.subsonic.domain.LicenseInfo; //導入依賴的package包/類
public LicenseInfo getLicenseInfo() {
return licenseInfo;
}
示例5: setLicenseInfo
import net.sourceforge.subsonic.domain.LicenseInfo; //導入依賴的package包/類
public void setLicenseInfo(LicenseInfo licenseInfo) {
this.licenseInfo = licenseInfo;
}