Skip to content

Support named FileStore space attributes - #168

Merged
marschall merged 1 commit into
marschall:masterfrom
PHJ2000:fix/file-store-space-attributes
Nov 11, 2026
Merged

marschall merged 1 commit into
marschall:masterfrom
PHJ2000:fix/file-store-space-attributes

Conversation

@PHJ2000

@PHJ2000 PHJ2000 commented Nov 6, 2026

Copy link
Copy Markdown
Contributor

Refs #127.

Support totalSpace, usableSpace and unallocatedSpace in FileStore.getAttribute(String) by delegating to the existing space accessors. These names currently throw UnsupportedOperationException even though the typed methods already provide the values.

The attributes return boxed long values and retain the current live heap estimates. Unknown, differently cased, prefixed and null attribute names remain unsupported. The closed-filesystem check still runs first. File-attribute-view support, capacity calculations and allocation behavior are unchanged.

Add regressions for attributes obtained through the public filesystem API, exact delegation to the existing accessors, unsupported names and closed filesystems. The tests avoid comparing separate free-memory samples, which can change between calls.

Validation on Linux with JDK 11.0.32.1:

  • The same 12 focused tests compile and execute on both versions: base has 2 errors and 10 passes; the fixed version passes all 12. The errors are the missing supported attribute lookups; existing file-store controls pass.
  • mvn --batch-mode --no-transfer-progress --show-version clean verify completes with 1,993 passing tests, 16 skipped and no failures or errors (2,009 entries, including 2 integration tests). The 16 skipped cases comprise eight explicitly disabled tests, seven tests aborted because the opened directory stream did not satisfy the SecureDirectoryStream support assumption, and one nested-ZIP test excluded by the JDK version condition. Packaging and Javadoc also succeed.
  • Other CI JDKs and operating systems have not been run locally.

Focused command:

mvn --batch-mode --no-transfer-progress --show-version -Dtest=MemoryFileStoreAttributesTest,MemoryFileStoreTest test

@marschall marschall self-assigned this Nov 11, 2026
@marschall marschall added this to the 2.8.4 milestone Nov 11, 2026
@marschall

Copy link
Copy Markdown
Owner

Again, thank you.

@marschall
marschall merged commit aedaf7b into marschall:master Nov 11, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants