|
15 | 15 | * The <code>context</code> parameter determines if the relative context of the file within the handler before the name. <i>case-sensitive</i> <br> |
16 | 16 | * The <code>fileName</code> parameter overrides the {@link FileHandlerAdapter#getName(File)} and determines the name of the file after the context (if there is one). <br> |
17 | 17 | * The <code>directoryName</code> parameter determines the directory's name. Add the files at the top level by keeping this field empty. <br> |
18 | | - * The <code>preload</code> parameter determines if the handler should read the bytes when they are added or read the file at the exchange. <br> |
| 18 | + * The <code>loadingOption</code> parameter determines how files should be loaded (see {@link ByteLoadingOption}). <br> |
19 | 19 | * The <code>walk</code> parameter determines if all the inner directories should be used. |
20 | 20 | * The handler will not add any null files and will always use the latest file added for a particular context. |
21 | 21 | * |
22 | 22 | * @see FileHandlerAdapter |
| 23 | + * @see ByteLoadingOption |
23 | 24 | * @see SimpleHttpHandler |
24 | 25 | * @see com.sun.net.httpserver.HttpHandler |
25 | 26 | * @since 02.00.00 |
@@ -68,22 +69,7 @@ public FileHandler(final FileHandlerAdapter adapter){ |
68 | 69 |
|
69 | 70 | // |
70 | 71 |
|
71 | | - /** |
72 | | - * Adds a file to the handler at the name given by the adapter. |
73 | | - * |
74 | | - * @param file file to add |
75 | | - * |
76 | | - * @see FileHandlerAdapter |
77 | | - * @see #addFile(File, boolean) |
78 | | - * @see #addFile(File, String) |
79 | | - * @see #addFile(File, String, boolean) |
80 | | - * @see #addFile(String, File) |
81 | | - * @see #addFile(String, File, boolean) |
82 | | - * @see #addFile(String, File, String) |
83 | | - * @see #addFile(String, File, String, boolean) |
84 | | - * @since 02.00.00 |
85 | | - * @author Ktt Development |
86 | | - */ |
| 72 | + |
87 | 73 | public final void addFile(final File file){ |
88 | 74 | addFile("",file,adapter.getName(file),ByteLoadingOption.LIVELOAD); |
89 | 75 | } |
@@ -115,23 +101,7 @@ public final void addFile(final File file, final ByteLoadingOption loadingOption |
115 | 101 | addFile("",file,adapter.getName(file),loadingOption); |
116 | 102 | } |
117 | 103 |
|
118 | | - /** |
119 | | - * Adds a file to the handler. |
120 | | - * |
121 | | - * @param file file to add |
122 | | - * @param fileName file name to use |
123 | | - * |
124 | | - * @see FileHandlerAdapter |
125 | | - * @see #addFile(File) |
126 | | - * @see #addFile(File, boolean) |
127 | | - * @see #addFile(File, String, boolean) |
128 | | - * @see #addFile(String, File) |
129 | | - * @see #addFile(String, File, boolean) |
130 | | - * @see #addFile(String, File, String) |
131 | | - * @see #addFile(String, File, String, boolean) |
132 | | - * @since 02.00.00 |
133 | | - * @author Ktt Development |
134 | | - */ |
| 104 | + |
135 | 105 | public final void addFile(final File file, final String fileName){ |
136 | 106 | addFile("",file,fileName,ByteLoadingOption.LIVELOAD); |
137 | 107 | } |
@@ -164,23 +134,7 @@ public final void addFile(final File file, final String fileName, final ByteLoad |
164 | 134 | addFile("",file,fileName,loadingOption); |
165 | 135 | } |
166 | 136 |
|
167 | | - /** |
168 | | - * Adds a file to the handler at a specified context at a name given by the adapter. |
169 | | - * |
170 | | - * @param context context to use |
171 | | - * @param file file to add |
172 | | - * |
173 | | - * @see FileHandlerAdapter |
174 | | - * @see #addFile(File) |
175 | | - * @see #addFile(File, boolean) |
176 | | - * @see #addFile(File, String) |
177 | | - * @see #addFile(File, String, boolean) |
178 | | - * @see #addFile(String, File, boolean) |
179 | | - * @see #addFile(String, File, String) |
180 | | - * @see #addFile(String, File, String, boolean) |
181 | | - * @since 02.00.00 |
182 | | - * @author Ktt Development |
183 | | - */ |
| 137 | + |
184 | 138 | public final void addFile(final String context, final File file){ |
185 | 139 | addFile(context,file,adapter.getName(file),ByteLoadingOption.LIVELOAD); |
186 | 140 | } |
@@ -213,24 +167,7 @@ public final void addFile(final String context, final File file, final ByteLoadi |
213 | 167 | addFile(context,file,adapter.getName(file),loadingOption); |
214 | 168 | } |
215 | 169 |
|
216 | | - /** |
217 | | - * Adds a file to the handler at a specified context. |
218 | | - * |
219 | | - * @param context context to use |
220 | | - * @param file file to add |
221 | | - * @param fileName file name to use |
222 | | - * |
223 | | - * @see FileHandlerAdapter |
224 | | - * @see #addFile(File) |
225 | | - * @see #addFile(File, boolean) |
226 | | - * @see #addFile(File, String) |
227 | | - * @see #addFile(File, String, boolean) |
228 | | - * @see #addFile(String, File) |
229 | | - * @see #addFile(String, File, boolean) |
230 | | - * @see #addFile(String, File, String, boolean) |
231 | | - * @since 02.00.00 |
232 | | - * @author Ktt Development |
233 | | - */ |
| 170 | + |
234 | 171 | public final void addFile(final String context, final File file, final String fileName){ |
235 | 172 | addFile(context,file,fileName,ByteLoadingOption.LIVELOAD); |
236 | 173 | } |
@@ -269,18 +206,7 @@ public final void addFile(final String context, final File file, final String fi |
269 | 206 |
|
270 | 207 | // |
271 | 208 |
|
272 | | - /** |
273 | | - * Adds files to the handler at the names given by the adapter. |
274 | | - * |
275 | | - * @param files files to add |
276 | | - * |
277 | | - * @see FileHandlerAdapter |
278 | | - * @see #addFiles(File[], boolean) |
279 | | - * @see #addFiles(String, File[]) |
280 | | - * @see #addFiles(String, File[], boolean) |
281 | | - * @since 02.00.00 |
282 | | - * @author Ktt Development |
283 | | - */ |
| 209 | + |
284 | 210 | public final void addFiles(final File[] files){ |
285 | 211 | addFiles("",files,ByteLoadingOption.LIVELOAD); |
286 | 212 | } |
@@ -308,19 +234,7 @@ public final void addFiles(final File[] files, final ByteLoadingOption loadingOp |
308 | 234 | addFiles("",files,loadingOption); |
309 | 235 | } |
310 | 236 |
|
311 | | - /** |
312 | | - * Adds files to the handler at the specified context at the names given by the adapter. |
313 | | - * |
314 | | - * @param context context to use |
315 | | - * @param files files to add |
316 | | - * |
317 | | - * @see FileHandlerAdapter |
318 | | - * @see #addFiles(File[]) |
319 | | - * @see #addFiles(File[], boolean) |
320 | | - * @see #addFiles(String, File[], boolean) |
321 | | - * @since 02.00.00 |
322 | | - * @author Ktt Development |
323 | | - */ |
| 237 | + |
324 | 238 | public final void addFiles(final String context, final File[] files){ |
325 | 239 | addFiles(context,files,ByteLoadingOption.LIVELOAD); |
326 | 240 | } |
@@ -352,26 +266,7 @@ public final void addFiles(final String context, final File[] files, final ByteL |
352 | 266 |
|
353 | 267 | // |
354 | 268 |
|
355 | | - /** |
356 | | - * Adds a directory to the handler. |
357 | | - * |
358 | | - * @param directory directory to add |
359 | | - * |
360 | | - * @see FileHandlerAdapter |
361 | | - * @see #addDirectory(File, boolean) |
362 | | - * @see #addDirectory(File, boolean, boolean) |
363 | | - * @see #addDirectory(File, String) |
364 | | - * @see #addDirectory(File, String, boolean) |
365 | | - * @see #addDirectory(File, String, boolean, boolean) |
366 | | - * @see #addDirectory(String, File) |
367 | | - * @see #addDirectory(String, File, boolean) |
368 | | - * @see #addDirectory(String, File, boolean, boolean) |
369 | | - * @see #addDirectory(String, File, String) |
370 | | - * @see #addDirectory(String, File, String, boolean) |
371 | | - * @see #addDirectory(String, File, String, boolean, boolean) |
372 | | - * @since 02.00.00 |
373 | | - * @author Ktt Development |
374 | | - */ |
| 269 | + |
375 | 270 | public final void addDirectory(final File directory){ |
376 | 271 | addDirectory("",directory,directory.getName(),ByteLoadingOption.LIVELOAD,false); |
377 | 272 | } |
@@ -399,7 +294,7 @@ public final void addDirectory(final File directory){ |
399 | 294 | * @author Ktt Development |
400 | 295 | */ |
401 | 296 | @Deprecated |
402 | | - public final void addDirectory(final File directory, final boolean preload){ |
| 297 | + public final void addDirectory(final File directory, final boolean preload){ // todo: after depreciation replace with walk param |
403 | 298 | addDirectory("",directory,directory.getName(),preload ? ByteLoadingOption.PRELOAD : ByteLoadingOption.LIVELOAD,false); |
404 | 299 | } |
405 | 300 |
|
@@ -439,27 +334,7 @@ public final void addDirectory(final File directory, final ByteLoadingOption loa |
439 | 334 | addDirectory("",directory,directory.getName(),loadingOption,walk); |
440 | 335 | } |
441 | 336 |
|
442 | | - /** |
443 | | - * Adds a directory with a specified name to the handler. |
444 | | - * |
445 | | - * @param directory directory to add |
446 | | - * @param directoryName directory name |
447 | | - * |
448 | | - * @see FileHandlerAdapter |
449 | | - * @see #addDirectory(File) |
450 | | - * @see #addDirectory(File, boolean) |
451 | | - * @see #addDirectory(File, boolean, boolean) |
452 | | - * @see #addDirectory(File, String, boolean) |
453 | | - * @see #addDirectory(File, String, boolean, boolean) |
454 | | - * @see #addDirectory(String, File) |
455 | | - * @see #addDirectory(String, File, boolean) |
456 | | - * @see #addDirectory(String, File, boolean, boolean) |
457 | | - * @see #addDirectory(String, File, String) |
458 | | - * @see #addDirectory(String, File, String, boolean) |
459 | | - * @see #addDirectory(String, File, String, boolean, boolean) |
460 | | - * @since 02.00.00 |
461 | | - * @author Ktt Development |
462 | | - */ |
| 337 | + |
463 | 338 | public final void addDirectory(final File directory, final String directoryName){ |
464 | 339 | addDirectory("",directory,directoryName,ByteLoadingOption.LIVELOAD,false); |
465 | 340 | } |
@@ -488,7 +363,7 @@ public final void addDirectory(final File directory, final String directoryName) |
488 | 363 | * @author Ktt Development |
489 | 364 | */ |
490 | 365 | @Deprecated |
491 | | - public final void addDirectory(final File directory, final String directoryName, final boolean preload){ |
| 366 | + public final void addDirectory(final File directory, final String directoryName, final boolean preload){ // todo: after depreciation replace with walk param |
492 | 367 | addDirectory("",directory,directoryName,preload ? ByteLoadingOption.PRELOAD : ByteLoadingOption.LIVELOAD,false); |
493 | 368 | } |
494 | 369 |
|
@@ -529,27 +404,7 @@ public final void addDirectory(final File directory, final String directoryName, |
529 | 404 | addDirectory("",directory,directoryName,loadingOption,walk); |
530 | 405 | } |
531 | 406 |
|
532 | | - /** |
533 | | - * Adds a directory at a specified context to the handler. |
534 | | - * |
535 | | - * @param context context to use |
536 | | - * @param directory directory to add |
537 | | - * |
538 | | - * @see FileHandlerAdapter |
539 | | - * @see #addDirectory(File) |
540 | | - * @see #addDirectory(File, boolean) |
541 | | - * @see #addDirectory(File, boolean, boolean) |
542 | | - * @see #addDirectory(File, String) |
543 | | - * @see #addDirectory(File, String, boolean) |
544 | | - * @see #addDirectory(File, String, boolean, boolean) |
545 | | - * @see #addDirectory(String, File, boolean) |
546 | | - * @see #addDirectory(String, File, boolean, boolean) |
547 | | - * @see #addDirectory(String, File, String) |
548 | | - * @see #addDirectory(String, File, String, boolean) |
549 | | - * @see #addDirectory(String, File, String, boolean, boolean) |
550 | | - * @since 02.00.00 |
551 | | - * @author Ktt Development |
552 | | - */ |
| 407 | + |
553 | 408 | public final void addDirectory(final String context, final File directory){ |
554 | 409 | addDirectory(context,directory,directory.getName(),ByteLoadingOption.LIVELOAD,false); |
555 | 410 | } |
@@ -578,7 +433,7 @@ public final void addDirectory(final String context, final File directory){ |
578 | 433 | * @author Ktt Development |
579 | 434 | */ |
580 | 435 | @Deprecated |
581 | | - public final void addDirectory(final String context, final File directory, final boolean preload){ |
| 436 | + public final void addDirectory(final String context, final File directory, final boolean preload){ // todo: after depreciation replace with walk param |
582 | 437 | addDirectory(context,directory,directory.getName(),preload ? ByteLoadingOption.PRELOAD : ByteLoadingOption.LIVELOAD,false); |
583 | 438 | } |
584 | 439 |
|
@@ -619,28 +474,7 @@ public final void addDirectory(final String context, final File directory, final |
619 | 474 | addDirectory(context,directory,directory.getName(),loadingOption,walk); |
620 | 475 | } |
621 | 476 |
|
622 | | - /** |
623 | | - * Adds a directory at a specified context with a specified name. |
624 | | - * |
625 | | - * @param context context to use |
626 | | - * @param directory directory to add |
627 | | - * @param directoryName directory name |
628 | | - * |
629 | | - * @see FileHandlerAdapter |
630 | | - * @see #addDirectory(File) |
631 | | - * @see #addDirectory(File, boolean) |
632 | | - * @see #addDirectory(File, boolean, boolean) |
633 | | - * @see #addDirectory(File, String) |
634 | | - * @see #addDirectory(File, String, boolean) |
635 | | - * @see #addDirectory(File, String, boolean, boolean) |
636 | | - * @see #addDirectory(String, File) |
637 | | - * @see #addDirectory(String, File, boolean) |
638 | | - * @see #addDirectory(String, File, boolean, boolean) |
639 | | - * @see #addDirectory(String, File, String, boolean) |
640 | | - * @see #addDirectory(String, File, String, boolean, boolean) |
641 | | - * @since 02.00.00 |
642 | | - * @author Ktt Development |
643 | | - */ |
| 477 | + |
644 | 478 | public final void addDirectory(final String context, final File directory, final String directoryName){ |
645 | 479 | addDirectory(context,directory,directoryName,ByteLoadingOption.LIVELOAD,false); |
646 | 480 | } |
@@ -670,7 +504,7 @@ public final void addDirectory(final String context, final File directory, final |
670 | 504 | * @author Ktt Development |
671 | 505 | */ |
672 | 506 | @Deprecated |
673 | | - public final void addDirectory(final String context, final File directory, final String directoryName, final boolean preload){ |
| 507 | + public final void addDirectory(final String context, final File directory, final String directoryName, final boolean preload){ // todo: after depreciation replace with walk param |
674 | 508 | addDirectory(context,directory,directoryName,preload ? ByteLoadingOption.PRELOAD : ByteLoadingOption.LIVELOAD,false); |
675 | 509 | } |
676 | 510 |
|
|
0 commit comments