1 10 package org.mmbase.util; 11 12 23 public class XFileCompare implements CompareInterface { 24 25 28 String compareField; 29 30 34 public XFileCompare(String compareField) { 35 this.compareField = compareField; 36 } 37 38 46 public int compare(Object thisOne, Object other) { 47 int result = 0; 48 long longresult=0; 49 XFile xfileobj1 = (XFile)thisOne; 50 XFile xfileobj2 = (XFile)other; 51 52 if (compareField.equals("filepath")) { result = (xfileobj1.getFilePath()).compareTo(xfileobj2.getFilePath()); 54 56 } else { 57 if (compareField.equals("modtime")) { longresult = xfileobj1.getModTime() - xfileobj2.getModTime(); 59 result = (int)(longresult/1000); 60 } 62 } 63 return result; 64 } 65 } 66 | Popular Tags |