import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Path;

import static java.nio.charset.StandardCharsets.UTF_8;

public class ReadExport {
    public static void main(String[] args) throws ExportReadException {
        Path source = args.length == 0 ? Path.of("data", "registrations.txt") : Path.of(args[0]);
        String export = readSmallExport(source);
        System.out.print(export);
    }

    static String readSmallExport(Path source) throws ExportReadException {
        try {
            return Files.readString(source, UTF_8);
        } catch (IOException cause) {
            throw new ExportReadException("Не удалось прочитать выгрузку " + source, cause);
        }
    }
}

class ExportReadException extends IOException {
    ExportReadException(String message, Throwable cause) {
        super(message, cause);
    }
}
