Java tutorial
//package com.java2s; //License from project: Open Source License import java.io.File; import java.util.Map; public class Main { private static void readGpxDirectory(File dir, final Map<String, Long> map, String parent, boolean absolutePath) { if (dir != null && dir.canRead()) { File[] files = dir.listFiles(); if (files != null) { for (File f : files) { if (f.getName().toLowerCase().endsWith(".gpx")) { //$NON-NLS-1$ map.put(absolutePath ? f.getAbsolutePath() : parent + f.getName(), f.lastModified()); } else if (f.isDirectory()) { readGpxDirectory(f, map, parent + f.getName() + "/", absolutePath); } } } } } }