@Test public void test() { Attribute result = ProfilesCommand.getProfilesAttributeFor("root", getConnection()); assertNotNull(result); assertNotNull(result.getValue()); assertEquals(NativeAttribute.PROFILES.getName(), result.getName()); }
public static Attribute getProfilesAttributeFor(String username, SolarisConnection conn) { final String out = conn.executeCommand(conn.buildCommand(true, "profiles", username)); List<String> profiles = null; if (StringUtil.isNotBlank(out) && !out.endsWith("No such user") && !out.endsWith("No profiles") && !out.endsWith("not found")) { final String[] lines = out.split("\n"); profiles = new ArrayList<String>(lines.length); for (String line : lines) { final String trimmedLine = line.trim(); if (!trimmedLine.endsWith(":")) { profiles.add(trimmedLine); } } } else { profiles = Collections.emptyList(); } return AttributeBuilder.build(NativeAttribute.PROFILES.getName(), profiles); }
ProfilesCommand { public static Attribute getProfilesAttributeFor(String username, SolarisConnection conn) { final String out = conn.executeCommand(conn.buildCommand(true, "profiles", username)); List<String> profiles = null; if (StringUtil.isNotBlank(out) && !out.endsWith("No such user") && !out.endsWith("No profiles") && !out.endsWith("not found")) { final String[] lines = out.split("\n"); profiles = new ArrayList<String>(lines.length); for (String line : lines) { final String trimmedLine = line.trim(); if (!trimmedLine.endsWith(":")) { profiles.add(trimmedLine); } } } else { profiles = Collections.emptyList(); } return AttributeBuilder.build(NativeAttribute.PROFILES.getName(), profiles); } }
ProfilesCommand { public static Attribute getProfilesAttributeFor(String username, SolarisConnection conn) { final String out = conn.executeCommand(conn.buildCommand(true, "profiles", username)); List<String> profiles = null; if (StringUtil.isNotBlank(out) && !out.endsWith("No such user") && !out.endsWith("No profiles") && !out.endsWith("not found")) { final String[] lines = out.split("\n"); profiles = new ArrayList<String>(lines.length); for (String line : lines) { final String trimmedLine = line.trim(); if (!trimmedLine.endsWith(":")) { profiles.add(trimmedLine); } } } else { profiles = Collections.emptyList(); } return AttributeBuilder.build(NativeAttribute.PROFILES.getName(), profiles); } private  ProfilesCommand(); }
ProfilesCommand { public static Attribute getProfilesAttributeFor(String username, SolarisConnection conn) { final String out = conn.executeCommand(conn.buildCommand(true, "profiles", username)); List<String> profiles = null; if (StringUtil.isNotBlank(out) && !out.endsWith("No such user") && !out.endsWith("No profiles") && !out.endsWith("not found")) { final String[] lines = out.split("\n"); profiles = new ArrayList<String>(lines.length); for (String line : lines) { final String trimmedLine = line.trim(); if (!trimmedLine.endsWith(":")) { profiles.add(trimmedLine); } } } else { profiles = Collections.emptyList(); } return AttributeBuilder.build(NativeAttribute.PROFILES.getName(), profiles); } private  ProfilesCommand(); static Attribute getProfilesAttributeFor(String username, SolarisConnection conn); }
ProfilesCommand { public static Attribute getProfilesAttributeFor(String username, SolarisConnection conn) { final String out = conn.executeCommand(conn.buildCommand(true, "profiles", username)); List<String> profiles = null; if (StringUtil.isNotBlank(out) && !out.endsWith("No such user") && !out.endsWith("No profiles") && !out.endsWith("not found")) { final String[] lines = out.split("\n"); profiles = new ArrayList<String>(lines.length); for (String line : lines) { final String trimmedLine = line.trim(); if (!trimmedLine.endsWith(":")) { profiles.add(trimmedLine); } } } else { profiles = Collections.emptyList(); } return AttributeBuilder.build(NativeAttribute.PROFILES.getName(), profiles); } private  ProfilesCommand(); static Attribute getProfilesAttributeFor(String username, SolarisConnection conn);  }