Java - File parsing vs fetching html over http -


we have java class supposed fetch html file , read content in based on id of divs , return content frontend render it.

now have set of html files on common file system somewhere on network. multiple applications access it. homegrown gui guide our customer facing screens centralized storage.

we have managed load html file in 2 ways

  1. start apache web server , put html files in htdocs. calling java class makes http call http://someip:80/helpguide/userguide.html #firstname. fetch guide related firstname field on screen. apache service has managed accessed in live accessible within our network.

  2. create shared directory , grant access windows logon used run windows service runs tomcat client facing web application deployed. java client class uses new file("<file location>") load file , read content. works well.

basically have 2 ways load html file. confused whether use route 1 or 2?

the html files won't massive , of reasonable size. may have inline css or youtube video links embedded in them.

downside of (2) if want include images later won't work while should work (1).

however in terms of performance , efficiency how teh 2 approaches different? (1) open http socket connection on port 80 , html stream back. (2) possibly use file inputstream file on server.


Comments