groupCollection.setParent(rootCollection);
if (groupCollection.getReadUsers() == null) {
groupCollection.setReadUsers(new ArrayList());
}
groupCollection.getReadUsers().add(new UserImpl("anonymous", ""));
if (rootCollection.getCollections() != null) {
rootCollection.getCollections().add(groupCollection);
} else {
List collections = new ArrayList();
collections.add(groupCollection);
rootCollection.setCollections(collections);
}
collectionDao.save(groupCollection);
}
Collection seriesCollection = getSeriesInRepository(groupCollection);
if (seriesCollection == null) {
CollectionDao collectionDao = CollectionDao.createInstance();
seriesCollection = new CollectionImpl();
seriesCollection.setName(this.oldFolder.getSeriesName());
seriesCollection.setParent(groupCollection);
if (seriesCollection.getReadUsers() == null) {
seriesCollection.setReadUsers(new ArrayList());
}
seriesCollection.getReadUsers().add(new UserImpl("anonymous", ""));
if (groupCollection.getCollections() != null) {
groupCollection.getCollections().add(seriesCollection);
} else {
List collections = new ArrayList();
collections.add(seriesCollection);
groupCollection.setCollections(collections);
}
collectionDao.save(seriesCollection);
}
Folder folder = getFolderInRepository(seriesCollection);
if (folder == null) {
folder = new FolderImpl();
folder.setName(this.oldFolder.getOiDb());
folder.setDatestamp(new GregorianCalendar());
folder.setParentCollection(seriesCollection);
if (folder.getReadUsers() == null) {
folder.setReadUsers(new ArrayList());
}
folder.getReadUsers().add(new UserImpl("anonymous", ""));
if (seriesCollection.getFolders() != null) {
seriesCollection.getFolders().add(folder);
} else {
List folders = new ArrayList();