public File getInstanceDirectory() { return AppConfig.getInstanceDir(); }
public String getSiteURL() { return AppConfig.getsConfig().getSiteURL(); }
private com.cenqua.fisheye.user.UserManager getUserManager() { return AppConfig.getsConfig().getUserManager(); }
/** * Set the base URL of this application */ @Override protected void setBaseUrl(final String url) throws Exception { // Only update the site url if it is actually set final WebServerType ws = AppConfig.getsConfig().getConfig().getWebServer(); if (ws.isSetSiteUrl()) { ws.setSiteUrl(url); AppConfig.getsConfig().saveConfig(); AppConfig.getsConfig().reload(); } }
public String getBaseUrl() { RootConfig getsConfig = AppConfig.getsConfig(); String siteURL = getsConfig.getSiteURL(); WebServerType ws = getsConfig.getConfig().getWebServer(); return removeTrailingSlash(siteURL); }
public boolean repositoryExists(final String repName) { final RootConfig rootConfig = AppConfig.getsConfig(); final RepositoryHandle handle = rootConfig.getRepositoryManager().getRepository(repName); return handle != null; }
private int getRepositoryId(final String repositoryName) { final RepositoryType[] repositoryArray = AppConfig.getsConfig().getConfig().getRepositoryArray(); for (int i = 0; i < repositoryArray.length; i++) { final RepositoryType repositoryType = repositoryArray[i]; if (repositoryName.equals(repositoryType.getName())) { return i; } } return -1; }
public String getRemoteUsername() { UserLogin user = AppConfig.getsConfig().getUserManager().getCurrentUser(CrucibleFilter.getRequest()); if(user != null) { return user.getUserName(); } return null; }
public boolean currentUserCanView(RepositoryHandle repository) { Principal user = getCurrentUser(); return userManager.hasPermissionToAccess(user, repository) || (isAnon(user) && AppConfig.getsConfig().isCruAnonAccessAllowed() && repository.getCfg().isAnonAccessAllowed()); }
@Override public String getApplicationServerID() { LicenseInfo productLicense = AppConfig.getsConfig().getLicense(); if (productLicense.isFishEye()) { return productLicense.getFisheyeLicense().getServerId(); } else { return productLicense.getCrucibleLicense().getServerId(); } }
@Override public String getDefaultFromAddress() { return AppConfig.getsConfig().getConfig().getSmtp().getFrom(); }
public StreamsKey apply(RepositoryHandle handle) { final String description = handle.getCfg().getRepositoryTypeConfig().getDescription(); return new StreamsKey(handle.getName(), description == null ? "" : description); } };
@Override public boolean isMailServerConfigured() { return AppConfig.getsConfig().getConfig().getSmtp() != null; }
public void run() { // For now, we don't care what changed, we'll just expire it all // CachingManagerFactory.getCacheExpiryManagerInstance().flush(); try { AppConfig.getsConfig().getUserManager().resyncAuth(true); } catch (final Exception e) { log.warn("Unable to resync auth.", e); } }
public void addSysadminGroup(final String groupname) throws FisheyeAccessorException { try { final AdminUserConfig adminUserManager = AppConfig.getsConfig().getAdminUserManager(); adminUserManager.addGroup(groupname); AppConfig.getsConfig().saveConfig(); } catch (final IOException e) { throw new FisheyeAccessorException("IOException occured while trying to add sysadmin group: " + groupname, e); } }
public Collection<String> getUsersInGroup(final String groupname) throws FisheyeAccessorException { try { return AppConfig.getsConfig().getUserManager().getUsersInGroup(groupname); } catch (final DbException e) { throw new FisheyeAccessorException("Exception occured while retrieving users for group: " + groupname, e); } } }
public boolean isApplicationSetUp() { // this code is copied from TotalityFilter.requresSetup() method final RootConfig rootConfig = AppConfig.getsConfig(); final AdminConfig acfg = rootConfig.getAdminConfig(); final boolean requiresSetup = !acfg.haveDoneInitialSetup() || (rootConfig.getLicense() == null) || rootConfig.getLicense().isTerminated(); return !requiresSetup; }
@Override public ApplicationLicenseInfo getLicenseInfo() { ProductLicense license = AppConfig.getsConfig().getLicense().getFisheyeLicense(); return new ProductLicenseInfo(license); }
@Override public String getApplicationLogDir() { return AppConfig.getLogDir().getAbsolutePath(); }
@Override public String getApplicationSEN() { LicenseInfo productLicense = AppConfig.getsConfig().getLicense(); if (productLicense.isFishEye()) { return productLicense.getFisheyeLicense().getSupportEntitlementNumber(); } else { return productLicense.getCrucibleLicense().getSupportEntitlementNumber(); } }