// appropriate location right away (and not on the next read). So, I put the
// code here. Note that this constructor is also called on copying a
// resource. We know that the resource folder is valid.
// Let's now copy the resource folder to the root folder.
VFSContainer rootContainer = new LocalFolderImpl(root);
String folderName = FeedManager.getInstance().getFeedKind(this);
if (rootContainer.resolve(folderName) == null) {
// If the podcast directory doesn't exist yet, create it and copy content
// from uploaded folder
rootContainer = rootContainer.createChildContainer(folderName);
VFSContainer resourceContainer = new LocalFolderImpl(resourceFolder);
for (VFSItem item : resourceContainer.getItems()) {
rootContainer.copyFrom(item);
// Delete the item if it is located in the _unzipped_ dir.
// Remember that the resource folder could be a valid folder of a
// different resource (when copying the resource).
if (resourceContainer.getName().equals(FileResourceManager.ZIPDIR)) {
item.delete();
}
}
}
}