entity.persist(section);
int shortsOrder = 0;
for (Showreel showreel: entry.getValue()) {
Shorts shorts = new Shorts();
shorts.setOrder(shortsOrder);
shorts.setShortSection(section);
shorts.setTitle(showreel.getTitle());
shorts.setComment(showreel.getComment());
String trailer;
if (showreel instanceof InternalShowreel) {
InternalShowreel o = (InternalShowreel)showreel;
InputStream in = new FileInputStream(o.getFile());
trailer = IOUtils.toString(in);
in.close();
} else {
HtmlShowreel o = (HtmlShowreel)showreel;
trailer = FileUtils.read(Configuration.getSystemRoot().getRoot().getFileItem(o.getFile()));
}
shorts.setTrailer(trailer);
entity.persist(shorts);
}
}
} finally {