public boolean delete(String repoId, byte[] id) throws Exception { ResourceDescriptorImpl rd = getResourceDescriptor(id); if (rd == null) return false; if (repoId == null) { delete(id); return true; } boolean remove = rd.repositories.remove(repoId); if (rd.repositories.isEmpty()) { delete(rd.id); } else save(); return remove; }
public boolean delete(String repoId, byte[] id) throws Exception { ResourceDescriptorImpl rd = getResourceDescriptor(id); if (rd == null) return false; if (repoId == null) { delete(id); return true; } boolean remove = rd.repositories.remove(repoId); if (rd.repositories.isEmpty()) { delete(rd.id); } else save(); return remove; }
@Override public boolean delete(String repoId, byte[] id) throws Exception { ResourceDescriptorImpl rd = getResourceDescriptor(id); if (rd == null) return false; if (repoId == null) { delete(id); return true; } boolean remove = rd.repositories.remove(repoId); if (rd.repositories.isEmpty()) { delete(rd.id); } else save(); return remove; }
@Override public boolean delete(String repoId, byte[] id) throws Exception { ResourceDescriptorImpl rd = getResourceDescriptor(id); if (rd == null) return false; if (repoId == null) { delete(id); return true; } boolean remove = rd.repositories.remove(repoId); if (rd.repositories.isEmpty()) { delete(rd.id); } else save(); return remove; }
/** * Add a resource descriptor to the index. */ @Override public boolean add(String repoId, ResourceDescriptor rd) throws Exception { ResourceDescriptorImpl rdi = getResourceDescriptor(rd.id); boolean add = false; if (rdi != null) { add = true; logger.debug("adding repo {} to resource {} to index", repoId, rdi); } else { rdi = new ResourceDescriptorImpl(rd); getIndex().descriptors.add(rdi); logger.debug("adding resource {} to index", rdi); } rdi.repositories.add(repoId); event(TYPE.ADD, rdi, null); setDirty(); save(); return add; }
/** * Add a resource descriptor to the index. */ @Override public boolean add(String repoId, ResourceDescriptor rd) throws Exception { ResourceDescriptorImpl rdi = getResourceDescriptor(rd.id); boolean add = false; if (rdi != null) { add = true; logger.debug("adding repo {} to resource {} to index", repoId, rdi); } else { rdi = new ResourceDescriptorImpl(rd); getIndex().descriptors.add(rdi); logger.debug("adding resource {} to index", rdi); } rdi.repositories.add(repoId); event(TYPE.ADD, rdi, null); setDirty(); save(); return add; }
/** * Add a resource descriptor to the index. */ public boolean add(String repoId, ResourceDescriptor rd) throws Exception { ResourceDescriptorImpl rdi = getResourceDescriptor(rd.id); boolean add = false; if (rdi != null) { add = true; reporter.trace("adding repo %s to resource %s to index", repoId, rdi); } else { rdi = new ResourceDescriptorImpl(rd); getIndex().descriptors.add(rdi); reporter.trace("adding resource %s to index", rdi); } rdi.repositories.add(repoId); event(TYPE.ADD, rdi, null); setDirty(); save(); return add; }
/** * Add a resource descriptor to the index. */ public boolean add(String repoId, ResourceDescriptor rd) throws Exception { ResourceDescriptorImpl rdi = getResourceDescriptor(rd.id); boolean add = false; if (rdi != null) { add = true; reporter.trace("adding repo %s to resource %s to index", repoId, rdi); } else { rdi = new ResourceDescriptorImpl(rd); getIndex().descriptors.add(rdi); reporter.trace("adding resource %s to index", rdi); } rdi.repositories.add(repoId); event(TYPE.ADD, rdi, null); setDirty(); save(); return add; }
final ResourceDescriptorImpl rds = getResourceDescriptor(rd);
final ResourceDescriptorImpl rds = getResourceDescriptor(rd);
final ResourceDescriptorImpl rds = getResourceDescriptor(rd);
final ResourceDescriptorImpl rds = getResourceDescriptor(rd);