| | |
| | | import de.uhilger.neon.FileServer; |
| | | import de.uhilger.neon.HttpHelper; |
| | | import de.uhilger.neon.HttpResponder; |
| | | import de.uhilger.fm.Lister; |
| | | import de.uhilger.fm.Catalog; |
| | | import java.io.IOException; |
| | | |
| | | /** |
| | |
| | | |
| | | public void run(HttpExchange exchange) { |
| | | try { |
| | | super.run(exchange); |
| | | init(exchange); |
| | | HttpContext ctx = exchange.getHttpContext(); |
| | | String base = ctx.getAttributes().getOrDefault(FileServer.ATTR_FILE_BASE, "").toString(); |
| | | if(base.length() == 0) { |
| | |
| | | } else { |
| | | String fName = new HttpHelper().getFileName(exchange); |
| | | if (fName.endsWith(FileServer.STR_SLASH)) { // Ordnerliste erzeugen |
| | | String json = new Lister().liste(fName, ctx.getPath(), base); |
| | | String json = new Catalog().list(fName, ctx.getPath(), base); |
| | | if (null != json) { |
| | | new HttpResponder().antwortSenden(exchange, HttpResponder.SC_OK, json); |
| | | } else { |