Home | History | Annotate | Download | only in getinfo

Lines Matching refs:scanner

23 import java.util.Scanner;
106 Scanner scanner = null;
108 scanner = new Scanner(statm);
112 if (scanner.nextInt() != 0) {
117 if (scanner.hasNext()) {
124 if (scanner != null) {
125 scanner.close();
149 Scanner scanner = null;
151 scanner = new Scanner(status);
153 findToken(scanner, "Name:");
154 String name = scanner.next();
156 findToken(scanner, "Uid:");
157 boolean rootUid = hasRootId(scanner);
159 findToken(scanner, "Gid:");
160 boolean rootGid = hasRootId(scanner);
165 if (scanner != null) {
166 scanner.close();
185 * Convenience method to move the scanner's position to the point after the given token.
187 * @param scanner to call next() until the token is found
190 private static void findToken(Scanner scanner, String token) {
192 String next = scanner.next();
198 // Scanner will exhaust input and throw an exception before getting here.
204 * @param scanner that has just processed the "Uid:" or "Gid:" token
207 private static boolean hasRootId(Scanner scanner) {
208 int realUid = scanner.nextInt();
209 int effectiveUid = scanner.nextInt();
210 int savedSetUid = scanner.nextInt();
211 int fileSystemUid = scanner.nextInt();
218 Scanner scanner = new Scanner(status);
220 findToken(scanner, "Name:");
221 return scanner.next();
223 scanner.close();