String getAuthName() { // lookup order is: // 1: Defined preference called "orion.auth.name" // 2: System property called "orion.tests.authtype" // 3: Default to Form+OpenID return PreferenceHelper.getString( ServerConstants.CONFIG_AUTH_NAME, System.getProperty("orion.tests.authtype", DEFAULT_AUTHENTICATION_NAME)); // $NON-NLS-1$ }
/** * Returns the root location where user data files for the given user are stored. In some * configurations this location might be shared across users, so clients will need to ensure * resulting files are segmented appropriately by user. */ public static IFileStore getUserHome(String userId) { URI platformLocationURI = Activator.getDefault().getRootLocationURI(); IFileStore root = null; try { root = EFS.getStore(platformLocationURI); } catch (CoreException e) { // this is fatal, we can't access the platform instance location throw new Error("Failed to access platform instance location", e); // $NON-NLS-1$ } // consult layout preference String layout = PreferenceHelper.getString(ServerConstants.CONFIG_FILE_LAYOUT, "flat") .toLowerCase(); //$NON-NLS-1$ if ("usertree".equals(layout) && userId != null) { // $NON-NLS-1$ // the user-tree layout organises projects by the user who created it String userPrefix = userId.substring(0, Math.min(2, userId.length())); return root.getChild(userPrefix).getChild(userId); } // default layout is a flat list of projects at the root return root; }