private String buildDirectoryListing(String path, File[] files) {
		// Sort all files: first directories, then files
		Arrays.sort(files, (f1, f2) -> {
			if (f1.isDirectory() && !f2.isDirectory()) {
				return -1;
			} else if (!f1.isDirectory() && f2.isDirectory()) {
				return 1;
			} else {
				return f1.toString().compareToIgnoreCase(f2.toString());
			}
		});

		// Prepare table-output
		String content = "<table><tr><th></th><th>Name</th><th>Last modified</th><th>Size</th></tr>";

		// Add "Parent Directory"-entry (if not in webRoot)
		if (!path.equals("/")) {
			String parentDirectory = path.substring(0, path.length() - 1);
			int lastSlash = parentDirectory.lastIndexOf("/");
			if (lastSlash > 1) {
				parentDirectory = parentDirectory.substring(0, lastSlash);
			} else {
				parentDirectory = "/";
			}

			content += "<tr><td class=\"center\"><div class=\"back\">&nbsp;</div></td>" +
					"<td><a href=\"" + parentDirectory.replace(" ", "%20") + "\">Parent Directory</a></td>" +
					"<td></td>" +
					"<td></td></tr>";
		}

		if (path.equals("/")) path = ""; // small adjustment

		// Add every file to the output-table
		for (File myFile : files) {
			// Get some meta-data
			String filename = myFile.getName();
			String img;
			String fileSize = FileManager.getReadableFileSize(myFile.length());
			if (myFile.isDirectory()) {
				img = "<div class=\"directory\">&nbsp;</div>";
				fileSize = "-";
			} else {
				img = "<div class=\"file\">&nbsp;</div>";
			}

			// Put all the data into a column
			content += "<tr><td class=\"center\">" + img + "</td>" +
					"<td><a href=\"" + path.replace(" ", "%20") + "/" + filename.replace(" ", "%20") + "\">" + filename + "</a></td>" +
					"<td>" + new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(myFile.lastModified()) + "</td>" +
					"<td>" + fileSize + "</td></tr>";
		}

		// Finish table and return the result
		content += "</table>";

		return content;
	}