Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

from(Class) #65

Open
xenoterracide opened this issue Nov 7, 2024 · 5 comments
Open

from(Class) #65

xenoterracide opened this issue Nov 7, 2024 · 5 comments

Comments

@xenoterracide
Copy link

would it be possible to simply derive the values from a class? for example my personal pattern is com.xenoteracide.library (all apps are libraries) which kind of? maps into what's needed for the values needed. I don't have a company, and I'm not certain on that impact so using xenoterracide for that would be fine. I'm just thinking this is the general convention for java. Deviance from this can actually cause problems

@soc
Copy link
Collaborator

soc commented Nov 7, 2024

@xenoterracide You can just do ProjectDirectories.from("com.xenoteracide", null, "library"), with the only impact that your Windows paths will lack the nested organization folder.

@xenoterracide
Copy link
Author

Of course but that doesn't change your API. Anyways it's just an idea. I feel like that naming convention though is the common one for Java. Which is why I'm thinking you could just do it from the class.

@soc
Copy link
Collaborator

soc commented Nov 7, 2024

True, I'm just not sure whether it's worth it compared to using the existing API with ProjectDirectories.from(YourClass.getPackageName(), null, YourClass.getSimpleName()) if that's what you want.

@xenoterracide
Copy link
Author

Yeah I don't understand the window side of this so much... Like the impact. I would think what it should be is (and I'm on my phone, code typos May abound) "com.xenotericide" "xenotericide" "simple name" because your organization name is almost always what's after the tld, having just a namespace of com seems weird.

Anyways, it's just an idea for something more conventional. Maybe it's a bad idea, maybe the java convention doesn't work with the mac and Windows conventions.

@soc
Copy link
Collaborator

soc commented Nov 7, 2024

As a background info: the function is the way it is (slightly unwieldy), because it tries getting enough information to work on all supported platforms, instead of e. g. having a method for one platform each and putting it on the user to call the right one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants