code: public static long getOldestLastModified (File dir)
      {
          long oldest = dir.lastModified();
          File[] files = dir.listFiles();
          if (files != null) {
              for (File file : files) {
                  if (file.isDirectory()) {
                      oldest = Math.min(oldest, getOldestLastModified(file));
                  } else {
                      oldest = Math.min(oldest, file.lastModified());
                  }
              }
          }
          return oldest;
      }
docs: Returns the timestamp of the oldest modification date of any file within the directory.