]>
git.argeo.org Git - lgpl/argeo-commons.git/blob - ui/jcr/utils/JcrItemsComparator.java
1 package org
.argeo
.eclipse
.ui
.jcr
.utils
;
3 import java
.util
.Comparator
;
6 import javax
.jcr
.RepositoryException
;
8 import org
.argeo
.ArgeoException
;
10 /** Compares two JCR items (node or properties) based on their names. */
11 public class JcrItemsComparator
implements Comparator
<Item
> {
12 public int compare(Item o1
, Item o2
) {
14 // TODO: put folder before files
15 return o1
.getName().compareTo(o2
.getName());
16 } catch (RepositoryException e
) {
17 throw new ArgeoException("Cannot compare " + o1
+ " and " + o2
, e
);