List of usage examples for com.liferay.portal.kernel.util PrefsPropsUtil getLong
public static long getLong(PortletPreferences preferences, String name, long defaultValue)
From source file:com.liferay.sync.service.impl.SyncPreferencesLocalServiceImpl.java
License:Open Source License
@Override public OAuthApplication enableOAuth(long companyId, ServiceContext serviceContext) throws PortalException { long oAuthApplicationId = PrefsPropsUtil.getLong(companyId, PortletPropsKeys.SYNC_OAUTH_APPLICATION_ID, 0); OAuthApplication oAuthApplication = OAuthApplicationLocalServiceUtil .fetchOAuthApplication(oAuthApplicationId); if (oAuthApplication != null) { return oAuthApplication; }//from w w w. j a va2s.co m oAuthApplication = OAuthApplicationLocalServiceUtil.addOAuthApplication(serviceContext.getUserId(), "Liferay Sync", StringPool.BLANK, OAuthApplicationConstants.ACCESS_WRITE, true, "http://liferay-sync", "http://liferay-sync", serviceContext); ClassLoader classLoader = getClassLoader(); InputStream inputStream = classLoader.getResourceAsStream("/resources/images/logo.png"); OAuthApplicationLocalServiceUtil.updateLogo(oAuthApplication.getOAuthApplicationId(), inputStream); return oAuthApplication; }