String[] path = getPath(uri);
if (isPackages(path) && isAdmin()) {
if (path.length > 2) {
throw new UnsupportedOperationException("Can't nest packages.");
}
RulesRepository repository = getRepo();
if (repository.containsPackage(path[1])) {
PackageItem pkg = loadPackageFromRepository(repository,
path[1]);
pkg.archiveItem(false);
pkg.checkin("<restored by webdav>");
} else {
repository.createPackage(path[1],
"<from webdav>");
}
} else {
throw new UnsupportedOperationException("Not able to create folders here...");
}