int i;
byte[] buff = new byte[1024];
try {
zipentry = zis.getNextEntry();
if (zipentry == null) {
throw new RegistryException("Theme bundle should be a zip file");
}
} catch (IOException e) {
log.error(e);
}
sysRegistry.beginTransaction();
while (zipentry != null) {
String entryName = zipentry.getName();
ByteArrayOutputStream byteOut = new ByteArrayOutputStream();
if (zipentry.isDirectory()) {
//if the entry is a directory creating a collection
Collection col = sysRegistry.newCollection();
sysRegistry.put(DashboardConstants.USER_DASHBOARD_REGISTRY_ROOT +
CurrentSession.getUser() +
DashboardConstants.THEME_USER_PATH +
"/" + entryName, col);
} else {
if (!(entryName.indexOf("/") > 0)) {
sysRegistry.rollbackTransaction();
throw new RegistryException("Theme bundle is not in the correct format : {<Theme-Name>/style.css}");
}
//if a file creating a resource
Resource res = sysRegistry.newResource();
try {
while ((i = zis.read(buff, 0, buff.length)) > 0) {