package journal.action; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; import journal.reader.DataJournalEntry; import journal.reader.JournalEntry; import journal.schema.Attribute; import journal.schema.Domain; import journal.schema.TableVersion; public class HighAsciiFinder extends BaseAction { private Map<String, List<String>> textAttributes = new HashMap<String, List<String>>(); private List<String> getTextAttributes(TableVersion tableVersion) { String tableName = tableVersion.getTable().getName(); if (!textAttributes.containsKey(tableName)) { List<String> list = new ArrayList<String>(); textAttributes.put(tableName, list); for (Attribute attr : tableVersion) { if (attr.getDomain() == Domain.KEY || attr.getDomain() == Domain.TEXT) { list.add(attr.getName()); } } } return textAttributes.get(tableName); } public void putValue(JournalEntry entry) { DataJournalEntry dataEntry = (DataJournalEntry) entry; TableVersion tableVersion = dataEntry.getTableVersion(); boolean leave = false; for (String attr : getTextAttributes(tableVersion)) { if (leave) break; String value = (String) dataEntry.getValue(attr); for (int i = 0; i < value.length(); i++) { if (value.charAt(i) > 127 ) { out.println(entry.toJournalString()); leave = true; break; } } } } }
# | Change | User | Description | Committed | |
---|---|---|---|---|---|
#1 | 7591 | Sven Erik Knop | and another recovered file | ||
//guest/sven_erik_knop/JournalReader/src/journal/action/HighAsciiFinder.java | |||||
#1 | 7375 | Sven Erik Knop |
Major update of the JournalReader. Complete rewrite of the command line parsing Change in the options parsing within the journal reader New SQLLoader action. Currently only against MySQL (needs MySQL JDBC driver) with fixed database and user name. This will be replaced by a config file at some stage. |