shell/src/main/java/org/apache/accumulo/shell/ShellUtil.java
/**
   * Scans the given file line-by-line (ignoring empty lines) and returns a list containing those
   * lines. If decode is set to true, every line is decoded using {@link Base64} from the UTF-8
   * bytes of that line before inserting in the list.
   *
   * @param filename
   *          Path to the file that needs to be scanned
   * @param decode
   *          Whether to decode lines in the file
   * @return List of {@link Text} objects containing data in the given file
   * @throws FileNotFoundException
   *           if the given file doesn't exist
   */
Scans the given file line-by-line (ignoring empty lines) and returns a list containing those
lines. If decode is set to true, every line is decoded using  Base64 from the UTF-8
bytes of that line before inserting in the list.

@param filename
Path to the file that needs to be scanned
@param decode
Whether to decode lines in the file
@return List of  Text objects containing data in the given file
@throws FileNotFoundException
if the given file doesn't exist
Scans the given file line - by - line ( ignoring empty lines ) and returns a list containing those lines . If decode is set to true every line is decoded using Base64 from the UTF - 8 bytes of that line before inserting in the list . @param filename Path to the file that needs to be scanned @param decode Whether to decode lines in the file @return List of Text objects containing data in the given file @throws FileNotFoundException if the given file doesn ' t exist
public static List<Text> scanFile(String filename, boolean decode) throws FileNotFoundException {
    String line;
    List<Text> result = new ArrayList<>();
    try (Scanner file = new Scanner(new File(filename), UTF_8.name())) {
      while (file.hasNextLine()) {
        line = file.nextLine();
        if (!line.isEmpty()) {
          result.add(decode ? new Text(Base64.getDecoder().decode(line)) : new Text(line));
        }
      }
    }
    return result;
  }
public static List < Text > scanFile ( String filename , boolean decode ) throws FileNotFoundException { String line ; List < Text > result = new ArrayList < > ( ) ; try ( Scanner file = new Scanner ( new File ( filename ) , UTF_8 . name ( ) ) ) { while ( file . hasNextLine ( ) ) { line = file . nextLine ( ) ; if ( ! line . isEmpty ( ) ) { result . add ( decode ? new Text ( Base64 . getDecoder ( ) . decode ( line ) ) : new Text ( line ) ) ; } } } return result ; }
Scans the given file line-by-line (ignoring empty lines) and returns a list containing those
 lines.
Scans the given file line - by - line ( ignoring empty lines ) and returns a list containing those lines .