jaas/src/main/java/com/yubico/jaas/impl/YubikeyToUserMapImpl.java
private String get_username_for_id(String publicId, String filename) throws FileNotFoundException {
		Scanner sc = null;
		File file = new File(filename);
		try {
			sc = new Scanner(file);
			while (sc.hasNextLine()) {
				String line = sc.nextLine();
				if (line.startsWith("yk." + publicId + ".user")) {
					String ykuser = line.split("=")[1].trim();

					return ykuser;
				}
			}
		} finally {
			if (sc != null) {
				sc.close();
			}
		}
		return null;
	}
private String get_username_for_id(String publicId, String filename) throws FileNotFoundException {
		Scanner sc = null;
		File file = new File(filename);
		try {
			sc = new Scanner(file);
			while (sc.hasNextLine()) {
				String line = sc.nextLine();
				if (line.startsWith("yk." + publicId + ".user")) {
					String ykuser = line.split("=")[1].trim();

					return ykuser;
				}
			}
		} finally {
			if (sc != null) {
				sc.close();
			}
		}
		return null;
	}
private String get_username_for_id ( String publicId , String filename ) throws FileNotFoundException { Scanner sc = null ; File file = new File ( filename ) ; try { sc = new Scanner ( file ) ; while ( sc . hasNextLine ( ) ) { String line = sc . nextLine ( ) ; if ( line . startsWith ( "yk." + publicId + ".user" ) ) { String ykuser = line . split ( "=" ) [ 1 ] . trim ( ) ; return ykuser ; } } } finally { if ( sc != null ) { sc . close ( ) ; } } return null ; }
Given publicId "vvcccccfhc", scans filename for a line like "yk.vvcccccfhc.user = alice"
and returns "alice" if found. Null is returned in case there is no matching line in file.

@param publicId YubiKey public ID to scan for
@param filename name of the file to scan
@return String username
@throws FileNotFoundException if the filename does not match an existing file
Given publicId vvcccccfhc scans filename for a line like yk . vvcccccfhc . user = alice and returns alice if found . Null is returned in case there is no matching line in file .