import java.nio.file.attribute.BasicFileAttributes;
import java.text.DateFormat;
import java.text.ParseException;
-import java.text.SimpleDateFormat;
import java.util.Collections;
import java.util.Date;
import java.util.List;
import java.util.TreeMap;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
+import org.opendaylight.yangtools.yang.common.SimpleDateFormatUtil;
import org.opendaylight.yangtools.yang.model.repo.api.MissingSchemaSourceException;
+import org.opendaylight.yangtools.yang.model.repo.api.RevisionSourceIdentifier;
import org.opendaylight.yangtools.yang.model.repo.api.SchemaSourceException;
import org.opendaylight.yangtools.yang.model.repo.api.SchemaSourceRepresentation;
import org.opendaylight.yangtools.yang.model.repo.api.SourceIdentifier;
* String is comparable, pattern check tested format
* so comparing as ASCII string should be sufficient
*/
- DateFormat df = new SimpleDateFormat("yyyy-MM-dd");
+ DateFormat df = SimpleDateFormatUtil.getRevisionFormat();
try {
Date d = df.parse(revStr);
map.put(d, sorted);
if (matcher.matches()) {
final String moduleName = matcher.group("moduleName");
final String revision = matcher.group("revision");
- return Optional.of(new SourceIdentifier(moduleName, Optional.fromNullable(revision)));
+ return Optional.of(RevisionSourceIdentifier.create(moduleName, Optional.fromNullable(revision)));
}
return Optional.absent();
}