This repository was archived by the owner on Jul 31, 2022. It is now read-only.
File tree 2 files changed +5
-3
lines changed
src/main/java/com/kttdevelopment/simplehttpserver/handler
2 files changed +5
-3
lines changed Original file line number Diff line number Diff line change 6
6
7
7
<groupId >com.kttdevelopment</groupId >
8
8
<artifactId >simplehttpserver</artifactId >
9
- <version >03.05.05 </version >
9
+ <version >03.05.06 </version >
10
10
<packaging >jar</packaging >
11
11
12
12
<url >https://github.com/Ktt-Development/simplehttpserver</url >
Original file line number Diff line number Diff line change 18
18
* @see FileHandler
19
19
* @see FileEntry
20
20
* @since 02.00.00
21
- * @version 03.05.04
21
+ * @version 03.05.06
22
22
* @author Ktt Development
23
23
*/
24
24
class DirectoryEntry {
@@ -254,6 +254,8 @@ public final File getFile(final String path){
254
254
for (final File file : Objects .requireNonNullElse (parentFile .listFiles (), new File [0 ]))
255
255
if (!file .isDirectory () && adapter .getName (file ).equals (fileName ))
256
256
return file ;
257
+ else if (file .isDirectory () && file .getName ().equals (fileName )) // directories are not subject to adapter names
258
+ return file ;
257
259
return null ;
258
260
}
259
261
}
@@ -275,7 +277,7 @@ public final byte[] getBytes(final String path){
275
277
}else {
276
278
try {
277
279
final File file = Objects .requireNonNull (getFile (path )); // find if file allowed
278
- return adapter .getBytes (file ,Files .readAllBytes (file .toPath ())); // adapt bytes here
280
+ return ! file . isDirectory () ? adapter .getBytes (file ,Files .readAllBytes (file .toPath ())) : null ; // adapt bytes here
279
281
}catch (final NullPointerException | IOException ignored ){
280
282
return null ;
281
283
}
You can’t perform that action at this time.
0 commit comments