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

Pivotal ID # 185138199: User Files List Directories Size #705

Merged
merged 3 commits into from
May 12, 2023

Conversation

jhoanmanuelms
Copy link
Contributor

https://www.pivotaltracker.com/story/show/185138199

  • Add an option to avoid internal directory calculation size
  • Avoid directory calculation for the user space list endpoint

- Add an option to avoid internal directory calculation size
- Avoid directory calculation for the user space list endpoint
@jhoanmanuelms jhoanmanuelms self-assigned this May 10, 2023
@jhoanmanuelms jhoanmanuelms requested a review from Juan-EBI May 10, 2023 13:25
Copy link
Contributor

@Juan-EBI Juan-EBI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM please consider comments

fun size(file: File): Long = if (file.isFile) Files.size(file.toPath()) else calculateDirectorySize(file)
fun size(
file: File,
calculateDirectories: Boolean = true,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe iterateDirectories?

file: File,
calculateDirectories: Boolean = true,
): Long {
return if (file.isFile || !calculateDirectories) Files.size(file.toPath()) else calculateDirectorySize(file)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe (file.isDirectory && calculateDirectories)

@jhoanmanuelms jhoanmanuelms merged commit ea42442 into master May 12, 2023
@jhoanmanuelms jhoanmanuelms deleted the bugfix/pivotal-#185138199-user-dir-size branch May 12, 2023 11:38
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.

2 participants