2
votes

Is there Java ready-to-use tool, that would help me expose folder content as file server over HTTP.

Example, if I have

D:\Folder\file.zip
D:\Folder\file2.html
D:\Folder\folder\file-in-folder.jpg

Then starting in D:\Folder\ java java-file-server.jar I could access file via

http://hostname/file.zip
http://hostname/file2.html
http://hostname/folder/file-in-folder.jpg

There are of course Tomcat & Jetty but they need to be preinstalled, while I assume that only Java VM is present.
In Python & Node.js there are some commands to launch server, while the only close thing I know in Java is mvn tomcat8:run (or mvn jetyy:run), but that needs Maven, pom.xml and existing Java project.

The main requirement is that such server is installed and started via script.

1
Well you can embed jetty in your project. - Alexandre Lavoie

1 Answers

2
votes

Alas no. One can write one in Java, or as you have already noted download tools. However unlike Python there is not a simple one liner supplied for us by the core JDK library.