use of java.util.StringTokenizer in project hadoop by apache.
the class TestLocalFileSystemPermission method getGroups.
static List<String> getGroups() throws IOException {
List<String> a = new ArrayList<>();
String s = Shell.execCommand(Shell.getGroupsCommand());
StringTokenizer t = new StringTokenizer(s);
while (t.hasMoreTokens()) {
a.add(t.nextToken());
}
return a;
}
use of java.util.StringTokenizer in project hadoop by apache.
the class ExactLineComparator method compare.
@Override
public boolean compare(String actual, String expected) {
boolean success = false;
StringTokenizer tokenizer = new StringTokenizer(actual, "\n\r");
while (tokenizer.hasMoreTokens() && !success) {
String actualToken = tokenizer.nextToken();
success = actualToken.equals(expected);
}
return success;
}
use of java.util.StringTokenizer in project hadoop by apache.
the class StringUtils method getStringCollection.
/**
* Returns a collection of strings.
*
* @param str
* String to parse
* @param delim
* delimiter to separate the values
* @return Collection of parsed elements.
*/
public static Collection<String> getStringCollection(String str, String delim) {
List<String> values = new ArrayList<String>();
if (str == null)
return values;
StringTokenizer tokenizer = new StringTokenizer(str, delim);
while (tokenizer.hasMoreTokens()) {
values.add(tokenizer.nextToken());
}
return values;
}
use of java.util.StringTokenizer in project hadoop by apache.
the class FileContextPermissionBase method getGroups.
static List<String> getGroups() throws IOException {
List<String> a = new ArrayList<String>();
String s = Shell.execCommand(Shell.getGroupsCommand());
for (StringTokenizer t = new StringTokenizer(s); t.hasMoreTokens(); ) {
a.add(t.nextToken());
}
return a;
}
use of java.util.StringTokenizer in project groovy by apache.
the class SimpleGroovyPackageDoc method getRelativeRootPath.
public String getRelativeRootPath() {
StringTokenizer tokenizer = new StringTokenizer(name(), "" + FS);
StringBuilder sb = new StringBuilder();
while (tokenizer.hasMoreTokens()) {
tokenizer.nextToken();
sb.append("../");
}
return sb.toString();
}
Aggregations