private static ObjectInputFilter readSerialFilterPatternFile() throws IOException {

		File serialFilterFile = Application.getModuleDataFile(SERIAL_FILTER_FILE).getFile(false);
		if (serialFilterFile == null) {
			// jar mode not supported
			throw new FileNotFoundException(SERIAL_FILTER_FILE + " not found");
		}
		try {
			StringBuilder buf = new StringBuilder();
			try (FileReader fr = new FileReader(serialFilterFile);
					BufferedReader r = new BufferedReader(fr)) {

				for (String line = r.readLine(); line != null; line = r.readLine()) {
					int ix = line.indexOf('#');
					if (ix >= 0) {
						// strip comment
						line = line.substring(0, ix);
					}
					line = line.trim();
					if (line.length() == 0) {
						continue;
					}
					if (!line.endsWith(";")) {
						throw new IllegalArgumentException(
							"all filter statements must end with `;`");
					}
					if (line.length() != 0) {
						buf.append(line);
					}
				}
			}
			return ObjectInputFilter.Config.createFilter(buf.toString());
		}
		catch (Exception e) {
			throw new IOException("Failed to parse " + SERIAL_FILTER_FILE, e);
		}
	}
Read serial.filter file content removing any comments and newlines and generate 
corresponding {@link ObjectInputFilter}.  See {@link java.io.ObjectInputFilter.Config#createFilter(String)}
for filter syntax.
@return serial filter content 
@throws IOException if file error occurs
Ghidra/Features/GhidraServer/src/main/java/ghidra/server/remote/GhidraServer.java