Prerequisites
If all checks are not passed then the request will be closed
Proposal
Describe the feature that should be added
If a file is not found or is not allowed, still return the file reference instead of null reference
|
}else{ // beginning match |
|
match = ""; |
|
for(final String key : directories.keySet()) |
|
if(rel.startsWith(key) && key.startsWith(match)) |
|
match = key; |
|
|
|
if(!match.isEmpty() && directories.containsKey(match)){ |
|
final DirectoryEntry entry = directories.get(match); |
|
final String rel2; |
|
try{ |
|
rel2 = rel.substring(match.length()); |
|
|
|
if(entry.isFilesPreloaded()){ |
|
final File file; |
|
if((file = entry.getFile(rel2)) != null){ |
|
handle(exchange, file, entry.getBytes(rel2)); // use adapted preload |
|
} |
|
}else{ |
|
final File file = new File(entry.getDirectory().getAbsolutePath() + "\\" + rel2); |
|
handle(exchange,file,adapter.getBytes(file, Files.readAllBytes(file.toPath()))); // use adapted now |
|
} |
|
}catch(final IndexOutOfBoundsException ignored){ } |
|
} |
|
handle(exchange,null,null); // not found |
Reasoning
Explain why this feature should be added
This would more configuration for null files, since it now has an association