fileweb

fileweb is a small web server for publishing a file system over (local) net. fileweb is useful if there is a resource to be shared over (local) net. For example, if a file need to be copied to another computer (with another operating system) fileweb and wgettogether can save your day.

Web root directory will be the directory where fileweb was started.

fileweb also has some informative JMX attributes.

Using fileweb

fileweb is used from the command line like this:

java -jar fileweb.jar [-? | -h | -help | --help | --version]
java -jar fileweb.jar [PORT [NUM_OF_THREADS]]

where:

  • PORT is a port number. Default port is 80.
  • NUM_OF_THREADS is maximum number of threads in the thread pool (1 - 100). Default number of threads is 20.

Modifying behaviour and appearance

fileweb recognises several filetypes but if that is not enough it can be modified. fileweb.jar has application-xml.conf and plain-text.conf files that contain file endings to be recognised as application/xml and plain/text MIME types respectively. Additionaly if the file is recognised as zip, jar, war or ear file then a browser shows a small eye symbol in the front of the file name. By clicking the eye the user can peek the content of the packed file.

If the visual appearance does not feel right it can be changed by modifying CSS stylesheets and images which are in css/ and img/ folders inside of fileweb.jar.

Document type recognition

Document class is used CSS styling purpouses and MIME for obvious reasons.

Document type recognition is based how file name ends (e.g. .jpg, .txt, .pdf, README, etc). There are two kind of recognition endings; fixed and customisable. Fixed endings are:

  • .jpg -> class="picture", MIME = image/jpeg
  • .jpeg -> class="picture", MIME = image/jpeg
  • .png -> class="picture", MIME = image/png
  • .gif -> class="picture", MIME = image/gif
  • .tiff -> class="picture", MIME = image/tiff
  • .jar -> class="jar", MIME = application/octet-stream
  • .war -> class="jar", MIME = application/octet-stream
  • .ear -> class="jar", MIME = application/octet-stream
  • .zip -> class="zip", MIME = application/zip
  • .pdf -> class="pdf", MIME = application/pdf
  • .html -> class="html", MIME = text/html
  • .htm -> class="html", MIME = text/html

Customisable endings are further divided to two different groups based on their MIME plain/text and application/xml and their document classes are class="text" and class="xml" respectively. To have either MIME type for certain file name ending the respective .conf file must be edited.

If file name does not match either fixed or customisable set of endings then class="unknown" and MIME type is application/octet-stream.

Browsers

fileweb has been tested with the following browsers:

  • Chrome 6.0 Mac OSX
  • Safari 5.0 Mac OSX
  • Opera 10 Mac OSX

I also expect Camino to work but have no idea how things turn out in Internet Explorer. I expect that the latest version of Internet Explorer works properly but as we all know there have been multiple issues in the history of Internet Explorer and thus I cannot be sure without testing.

It has been tested also with Firefox 3.6 MacOSX also but unfortunately Firefox tries to be too cleaver. Directories can be browsed properly but clicking a file name usually starts downloading a page instead of showing it. This may be a character encoding issue but I am not sure about that. So, with Firefox 3.6 directories can browsed normally but the content of the file cannot be always seen directly. I don't know if there is a plug-in which can help with this issue.

Download

Download from Java Tools page.

Screenshots

Click one of the screenshots to see them a little bit bigger.

Licenses

MIT License

Copyright (c) 2010 Hapi, http://www.hapiware.com

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.

Creative Commons Attribution 3.0 license

Some Icons are Copyright © Yusuke Kamiyamane.

Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License