public Collection getMessages(MessageFactory messageFactory, String selector) throws JMSException, IOException {
final Collection messages = xmlHelper.fromXML(messageFactory, new FileInputStream(file));
if (selector != null) {
try {
final ISelector selectorImpl = Selector.getInstance(selector);
for (final Iterator iter = messages.iterator(); iter.hasNext();) {
final Message message = (Message) iter.next();
if (selectorImpl.eval(ValueProvider.valueOf(message), null) == Result.RESULT_FALSE) {
iter.remove();
}
}
} catch (InvalidSelectorException e) {
throw new HermesException(e);