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

Support optional --use-temp-dir in get to download to temp dir and copy, to avoid partial jar if interrupted #434

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

potomato
Copy link

@potomato potomato commented Jun 7, 2024

Hi,

This is the first draft of small change to download server jar to temp folder to address my issue.

Some brief notes

  • I've tried to keep it small
  • Currently it only deals with the single file download. I've not added anything to the OutputToDirectoryHandler yet. Not sure if this is worthwhile but very happy to for consistency
  • I've got negative tests for the new switch plus a test that it works when specifying a temporary directory
  • The successful test doesn't actually verify it uses the download directory. This is doable with a file system watcher so I'd be happy to do it if you think it's worthwhile.

I'm not a java dev so very happy to receive any requests for changes from tiny to massive.

Thanks.

@itzg
Copy link
Owner

itzg commented Jun 7, 2024

Cool. I'll look more at the code later when I'm at a computer.

My initial thought though is that I'd prefer it use the option to download to a temp file in the same directory where the final file will be located. I'm thinking it's like how chrome will name the downloading file the real name with ".download" (or something like that) appended to it. The challenge with a temp directory is identifying where a good one would be within the container -- I think I have encountered cases where /tmp surprisingly wasn't viable.

@potomato
Copy link
Author

potomato commented Jun 7, 2024

Happy to switch it around as needed. Let me know the best approach in due course and I'll revise it.

@itzg
Copy link
Owner

itzg commented Jun 7, 2024

Please go ahead switch to an adjacent temp file rather than the temp directory approach.

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

Successfully merging this pull request may close these issues.

3 participants