code: public static Set<String> getResourceNames(File dir) {
  
  		Set<String> resourceNames = new HashSet<String>();
  
  		// If the path is not valid throw an exception
  		String[] resArray = dir.list();
  
  		if (resArray != null) {
  			// Make the returned dirs end with '/', to match a servletcontext
  			// behavior.
  			for (int i = 0; i < resArray.length; i++) {
  				if (new File(dir, resArray[i]).isDirectory())
  					resArray[i] += '/';
  			}
  			resourceNames.addAll(Arrays.asList(resArray));
  		}
  		return resourceNames;
  	}
docs: Returns the resource names contained in a directory, and for directory
  resource, a trailing '/' is added
  
  @param dir
  the directory
  @return the resource names