Fan

 

class

flux::FileResource

sys::Obj
  flux::Resource
    flux::FileResource

FileResource models a sys::File as a Flux resource.

Slots

childrenSource

override FileResource[]? children()

Get the navigation children of the resource. Return an empty list or null to indicate no children. Default returns null.

fileSource

const File file

The target file.

fileToIconSource

static Image fileToIcon(File f)

Get the icon for the specified file based on its mime type.

hasChildrenSource

override Bool hasChildren()

If we haven't loaded the children yet, then return true for directories and false for normal files.

iconSource

override Image icon

The icon is based on mime type.

makeSource

new make(Uri uri, File file)

Make a resource for the specified file.

nameSource

override Str name

Return the file name.

override Menu? popup(Frame? frame, Event? event)

Add command specific Files.

sizeToStrSource

static Str sizeToStr(Int? size)

Given a file size in bytes return a suitable string representation for display. If size is null return "".

sortFilesSource

static File[] sortFiles(File[] files)

Sort files in-place for display. Directories are always sorted before normal files using locale name comparison.

uriSource

override Uri uri

Overrides flux::Resource.uri

The absolute file uri

viewsSource

override Type[] views()

View types are based on mime type. Register a file view using the facet "fluxViewMimeType" with a Str value for the MIME type such as "image/png". You can also register with just the media type, for example use "image" to register a view on any image file.