GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Change file name adapter so it runs on directories. · Issue #119 · Ktt-Development/simplehttpserver

This repository was archived by the owner on Jul 31, 2022. It is now read-only.
This repository was archived by the owner on Jul 31, 2022. It is now read-only.

Change file name adapter so it runs on directories. #119

Copy link
Copy link
Closed
#120
Closed
Change file name adapter so it runs on directories.#119
#120
Copy link
Assignees
Katsute
Labels
feature requestRequest a featureRequest a feature
Milestone
4.3.0

Description

@Katsute
Katsute
opened on Nov 17, 2020
Issue body actions

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 the project.

Proposal

Describe the feature that should be added.

Change adapter so it runs on all files.

simplehttpserver/src/main/java/com/kttdevelopment/simplehttpserver/handler/DirectoryEntry.java

Lines 149 to 151 in 63aa926

for(final File file : Objects.requireNonNullElse(parentFile.listFiles(), new File[0])){
if(fileName.equals(file.isDirectory() ? file.getName() : adapter.getName(file))) // use adapter name only if not a directory
return file;

for(final File file : Objects.requireNonNullElse(parentFile.listFiles(), new File[0])){
-    if(fileName.equals(file.isDirectory() ? file.getName() : adapter.getName(file))) // use adapter name only if not a directory
+    if(fileName.equals(adapter.getName(file))
        return file;

Reasoning

Explain why this feature should be added.

Developers may want to use adapter names against directories , specifically for checking within them (see https://github.com/Ktt-Development/webdir/pull/79).

If this change is made existing developers can simply use (below) to replicate the previous behavior.

@Override
public final String getName(final File file){
    return file.isDirectory() ? file.getName() : super.getName(file);
}

Activity

  1. Katsute
    added
    feature requestRequest a featureRequest a feature
    on Nov 17, 2020
  2. Katsute
    added this to the 4.3.0 milestone on Nov 17, 2020
  3. Katsute
    self-assigned this
    on Nov 17, 2020
  4. Katsute
    added a commit that references this issue on Nov 18, 2020

    Implement #119

    0be2546
  5. Katsute
    closed this as completedin #120on Nov 18, 2020
  6. Katsute
    added a commit that references this issue on Nov 18, 2020

    Changed adapter so it works with directory names (#120)

    b133a99
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

  • @Katsute
    Katsute

Labels

feature requestRequest a featureRequest a feature

Type

No type

Projects

No projects

    Milestone

    • 4.3.0

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    You are visitor 01402503 — GeezerVison does not store the pages you look up.
    Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.