Title: Change file name adapter so it runs on directories. · Issue #119 · Ktt-Development/simplehttpserver · GitHub
Open Graph Title: Change file name adapter so it runs on directories. · Issue #119 · Ktt-Development/simplehttpserver
X Title: Change file name adapter so it runs on directories. · Issue #119 · Ktt-Development/simplehttpserver
Description: Prerequisites If all checks are not passed then the request will be closed. I have checked that no other similar feature request already exists. I have checked that this feature does not already exist. The feature request makes sense for...
Open Graph Description: Prerequisites If all checks are not passed then the request will be closed. I have checked that no other similar feature request already exists. I have checked that this feature does not already ex...
X Description: Prerequisites If all checks are not passed then the request will be closed. I have checked that no other similar feature request already exists. I have checked that this feature does not already ex...
Opengraph URL: https://github.com/Ktt-Development/simplehttpserver/issues/119
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Change file name adapter so it runs on directories.","articleBody":"### Prerequisites\r\n*If **all** checks are not passed then the request will be closed.*\r\n- [x] I have checked that no other similar feature request already exists.\r\n- [x] I have checked that this feature does not already exist.\r\n- [x] The feature request makes sense for the project.\r\n\r\n### Proposal\r\n*Describe the feature that should be added.*\r\n\r\nChange adapter so it runs on all files.\r\nhttps://github.com/Ktt-Development/simplehttpserver/blob/63aa92666126ad5a73f992e1f5a16cabf480d81e/src/main/java/com/kttdevelopment/simplehttpserver/handler/DirectoryEntry.java#L149-L151\r\n```diff\r\nfor(final File file : Objects.requireNonNullElse(parentFile.listFiles(), new File[0])){\r\n- if(fileName.equals(file.isDirectory() ? file.getName() : adapter.getName(file))) // use adapter name only if not a directory\r\n+ if(fileName.equals(adapter.getName(file))\r\n return file;\r\n```\r\n\r\n### Reasoning\r\n*Explain why this feature should be added.*\r\n\r\nDevelopers may want to use adapter names against directories ~~, specifically for checking within them (see https://github.com/Ktt-Development/webdir/pull/79).~~\r\n\r\nIf this change is made existing developers can simply use (below) to replicate the previous behavior.\r\n```java\r\n@Override\r\npublic final String getName(final File file){\r\n return file.isDirectory() ? file.getName() : super.getName(file);\r\n}\r\n```","author":{"url":"https://github.com/Katsute","@type":"Person","name":"Katsute"},"datePublished":"2020-11-17T22:47:01.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":0},"url":"https://github.com/119/simplehttpserver/issues/119"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:9f38b791-18dc-06b6-a66b-1d07033b3440 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | D378:4DA2C:76AA76:A7719D:6970AF95 |
| html-safe-nonce | 020942f2355185295910a916afec2ec88bf455624c096159b4f27062cab3e2ae |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJEMzc4OjREQTJDOjc2QUE3NjpBNzcxOUQ6Njk3MEFGOTUiLCJ2aXNpdG9yX2lkIjoiMzE4MTE3Mzg2MDA1NjczOTczMyIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 419d4bebaafb11b322133dd020de05b1ded27182828d104ee9c7be958d20301e |
| hovercard-subject-tag | issue:745144055 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/Ktt-Development/simplehttpserver/119/issue_layout |
| twitter:image | https://opengraph.githubassets.com/eedc1b7803d1d00d59c321d666d5b1cceec1629b03ff20b3b1fda1ef21e2dabe/Ktt-Development/simplehttpserver/issues/119 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/eedc1b7803d1d00d59c321d666d5b1cceec1629b03ff20b3b1fda1ef21e2dabe/Ktt-Development/simplehttpserver/issues/119 |
| og:image:alt | Prerequisites If all checks are not passed then the request will be closed. I have checked that no other similar feature request already exists. I have checked that this feature does not already ex... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | Katsute |
| hostname | github.com |
| expected-hostname | github.com |
| None | 8e0be80373b724b033cdf8a7b1f78bf5fb6a5d7a2182a9a403aa30894606e390 |
| turbo-cache-control | no-preview |
| go-import | github.com/Ktt-Development/simplehttpserver git https://github.com/Ktt-Development/simplehttpserver.git |
| octolytics-dimension-user_id | 58783525 |
| octolytics-dimension-user_login | Ktt-Development |
| octolytics-dimension-repository_id | 227455248 |
| octolytics-dimension-repository_nwo | Ktt-Development/simplehttpserver |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 227455248 |
| octolytics-dimension-repository_network_root_nwo | Ktt-Development/simplehttpserver |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | b8714db0002cf78dc2d2566571807e404d6cb817 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width