You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
(This is not at all critical; simply a nice-ty improvement)
Even though it isn't in "samples", the SimpleWebServer class makes a great base / example for how to make a very functional fileserver.
As such, it's reasonable to copy the code into one's own package and then modify it, beyond what would be logical to do with subclassing...
however, the class uses a protected method (construct) of Response, here:
r = Response.newFixedLengthResponse(Status.OK, MIME_PLAINTEXT, null, 0);
...and this makes copying the class verbatim into another package problematic.
Perhaps instead, just sticking to using public ways of constructing the response?
maybe:
r = newFixedLengthResponse(Response.Status.OK, MIME_PLAINTEXT, null, 0);
(which seems to do the same, though i'll admit i didn't test it)
just a suggestion.
The text was updated successfully, but these errors were encountered:
(This is not at all critical; simply a nice-ty improvement)
Even though it isn't in "samples", the SimpleWebServer class makes a great base / example for how to make a very functional fileserver.
As such, it's reasonable to copy the code into one's own package and then modify it, beyond what would be logical to do with subclassing...
however, the class uses a protected method (construct) of Response, here:
nanohttpd/webserver/src/main/java/org/nanohttpd/webserver/SimpleWebServer.java
Line 367 in efb2ebf
...and this makes copying the class verbatim into another package problematic.
Perhaps instead, just sticking to using public ways of constructing the response?
maybe:
r = newFixedLengthResponse(Response.Status.OK, MIME_PLAINTEXT, null, 0);
(which seems to do the same, though i'll admit i didn't test it)
just a suggestion.
The text was updated successfully, but these errors were encountered: