Created
July 16, 2016 16:51
-
-
Save jottley/f981ffbea7efff51918695208ffcda28 to your computer and use it in GitHub Desktop.
Dropbox Metadata Comparator
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Copyright (C) 2005-2015 Alfresco Software Limited. | |
* | |
* This file is part of Alfresco | |
* | |
* Alfresco is free software: you can redistribute it and/or modify it under the | |
* terms of the GNU Lesser General Public License as published by the Free | |
* Software Foundation, either version 3 of the License, or (at your option) any | |
* later version. | |
* | |
* Alfresco is distributed in the hope that it will be useful, but WITHOUT ANY | |
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR | |
* A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more | |
* details. | |
* | |
* You should have received a copy of the GNU Lesser General Public License | |
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>. | |
*/ | |
/** | |
* @author Jared Ottley <jared.ottley@alfresco.com> | |
*/ | |
private static Comparator<Metadata> metadata_comparator = new Comparator<Metadata>() | |
{ | |
@Override | |
public int compare(Metadata m1, Metadata m2) | |
{ | |
long d1 = m1.getModified().getTime(); | |
long d2 = m1.getModified().getTime(); | |
if (d1 < d2) | |
{ | |
return -1; | |
} | |
elseif (d1 > d2) | |
{ | |
return 1; | |
} | |
else | |
{ | |
return 0; | |
} | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment