public String getSiteURL() { return AppConfig.getsConfig().getSiteURL(); }
@Override public List<ScanItem> getApplicationLogFilePaths() { List<ScanItem> logFilePaths = new ArrayList<ScanItem>(); final String mostRecentAppLog = mostRecentFile(AppConfig.getLogDir().listFiles((FilenameFilter) new RegexFileFilter(".*fisheye.*\\.log.*"))); if (!StringUtils.isBlank(mostRecentAppLog)) { logFilePaths.add(new ScanItem(HERCULES_SCANITEM_FECRU_APP_LOG, mostRecentAppLog)); } final String fisheyeLog = AppConfig.getInstanceDir() + "/var/log/fisheye.out"; if (new File(fisheyeLog).exists()) { logFilePaths.add(new ScanItem(HERCULES_SCANITEM_FISHEYE_LOG, fisheyeLog)); } return logFilePaths; }
private void addApplicationProperties(PropertyStore store) appProps.setValue(APPLICATION_HOME, AppConfig.getAppHome().getAbsolutePath()); appProps.setValue(FISHEYE_INSTANCE_DIRECTORY, AppConfig.getInstanceDir().getAbsolutePath()); appProps.setValue(API_ENABLED, String.valueOf(AppConfig.getsConfig().isApiEnabled()));
public DateTimeZone getUserTimeZone() { Principal user = txTemplate.getEffectivePrincipal(); if (!isAnon(user)) { try { return DateTimeZone.forTimeZone(AppConfig.getUserTimeZone(user.getUserName())); } catch (DbException e) { log.debug("Unable to get user timezone. Using system timezone.", e); } } try { return DateTimeZone.forTimeZone(AppConfig.getsConfig().getTimezone()); } catch (IllegalArgumentException e) { return DateTimeZone.getDefault(); } } }
public File getInstanceDirectory() { return AppConfig.getInstanceDir(); }
@Override public String getApplicationLogDir() { return AppConfig.getLogDir().getAbsolutePath(); }
private void addNonPathLibraryDirectoriesListing(PropertyStore store) { ImmutableList<String> pathsToWalk = ImmutableList.<String>builder() .add(AppConfig.getInstanceDir().getAbsolutePath() + "/lib") // custom user DB drivers .addAll(Splitter.on(File.pathSeparator).split(System.getProperty("java.ext.dirs", ""))) // JVM-wide libraries .build(); final PropertyStore libraries = store.addCategory(NONPATH_LIBRARIES_DIRECTORY_LISTING); for (String dir : pathsToWalk) { PropertyStore extDirs = libraries.addCategory(NONPATH_LIBRARIES_DIRECTORY); List<File> allFilesInExtDirs = getRecursiveFileList(new File(dir), new ArrayList<File>()); extDirs.setValue(NONPATH_LIBRARIES_PATH, dir); extDirs.setValue(NONPATH_LIBRARIES_FILES, Joiner.on(File.pathSeparator).join(allFilesInExtDirs)); } }
private com.cenqua.fisheye.user.UserManager getUserManager() { return AppConfig.getsConfig().getUserManager(); }
.fileSet(ExactFileSet.ofPaths(AppConfig.getInstanceDir().getAbsolutePath() + "/config.xml")) .build()); this.applicationInfoBundles.add( FileSetsBundle.builder(BundleManifest.PLUGIN_CONFIG, ZIP_INCLUDE_FECRU_PLUGIN_CFG, ZIP_INCLUDE_FECRU_PLUGIN_CFG_DESCRIPTION) .fileSet(RegexFileSet.fromDirectoryPath( AppConfig.getInstanceDir().getAbsolutePath() + "/var/plugins/config", Pattern.compile(".*\\.config"))) .build()); this.applicationInfoBundles.add( FileSetsBundle.builder(BundleManifest.FECRU_OUT, ZIP_INCLUDE_FECRU_OUT, ZIP_INCLUDE_FECRU_OUT_DESCRIPTION) .fileSet(ExactFileSet.ofPaths(AppConfig.getInstanceDir().getAbsolutePath() + "/var/log/fisheye.out")) .build()); this.applicationInfoBundles.add( FileSetsBundle.builder(BundleManifest.FECRU_PLUGIN_STATE, ZIP_INCLUDE_FECRU_PLUGINSTATE_PROPERTIES, ZIP_INCLUDE_FECRU_PLUGINSTATE_PROPERTIES_DESCRIPTION) .fileSet(ExactFileSet.ofPaths(AppConfig.getInstanceDir().getAbsolutePath() + "/var/plugins/config/pluginstate.properties")) .build());
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 Collection<String> getRepositoryNames() { // Get FishEye projects final Collection<String> results = new ArrayList<String>(); final List<RepositoryHandle> handles = AppConfig.getsConfig().getRepositoryManager().getHandles(); for (final RepositoryHandle handle : handles) { results.add(handle.getName()); } return results; }
private Set<String> getLocalProjectKeys() { final Set<String> repoData = new HashSet<String>(); for (final RepositoryHandle h : AppConfig.getsConfig().getRepositoryManager().getHandles()) { repoData.add(h.getName()); } return repoData; }
public Set<String> getLocalProjectKeys() { Set<String> repoData = new HashSet<String>(); for (RepositoryHandle h : AppConfig.getsConfig().getRepositoryManager().getHandles()) { repoData.add(h.getName()); } return repoData; }
public boolean repositoryExists(final String repName) { final RootConfig rootConfig = AppConfig.getsConfig(); final RepositoryHandle handle = rootConfig.getRepositoryManager().getRepository(repName); return handle != null; }
@Override public boolean isMailServerConfigured() { return AppConfig.getsConfig().getConfig().getSmtp() != null; }
private Set<String> getLocalProjectKeys() { final Set<String> repoData = new HashSet<String>(); for (final RepositoryHandle h : AppConfig.getsConfig().getRepositoryManager().getHandles()) { repoData.add(h.getName()); } return repoData; }
private String getSvnCheckoutUrl(String repositoryKey, String pathToCurrentDir, String publicSvnUrl) { final RepositoryManager repositoryManager = AppConfig.getsConfig().getRepositoryManager(); final List<RepositoryHandle> repositoryHandles = repositoryManager.getHandles(); final String pathToCurrentRepo = getPathToCurrentRepo(repositoryKey, repositoryHandles); final StringBuilder sb = new StringBuilder(); sb.append(publicSvnUrl).append("/"); sb.append(pathToCurrentRepo); if (!StringUtils.isBlank(pathToCurrentDir)) { sb.append(pathToCurrentDir); } else if(!StringUtils.isBlank(pathToCurrentRepo)) { sb.append("trunk"); } else { // in this case we are indexing the root of the repository. // do nothing. log.debug("Repository " + repositoryKey + " refers to root of repository."); } return sb.toString(); }
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); } }
/** * 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(); } }
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; }