44import com .kttdevelopment .simplehttpserver .var .RequestMethod ;
55import com .sun .net .httpserver .*;
66
7- import java .io .IOException ;
8- import java .io .OutputStream ;
7+ import java .io .*;
98import java .net .InetSocketAddress ;
109import java .net .URI ;
1110import java .util .Map ;
4645 *
4746 * @see HttpExchange
4847 * @since 02.00.00
49- * @version 03.04.03
48+ * @version 4.0.0
5049 * @author Ktt Development
5150 */
5251@ SuppressWarnings ("SpellCheckingInspection" )
@@ -386,6 +385,10 @@ static SimpleHttpExchange create(final HttpExchange exchange){
386385 * @see #send(String, boolean)
387386 * @see #send(String, int)
388387 * @see #send(String, int, boolean)
388+ * @see #send(File)
389+ * @see #send(File, boolean)
390+ * @see #send(File, int)
391+ * @see #send(File, int, boolean)
389392 * @since 02.00.00
390393 * @author Ktt Development
391394 */
@@ -406,6 +409,10 @@ static SimpleHttpExchange create(final HttpExchange exchange){
406409 * @see #send(String, boolean)
407410 * @see #send(String, int)
408411 * @see #send(String, int, boolean)
412+ * @see #send(File)
413+ * @see #send(File, boolean)
414+ * @see #send(File, int)
415+ * @see #send(File, int, boolean)
409416 * @since 02.00.00
410417 * @author Ktt Development
411418 */
@@ -427,6 +434,10 @@ static SimpleHttpExchange create(final HttpExchange exchange){
427434 * @see #send(String, boolean)
428435 * @see #send(String, int)
429436 * @see #send(String, int, boolean)
437+ * @see #send(File)
438+ * @see #send(File, boolean)
439+ * @see #send(File, int)
440+ * @see #send(File, int, boolean)
430441 * @since 02.00.00
431442 * @author Ktt Development
432443 */
@@ -448,6 +459,10 @@ static SimpleHttpExchange create(final HttpExchange exchange){
448459 * @see #send(String, boolean)
449460 * @see #send(String, int)
450461 * @see #send(String, int, boolean)
462+ * @see #send(File)
463+ * @see #send(File, boolean)
464+ * @see #send(File, int)
465+ * @see #send(File, int, boolean)
451466 * @since 02.00.00
452467 * @author Ktt Development
453468 */
@@ -470,6 +485,10 @@ static SimpleHttpExchange create(final HttpExchange exchange){
470485 * @see #send(String, boolean)
471486 * @see #send(String, int)
472487 * @see #send(String, int, boolean)
488+ * @see #send(File)
489+ * @see #send(File, boolean)
490+ * @see #send(File, int)
491+ * @see #send(File, int, boolean)
473492 * @since 02.00.00
474493 * @author Ktt Development
475494 */
@@ -490,6 +509,10 @@ static SimpleHttpExchange create(final HttpExchange exchange){
490509 * @see #send(String, boolean)
491510 * @see #send(String, int)
492511 * @see #send(String, int, boolean)
512+ * @see #send(File)
513+ * @see #send(File, boolean)
514+ * @see #send(File, int)
515+ * @see #send(File, int, boolean)
493516 * @since 02.00.00
494517 * @author Ktt Development
495518 */
@@ -511,6 +534,10 @@ static SimpleHttpExchange create(final HttpExchange exchange){
511534 * @see #send(String)
512535 * @see #send(String, int)
513536 * @see #send(String, int, boolean)
537+ * @see #send(File)
538+ * @see #send(File, boolean)
539+ * @see #send(File, int)
540+ * @see #send(File, int, boolean)
514541 * @since 02.00.00
515542 * @author Ktt Development
516543 */
@@ -532,6 +559,10 @@ static SimpleHttpExchange create(final HttpExchange exchange){
532559 * @see #send(String)
533560 * @see #send(String, boolean)
534561 * @see #send(String, int, boolean)
562+ * @see #send(File)
563+ * @see #send(File, boolean)
564+ * @see #send(File, int)
565+ * @see #send(File, int, boolean)
535566 * @since 02.00.00
536567 * @author Ktt Development
537568 */
@@ -554,11 +585,115 @@ static SimpleHttpExchange create(final HttpExchange exchange){
554585 * @see #send(String)
555586 * @see #send(String, boolean)
556587 * @see #send(String, int)
588+ * @see #send(File)
589+ * @see #send(File, boolean)
590+ * @see #send(File, int)
591+ * @see #send(File, int, boolean)
557592 * @since 02.00.00
558593 * @author Ktt Development
559594 */
560595 public abstract void send (final String response , final int responseCode , final boolean gzip ) throws IOException ;
561596
597+ /**
598+ * Sends a file to the client.
599+ *
600+ * @param file file to send
601+ * @throws IOException internal server error or file read error
602+ *
603+ * @see #sendResponseHeaders(int, long)
604+ * @see #send(int)
605+ * @see #send(byte[])
606+ * @see #send(byte[], boolean)
607+ * @see #send(byte[], int)
608+ * @see #send(byte[], int, boolean)
609+ * @see #send(String)
610+ * @see #send(String, boolean)
611+ * @see #send(String, int)
612+ * @see #send(String, int, boolean)
613+ * @see #send(File, boolean)
614+ * @see #send(File, int)
615+ * @see #send(File, int, boolean)
616+ * @since 4.0.0
617+ * @author Ktt Development
618+ */
619+ public abstract void send (final File file ) throws IOException ;
620+
621+ /**
622+ * Sends a file to the client.
623+ *
624+ * @param file file to send
625+ * @param gzip if the response should be gziped before sending it to the client
626+ * @throws IOException internal server error or file read error
627+ *
628+ * @see #sendResponseHeaders(int, long)
629+ * @see #send(int)
630+ * @see #send(byte[])
631+ * @see #send(byte[], boolean)
632+ * @see #send(byte[], int)
633+ * @see #send(byte[], int, boolean)
634+ * @see #send(String)
635+ * @see #send(String, boolean)
636+ * @see #send(String, int)
637+ * @see #send(String, int, boolean)
638+ * @see #send(File)
639+ * @see #send(File, int)
640+ * @see #send(File, int, boolean)
641+ * @since 4.0.0
642+ * @author Ktt Development
643+ */
644+ public abstract void send (final File file , final boolean gzip ) throws IOException ;
645+
646+ /**
647+ * Sends a file with response code to the client.
648+ *
649+ * @param file file to send
650+ * @param responseCode response code
651+ * @throws IOException internal server error or file read error
652+ *
653+ * @see #sendResponseHeaders(int, long)
654+ * @see #send(int)
655+ * @see #send(byte[])
656+ * @see #send(byte[], boolean)
657+ * @see #send(byte[], int)
658+ * @see #send(byte[], int, boolean)
659+ * @see #send(String)
660+ * @see #send(String, boolean)
661+ * @see #send(String, int)
662+ * @see #send(String, int, boolean)
663+ * @see #send(File)
664+ * @see #send(File, boolean)
665+ * @see #send(File, int, boolean)
666+ * @since 4.0.0
667+ * @author Ktt Development
668+ */
669+ public abstract void send (final File file , final int responseCode ) throws IOException ;
670+
671+ /**
672+ * Sends a file with response code to the client.
673+ *
674+ * @param file file to send
675+ * @param responseCode response code
676+ * @param gzip if the response should be gziped before sending it to the client
677+ * @throws IOException internal server error or file read error
678+ *
679+ * @see #sendResponseHeaders(int, long)
680+ * @see #send(int)
681+ * @see #send(byte[])
682+ * @see #send(byte[], boolean)
683+ * @see #send(byte[], int)
684+ * @see #send(byte[], int, boolean)
685+ * @see #send(String)
686+ * @see #send(String, boolean)
687+ * @see #send(String, int)
688+ * @see #send(String, int, boolean)
689+ * @see #send(File)
690+ * @see #send(File, boolean)
691+ * @see #send(File, int)
692+ * @since 4.0.0
693+ * @author Ktt Development
694+ */
695+ public abstract void send (final File file , final int responseCode , final boolean gzip ) throws IOException ;
696+
562697//
563698
564699 /**
0 commit comments