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

Add a method to get path to user Downloads directory #80

Closed
AChep opened this issue Aug 4, 2023 · 7 comments · Fixed by #81
Closed

Add a method to get path to user Downloads directory #80

AChep opened this issue Aug 4, 2023 · 7 comments · Fixed by #81
Assignees
Milestone

Comments

@AChep
Copy link

AChep commented Aug 4, 2023

Seems like the original Python module got updated and now allows to pull even more useful directories! Would be amazing to have it on Java platform as it seems like there's no library that can do it yet.

https://github.com/platformdirs/platformdirs/tree/main

@harawata
Copy link
Owner

harawata commented Aug 4, 2023

Hello @AChep ,

Thank you for the idea!
I checked the linked page.
It seems that the download directory is a directory named "Downloads" in the user's home directory for all platforms.

In Java, System.getProperty("user.home") returns the path to the user's home directory, so it probably makes more sense for you to use it to create the path in your application.
This technique can be applied to the other similar directories (Music, Movies, etc.) as well.

@AChep
Copy link
Author

AChep commented Aug 4, 2023

@harawata unfortunately that is not the case for Windows, as it allows a user to change the Download directory location 😢

@harawata
Copy link
Owner

harawata commented Aug 4, 2023

There seems to be a KNOWNFOLDERID for the Downloads folder (374DE290-123F-4565-9164-39C4925E467B) and XDG has XDG_DOWNLOAD_DIR, so I'll add getUserDownloadsDir() (it should be plural, right?).
On macOS, it will always return ~/Downloads.

@AChep
Copy link
Author

AChep commented Aug 4, 2023

Yeah. Thanks a lot!

harawata added a commit that referenced this issue Aug 7, 2023
harawata added a commit that referenced this issue Aug 7, 2023
@harawata harawata added this to the 1.2.2 milestone Aug 8, 2023
@harawata harawata self-assigned this Aug 8, 2023
@harawata
Copy link
Owner

harawata commented Aug 8, 2023

Hello @AChep ,

I have merged #81 .
It would be great if you could try the latest 1.2.2-SNAPSHOT and see if everything works as you expected.

Thank you for taking the time to submit the request!

@harawata
Copy link
Owner

harawata commented Sep 2, 2023

Hi @AChep ,

I have released 1.2.2 just a moment ago.
If there's any problem, I will fix it and release 1.2.3.

Thanks again!

@AChep
Copy link
Author

AChep commented Sep 3, 2023

Hi @AChep ,

I have released 1.2.2 just a moment ago.
If there's any problem, I will fix it and release 1.2.3.

Thanks again!

Thanks! I should be working on a feature that depends on this in the next few months.

I'll make sure to report anything bad if I find it!

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

Successfully merging a pull request may close this issue.

2 participants