Skip to content

Can a Loader get info from the FileSystem such as the file's metadata? #7355

Answered by dev747368
hippietrail asked this question in Q&A
Discussion options

You must be logged in to vote

Your code is workable, but as pasted above would leak reference handles to the file system instance and prevent orderly closing of the file system.

If you wanted the 'correct' way, I would say something like (completely untested):

public class Apple2ProDosDskFileSystem extends AbstractFileSystem<ProDosEntry> {
  public FileAttributes getFileAttributes(GFile file, TaskMonitor monitor) {
    ProDosEntry metadata = fsIndex.getMetadata(file);
    return FileAttributes.of(
      // plus any others
      FileAttribute.create("ProDos File Metadata", metadata)
    );

class ProDosEntry {
  // will be called by the GUI to display this property in the file info dialog
  public String toString() {
    

Replies: 2 comments 6 replies

Comment options

You must be logged in to vote
6 replies
@ryanmkurtz
Comment options

@dev747368
Comment options

@hippietrail
Comment options

@dev747368
Comment options

Answer selected by hippietrail
@hippietrail
Comment options

@dev747368
Comment options

Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants