The Java view now reads what FILIUS 2.14 keeps for its e-mail programs: the server's domain, switch and bean accounts with their mailboxes, and the accounts of /mailserver/konten.txt, which Java reads at every simulation start and which so win over the bean list; the client's three folders and address book, and its account from /konten.txt (no bean holds it). javaEmail.ts ports the bean setters and both file readers (stringZuListeBenutzerkonten, EmailKonto(String)); javaString.ts Java's trim, split and StringTokenizer; javaFileSystem.ts the file lookup, now shared with the DNS server, with the four non-ASCII units Java's equalsIgnoreCase also takes for an ASCII letter (measured over the BMP). Checked against Java on the corpus (the oracle dumps the e-mail state) and on 43 account files read by EmailServer.kontenLaden and EmailAnwendung.laden (EmailFileCases). Found: older files keep recipients as strings in the typed lists; a getter copy of the sender is filled and set back; one short server line makes Java throw for the whole file; a message with an empty text is lost on reading; a broken last client line empties the account. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
66 lines
3.0 KiB
Java
66 lines
3.0 KiB
Java
// Runs FILIUS's own readers of the e-mail account files on every case of a
|
|
// list: EmailServer.kontenLaden on /mailserver/konten.txt ("server") and
|
|
// EmailAnwendung.laden on /konten.txt ("client"). Writes the accounts Java
|
|
// ends up with — the reference for packages/fls/src/javaEmail.ts. One case
|
|
// per line: a whole file, ASCII with Java-style unicode escapes (backslash,
|
|
// u, four hex digits).
|
|
//
|
|
// Usage: java -cp filius.jar:lib/*:classes EmailFileCases server|client <cases txt> <output json>
|
|
|
|
import filius.hardware.knoten.Rechner;
|
|
import filius.software.email.EmailAnwendung;
|
|
import filius.software.email.EmailKonto;
|
|
import filius.software.email.EmailServer;
|
|
import filius.software.system.Datei;
|
|
import filius.software.system.Dateisystem;
|
|
import filius.software.system.InternetKnotenBetriebssystem;
|
|
|
|
import java.io.FileOutputStream;
|
|
import java.nio.charset.StandardCharsets;
|
|
import java.nio.file.Files;
|
|
import java.nio.file.Path;
|
|
import java.util.ArrayList;
|
|
import java.util.Arrays;
|
|
import java.util.List;
|
|
import java.util.Map;
|
|
|
|
public class EmailFileCases {
|
|
|
|
public static void main(String[] args) throws Exception {
|
|
boolean server = args[0].equals("server");
|
|
List<Object> result = new ArrayList<>();
|
|
for (String line : Files.readAllLines(Path.of(args[1]), StandardCharsets.US_ASCII)) {
|
|
InternetKnotenBetriebssystem system = (InternetKnotenBetriebssystem) new Rechner().getSystemSoftware();
|
|
Dateisystem fileSystem = system.getDateisystem();
|
|
Datei file = new Datei();
|
|
file.setName("konten.txt");
|
|
file.setDateiInhalt(IpCheckCases.unescape(line));
|
|
Object accounts;
|
|
try {
|
|
if (server) {
|
|
EmailServer mail = new EmailServer();
|
|
mail.setSystemSoftware(system);
|
|
fileSystem.speicherDatei(fileSystem.holeRootPfad() + Dateisystem.FILE_SEPARATOR + "mailserver", file);
|
|
mail.kontenLaden();
|
|
accounts = FlsOracle.emailAccounts(mail.getListeBenutzerkonten());
|
|
} else {
|
|
EmailAnwendung mail = new EmailAnwendung();
|
|
mail.setSystemSoftware(system);
|
|
fileSystem.speicherDatei(fileSystem.getRoot(), file);
|
|
mail.laden();
|
|
Map<String, EmailKonto> konten = mail.holeKontoListe();
|
|
accounts = konten.isEmpty() ? null : FlsOracle.emailAccounts(new ArrayList<>(konten.values())).get(0);
|
|
}
|
|
} catch (RuntimeException error) {
|
|
accounts = "!" + error.getClass().getSimpleName();
|
|
}
|
|
result.add(Arrays.asList(line, accounts));
|
|
}
|
|
try (FileOutputStream out = new FileOutputStream(args[2])) {
|
|
out.write((FlsOracle.Json.write(result, "") + "\n").getBytes(StandardCharsets.UTF_8));
|
|
}
|
|
System.out.println("email " + args[0] + " cases: " + result.size());
|
|
System.exit(0);
|
|
}
|
|
}
|