try {
Iterator fileNames = getFileNames().iterator();
while (fileNames.hasNext()) {
String fileName = (String) fileNames.next();
TemporaryFile tempFile = new TemporaryFile(fileName, getFileData(fileName), WGFactory.getTempDir());
tempFile.deleteOnEviction(getDatabase().getSessionContext());
container.attachFile(tempFile.getFile());
}
} catch (IOException e) {
WGFactory.getLogger().error("Error cloning file container", e);
throw new WGCreationException("IO Error copying files for file container clone", e);