protected void processFile(FileObject file) throws Exception {
// SM-192: Force close the file, so that the cached informations are cleared
file.close();
String name = file.getName().getURI();
FileContent content = file.getContent();
content.close();
InputStream in = content.getInputStream();
if (in == null) {
throw new JBIException("No input available for file!");
}
RobustInOnly exchange = getExchangeFactory().createRobustInOnlyExchange();
NormalizedMessage message = exchange.createMessage();
exchange.setInMessage(message);
marshaler.readMessage(exchange, message, in, name);
getDeliveryChannel().sendSync(exchange);
in.close();
content.close();
if (exchange.getError() != null) {
throw exchange.getError();
}
}