MCPcopy Index your code
hub / github.com/processing/processing / listDirectory

Method listDirectory

app/src/processing/app/WebServer.java:511–524  ·  view source on GitHub ↗
(File dir, PrintStream ps)

Source from the content-addressed store, hash-verified

509 }
510
511 void listDirectory(File dir, PrintStream ps) throws IOException {
512 ps.println("<TITLE>Directory listing</TITLE><P>\n");
513 ps.println("<A HREF=\"..\">Parent Directory</A><BR>\n");
514 String[] list = dir.list();
515 for (int i = 0; list != null && i < list.length; i++) {
516 File f = new File(dir, list[i]);
517 if (f.isDirectory()) {
518 ps.println("<A HREF=\""+list[i]+"/\">"+list[i]+"/</A><BR>");
519 } else {
520 ps.println("<A HREF=\""+list[i]+"\">"+list[i]+"</A><BR");
521 }
522 }
523 ps.println("<P><HR><BR><I>" + (new Date()) + "</I>");
524 }
525
526}
527

Callers 1

sendFileMethod · 0.95

Calls 2

printlnMethod · 0.45
listMethod · 0.45

Tested by

no test coverage detected