The reblocks-file-server Reference Manual

This is the reblocks-file-server Reference Manual, version 0.5.0, generated automatically by Declt version 4.0 beta 2 "William Riker" on Tue Jul 15 06:31:49 2025 GMT+0.

Table of Contents


1 Introduction


2 Systems

The main system appears first, followed by any subsystem dependency.


2.1 reblocks-file-server

A Reblocks extension allowing to create routes for serving static files from disk.

Author

Alexander Artemenko <>

Home Page

https://40ants.com/reblocks-file-server/

Source Control

(GIT https://github.com/40ants/reblocks-file-server)

Bug Tracker

https://github.com/40ants/reblocks-file-server/issues

License

Unlicense

Long Description

<a id="x-28REBLOCKS-FILE-SERVER-DOCS-2FINDEX-3A-40README-2040ANTS-DOC-2FLOCATIVES-3ASECTION-29"></a>

# reblocks-file-server - A Reblocks extension allowing to create routes for serving static files from disk.

<a id="reblocks-file-server-asdf-system-details"></a>

## REBLOCKS-FILE-SERVER ASDF System Details

* Description: A Reblocks extension allowing to create routes for serving static files from disk.
* Licence: Unlicense
* Author: Alexander Artemenko <svetlyak.40wt@gmail.com>
* Homepage: [https://40ants.com/reblocks-file-server/][f449]
* Bug tracker: [https://github.com/40ants/reblocks-file-server/issues][a450]
* Source control: [GIT][b09a]
* Depends on: [40ants-routes][25b9], [alexandria][8236], [cl-fad][1059], [cl-ppcre][49b9], [local-time][46a1], [log4cl][7f8b], [reblocks][184b], [reblocks-ui2][85c5], [routes][48e8], [serapeum][c41d], [str][ef7f], [trivial-mimes][a154]

[![](https://github-actions.40ants.com/40ants/reblocks-file-server/matrix.svg?only=ci.run-tests)][4729]

![](http://quickdocs.org/badge/reblocks-file-server.svg)

<a id="x-28REBLOCKS-FILE-SERVER-DOCS-2FINDEX-3A-3A-40INSTALLATION-2040ANTS-DOC-2FLOCATIVES-3ASECTION-29"></a>

## Installation

You can install this library from Quicklisp, but you want to receive updates quickly, then install it from Ultralisp.org:

“‘
(ql-dist:install-dist "http://dist.ultralisp.org/"
:prompt nil)
(ql:quickload :reblocks-file-server)
“‘
<a id="x-28REBLOCKS-FILE-SERVER-DOCS-2FINDEX-3A-3A-40USAGE-2040ANTS-DOC-2FLOCATIVES-3ASECTION-29"></a>

## Usage

A small demo of what this library does:

![](https://storage.yandexcloud.net/40ants-public/reblocks-file-server/reblocks-file-server.gif)

Here is an example on how this library can be used. All you need is to add a results of call to
[‘file-server‘][7dcb] function call to you Reblocks application’s routes.

“‘lisp
(defapp app
:prefix "/"
:routes ((page ("/" :name "index")
(make-landing-page))

;; On /documents/
(file-server "/sources/"
:name "sources"
:root (asdf:system-relative-pathname :my-app "./"))))
“‘
In this example, we will show sources of the ‘my-app‘ ‘ASDF‘ library starting
from path ‘/sources/‘, ie if user opens your site like https://example.com/sources/,
he will see content of the directory returned by ‘(asdf:system-relative-pathname :my-app "./")‘.

By default, all files and directories are shown. If you want to hide something from user,
you might provide a list of functions which accepts a pathname and returns ‘:ALLOW‘ ‘:DENY‘ or ‘NIL‘.

Here is a relatively complex example of filtering:

“‘
(file-server "/sources/"
:name "sources"
:root (asdf:system-relative-pathname :my-app "./")
:filter (list
;; This is how to hide a file inside the current
;; directory
(deny #P"main.lisp")
;; Or inside some particular directory
(deny #P"pages/*.fasl")
;; Also you might whitelist some directories
;; and files:
(allow #P"**/" ;; Allow to show any directory
#P"**/*.lisp"
#P"favicons/*.png"
#P"favicons/*.ico")
;; and then deny the rest.
;;
;; We need this part because by default
;; all files are allowed:
(deny-all)))
“‘
Here we’ve used these utils functions:

* [‘allow‘][0d22]
* [‘deny‘][f929]
* [‘deny-all‘][e35d]

Read more about how filtering work in the [‘Filtering‘][1984] section.

<a id="x-28REBLOCKS-FILE-SERVER-DOCS-2FINDEX-3A-3A-40FILTERING-2040ANTS-DOC-2FLOCATIVES-3ASECTION-29"></a>

## Filtering

‘FILTER‘ argument of [‘file-server‘][7dcb] function accepts a function or a list of functions
where each function should accept a pathname relative to the ‘ROOT‘ argument given
to the [‘file-server‘][7dcb] function and return ‘:ALLOW‘, ‘:DENY‘ or ‘NIL‘.

When function returns ‘:ALLOW‘ or ‘:DENY‘, processing is stopped and user see either
content or 404 error page. If filter function returns ‘NIL‘, then other filter functions
are checked.

If no functions matched the current path, then reblocks file server consider it to
be allowed. So we have a black-list mode as a default - if you want something to
be denied - deny it!

In this example we deny access to a ‘config.lisp‘ file and fasl files in all directories.
All other files and directories will be allowed:

“‘
(list
(deny #P"config.lisp")
(deny #P"**/*.fasl"))
“‘
Here I’ve used [‘deny‘][f929] helper which accepts a template pathname and returns a function which
checks given pathname to this template pathname.

To switch to the white-list mode, you need to add a last rule which will deny access to
any file or directory. Use [‘deny-all‘][e35d] helper for this.

In the next example we deny access to all files and directories but allow listing of
any directory and files with ‘lisp‘ extension:

“‘
(list
(allow ;; Allow to show any directory
#P"**/"
;; Allow any lisp file
#P"**/*.lisp")
(deny-all))
“‘
If you need some special filtering, then you can use [‘allow-if‘][adfb] or [‘deny-if‘][2c59]
functions. This is an example how to define a filter to hide empty directories:

“‘
(deny-if (lambda (path)
(and
(cl-fad:directory-pathname-p path)
(uiop:emptyp
(cl-fad:list-directory
(merge-pathnames path
(asdf:system-relative-pathname :my-app "./")))))))
“‘
<a id="x-28REBLOCKS-FILE-SERVER-DOCS-2FINDEX-3A-3A-40API-2040ANTS-DOC-2FLOCATIVES-3ASECTION-29"></a>

## API

<a id="x-28REBLOCKS-FILE-SERVER-DOCS-2FINDEX-3A-3A-40REBLOCKS-FILE-SERVER-2FCORE-3FPACKAGE-2040ANTS-DOC-2FLOCATIVES-3ASECTION-29"></a>

### REBLOCKS-FILE-SERVER/CORE

<a id="x-28-23A-28-2825-29-20BASE-CHAR-20-2E-20-22REBLOCKS-FILE-SERVER-2FCORE-22-29-20PACKAGE-29"></a>

#### [package](d7e0) ‘reblocks-file-server/core‘

<a id="x-28REBLOCKS-FILE-SERVER-DOCS-2FINDEX-3A-3A-7C-40REBLOCKS-FILE-SERVER-2FCORE-3FClasses-SECTION-7C-2040ANTS-DOC-2FLOCATIVES-3ASECTION-29"></a>

#### Classes

<a id="x-28REBLOCKS-FILE-SERVER-DOCS-2FINDEX-3A-3A-40REBLOCKS-FILE-SERVER-2FCORE-24FILE-SERVER-ROUTE-3FCLASS-2040ANTS-DOC-2FLOCATIVES-3ASECTION-29"></a>

##### FILE-SERVER-ROUTE

<a id="x-28REBLOCKS-FILE-SERVER-2FCORE-3AFILE-SERVER-ROUTE-20CLASS-29"></a>

###### [class](5c57) ‘reblocks-file-server/core:file-server-route‘ (page-route)

**Readers**

<a id="x-28REBLOCKS-FILE-SERVER-2FCORE-3ADIRECTORIES-FIRST-P-20-2840ANTS-DOC-2FLOCATIVES-3AREADER-20REBLOCKS-FILE-SERVER-2FCORE-3AFILE-SERVER-ROUTE-29-29"></a>

###### [reader](8b2e) ‘reblocks-file-server/core:directories-first-p‘ (file-server-route) (:directories-first-p = t)

<a id="x-28REBLOCKS-FILE-SERVER-2FCORE-3AFILENAME-FILTER-20-2840ANTS-DOC-2FLOCATIVES-3AREADER-20REBLOCKS-FILE-SERVER-2FCORE-3AFILE-SERVER-ROUTE-29-29"></a>

###### [reader](7b8f) ‘reblocks-file-server/core:filename-filter‘ (file-server-route) (:filter = (lambda (pathname) (declare (ignore pathname)) t))

A regular expression to show only selected files.

<a id="x-28REBLOCKS-FILE-SERVER-2FCORE-3AGET-DIR-LISTING-20-2840ANTS-DOC-2FLOCATIVES-3AREADER-20REBLOCKS-FILE-SERVER-2FCORE-3AFILE-SERVER-ROUTE-29-29"></a>

###### [reader](dce7) ‘reblocks-file-server/core:get-dir-listing‘ (file-server-route) (:dir-listing = t)

When nil, directory contents is not shown.

<a id="x-28REBLOCKS-FILE-SERVER-2FCORE-3AGET-ROOT-20-2840ANTS-DOC-2FLOCATIVES-3AREADER-20REBLOCKS-FILE-SERVER-2FCORE-3AFILE-SERVER-ROUTE-29-29"></a>

###### [reader](a18b) ‘reblocks-file-server/core:get-root‘ (file-server-route) (:root)

<a id="x-28REBLOCKS-FILE-SERVER-DOCS-2FINDEX-3A-3A-7C-40REBLOCKS-FILE-SERVER-2FCORE-3FFunctions-SECTION-7C-2040ANTS-DOC-2FLOCATIVES-3ASECTION-29"></a>

#### Functions

<a id="x-28REBLOCKS-FILE-SERVER-2FCORE-3AFILE-SERVER-20FUNCTION-29"></a>

##### [function](019c) ‘reblocks-file-server/core:file-server‘ uri-path &key name (route-class ’file-server-route) (root (uiop/pathname:ensure-directory-pathname \*default-pathname-defaults\*)) (dir-listing t) (filter nil)

Returns a [‘file-server-route‘][9550] object suitable for including into Reblocks routes hierarchy.

‘FILTER‘ argument should be a ‘NIL‘ or a list of filter functions which accept a pathname
and return ‘:ALLOW‘ ‘:DENY‘ or ‘NIL‘.

<a id="x-28REBLOCKS-FILE-SERVER-2FCORE-3ALIST-DIRECTORY-20FUNCTION-29"></a>

##### [function](cb27) ‘reblocks-file-server/core:list-directory‘ route-path directory-relative-path filter &key directories-first-p

Returns a list of files in the directory.
All items of the list are relative.

<a id="x-28REBLOCKS-FILE-SERVER-DOCS-2FINDEX-3A-3A-40REBLOCKS-FILE-SERVER-2FUTILS-3FPACKAGE-2040ANTS-DOC-2FLOCATIVES-3ASECTION-29"></a>

### REBLOCKS-FILE-SERVER/UTILS

<a id="x-28-23A-28-2826-29-20BASE-CHAR-20-2E-20-22REBLOCKS-FILE-SERVER-2FUTILS-22-29-20PACKAGE-29"></a>

#### [package](0a66) ‘reblocks-file-server/utils‘

<a id="x-28REBLOCKS-FILE-SERVER-DOCS-2FINDEX-3A-3A-7C-40REBLOCKS-FILE-SERVER-2FUTILS-3FFunctions-SECTION-7C-2040ANTS-DOC-2FLOCATIVES-3ASECTION-29"></a>

#### Functions

<a id="x-28REBLOCKS-FILE-SERVER-2FUTILS-3AALLOW-20FUNCTION-29"></a>

##### [function](7cf5) ‘reblocks-file-server/utils:allow‘ pathname &rest more-pathnames

Returns a function of one argument which will check this argument against given pathnames and if there is match, returns ‘:ALLOW‘.

<a id="x-28REBLOCKS-FILE-SERVER-2FUTILS-3AALLOW-IF-20FUNCTION-29"></a>

##### [function](1036) ‘reblocks-file-server/utils:allow-if‘ predicate

Returns a function of one argument which will check an argument against given predicate and if it returns T, returns ‘:ALLOW‘.

<a id="x-28REBLOCKS-FILE-SERVER-2FUTILS-3ADENY-20FUNCTION-29"></a>

##### [function](acf1) ‘reblocks-file-server/utils:deny‘ pathname &rest more-pathnames

Returns a function of one argument which will check this argument against given pathnames and if there is match, returns ‘:DENY‘.

<a id="x-28REBLOCKS-FILE-SERVER-2FUTILS-3ADENY-ALL-20FUNCTION-29"></a>

##### [function](8972) ‘reblocks-file-server/utils:deny-all‘

Returns a function which will deny all files.

<a id="x-28REBLOCKS-FILE-SERVER-2FUTILS-3ADENY-IF-20FUNCTION-29"></a>

##### [function](9f58) ‘reblocks-file-server/utils:deny-if‘ predicate

Returns a function of one argument which will check an argument against given predicate and if it returns T, returns ‘:DENY‘.

<a id="x-28REBLOCKS-FILE-SERVER-DOCS-2FINDEX-3A-3A-7C-40REBLOCKS-FILE-SERVER-2FUTILS-3FTypes-SECTION-7C-2040ANTS-DOC-2FLOCATIVES-3ASECTION-29"></a>

#### Types

<a id="x-28REBLOCKS-FILE-SERVER-2FUTILS-3AFILTER-FUNCTION-20-28TYPE-29-29"></a>

##### [type](ae44) ‘reblocks-file-server/utils:filter-function‘

“‘
(FUNCTION (PATHNAME) (VALUES (MEMBER :ALLOW :DENY NIL)))
“‘

[f449]: https://40ants.com/reblocks-file-server/
[7dcb]: https://40ants.com/reblocks-file-server/#x-28REBLOCKS-FILE-SERVER-2FCORE-3AFILE-SERVER-20FUNCTION-29
[9550]: https://40ants.com/reblocks-file-server/#x-28REBLOCKS-FILE-SERVER-2FCORE-3AFILE-SERVER-ROUTE-20CLASS-29
[0d22]: https://40ants.com/reblocks-file-server/#x-28REBLOCKS-FILE-SERVER-2FUTILS-3AALLOW-20FUNCTION-29
[adfb]: https://40ants.com/reblocks-file-server/#x-28REBLOCKS-FILE-SERVER-2FUTILS-3AALLOW-IF-20FUNCTION-29
[f929]: https://40ants.com/reblocks-file-server/#x-28REBLOCKS-FILE-SERVER-2FUTILS-3ADENY-20FUNCTION-29
[e35d]: https://40ants.com/reblocks-file-server/#x-28REBLOCKS-FILE-SERVER-2FUTILS-3ADENY-ALL-20FUNCTION-29
[2c59]: https://40ants.com/reblocks-file-server/#x-28REBLOCKS-FILE-SERVER-2FUTILS-3ADENY-IF-20FUNCTION-29
[1984]: https://40ants.com/reblocks-file-server/#x-28REBLOCKS-FILE-SERVER-DOCS-2FINDEX-3A-3A-40FILTERING-2040ANTS-DOC-2FLOCATIVES-3ASECTION-29
[b09a]: https://github.com/40ants/reblocks-file-server
[4729]: https://github.com/40ants/reblocks-file-server/actions
[d7e0]: https://github.com/40ants/reblocks-file-server/blob/3158815936a8540f90884dcdf75beffcbdd5e1ce/src/core.lisp#L1
[cb27]: https://github.com/40ants/reblocks-file-server/blob/3158815936a8540f90884dcdf75beffcbdd5e1ce/src/core.lisp#L198
[5c57]: https://github.com/40ants/reblocks-file-server/blob/3158815936a8540f90884dcdf75beffcbdd5e1ce/src/core.lisp#L64
[a18b]: https://github.com/40ants/reblocks-file-server/blob/3158815936a8540f90884dcdf75beffcbdd5e1ce/src/core.lisp#L65
[dce7]: https://github.com/40ants/reblocks-file-server/blob/3158815936a8540f90884dcdf75beffcbdd5e1ce/src/core.lisp#L68
[8b2e]: https://github.com/40ants/reblocks-file-server/blob/3158815936a8540f90884dcdf75beffcbdd5e1ce/src/core.lisp#L73
[7b8f]: https://github.com/40ants/reblocks-file-server/blob/3158815936a8540f90884dcdf75beffcbdd5e1ce/src/core.lisp#L77
[019c]: https://github.com/40ants/reblocks-file-server/blob/3158815936a8540f90884dcdf75beffcbdd5e1ce/src/core.lisp#L97
[0a66]: https://github.com/40ants/reblocks-file-server/blob/3158815936a8540f90884dcdf75beffcbdd5e1ce/src/utils.lisp#L1
[acf1]: https://github.com/40ants/reblocks-file-server/blob/3158815936a8540f90884dcdf75beffcbdd5e1ce/src/utils.lisp#L110
[9f58]: https://github.com/40ants/reblocks-file-server/blob/3158815936a8540f90884dcdf75beffcbdd5e1ce/src/utils.lisp#L125
[8972]: https://github.com/40ants/reblocks-file-server/blob/3158815936a8540f90884dcdf75beffcbdd5e1ce/src/utils.lisp#L138
[ae44]: https://github.com/40ants/reblocks-file-server/blob/3158815936a8540f90884dcdf75beffcbdd5e1ce/src/utils.lisp#L25
[1036]: https://github.com/40ants/reblocks-file-server/blob/3158815936a8540f90884dcdf75beffcbdd5e1ce/src/utils.lisp#L82
[7cf5]: https://github.com/40ants/reblocks-file-server/blob/3158815936a8540f90884dcdf75beffcbdd5e1ce/src/utils.lisp#L95
[a450]: https://github.com/40ants/reblocks-file-server/issues
[25b9]: https://quickdocs.org/40ants-routes
[8236]: https://quickdocs.org/alexandria
[1059]: https://quickdocs.org/cl-fad
[49b9]: https://quickdocs.org/cl-ppcre
[46a1]: https://quickdocs.org/local-time
[7f8b]: https://quickdocs.org/log4cl
[184b]: https://quickdocs.org/reblocks
[85c5]: https://quickdocs.org/reblocks-ui2
[48e8]: https://quickdocs.org/routes
[c41d]: https://quickdocs.org/serapeum
[ef7f]: https://quickdocs.org/str
[a154]: https://quickdocs.org/trivial-mimes

* * *
###### [generated by [40ANTS-DOC](https://40ants.com/doc/)]

Version

0.5.0

Defsystem Dependency

40ants-asdf-system (system).

Dependency

reblocks-file-server/core (system).

Source

reblocks-file-server.asd.


2.2 reblocks-file-server/core

Author

Alexander Artemenko <>

Home Page

https://40ants.com/reblocks-file-server/

Source Control

(GIT https://github.com/40ants/reblocks-file-server)

Bug Tracker

https://github.com/40ants/reblocks-file-server/issues

License

Unlicense

Dependencies
  • log4cl (system).
  • trivial-mimes (system).
  • reblocks/request (system).
  • reblocks/html (system).
  • reblocks/utils/misc (system).
  • reblocks/routes (system).
  • routes (system).
  • cl-fad (system).
  • cl-ppcre (system).
  • 40ants-routes/route (system).
  • 40ants-routes/matched-route (system).
  • serapeum (system).
  • reblocks-ui2/widget (system).
  • reblocks-ui2/themes/tailwind (system).
  • str (system).
  • reblocks-ui2/tables/table (system).
  • reblocks-ui2/html (system).
  • local-time (system).
  • reblocks-ui2/card (system).
  • reblocks-file-server/utils (system).
  • alexandria (system).
Source

reblocks-file-server.asd.


2.3 reblocks-file-server/utils

Author

Alexander Artemenko <>

Home Page

https://40ants.com/reblocks-file-server/

Source Control

(GIT https://github.com/40ants/reblocks-file-server)

Bug Tracker

https://github.com/40ants/reblocks-file-server/issues

License

Unlicense

Dependency

serapeum (system).

Source

reblocks-file-server.asd.


3 Files

Files are sorted by type and then listed depth-first from the systems components trees.


3.1 Lisp


3.1.1 reblocks-file-server/reblocks-file-server.asd

Source

reblocks-file-server.asd.

Parent Component

reblocks-file-server (system).

ASDF Systems

3.1.2 reblocks-file-server/core/file-type.lisp

Source

reblocks-file-server.asd.

Parent Component

reblocks-file-server/core (system).

Packages

reblocks-file-server/core.

Public Interface
Internals

3.1.3 reblocks-file-server/utils/file-type.lisp

Source

reblocks-file-server.asd.

Parent Component

reblocks-file-server/utils (system).

Packages

reblocks-file-server/utils.

Public Interface
Internals

4 Packages

Packages are listed by definition order.


4.1 reblocks-file-server/utils

Source

file-type.lisp.

Use List

common-lisp.

Public Interface
Internals

4.2 reblocks-file-server/core

Source

file-type.lisp.

Nickname

reblocks-file-server

Use List

common-lisp.

Public Interface
Internals

5 Definitions

Definitions are sorted by export status, category, package, and then by lexicographic order.


5.1 Public Interface


5.1.1 Ordinary functions

Function: allow (pathname &rest more-pathnames)

Returns a function of one argument which will check this argument against given pathnames and if there is match, returns :ALLOW.

Package

reblocks-file-server/utils.

Source

file-type.lisp.

Function: allow-if (predicate)

Returns a function of one argument which will check an argument against given predicate and if it returns T, returns :ALLOW.

Package

reblocks-file-server/utils.

Source

file-type.lisp.

Function: deny (pathname &rest more-pathnames)

Returns a function of one argument which will check this argument against given pathnames and if there is match, returns :DENY.

Package

reblocks-file-server/utils.

Source

file-type.lisp.

Function: deny-all ()

Returns a function which will deny all files.

Package

reblocks-file-server/utils.

Source

file-type.lisp.

Function: deny-if (predicate)

Returns a function of one argument which will check an argument against given predicate and if it returns T, returns :DENY.

Package

reblocks-file-server/utils.

Source

file-type.lisp.

Function: file-server (uri-path &key name route-class root dir-listing filter)

Returns a FILE-SERVER-ROUTE object suitable for including into Reblocks routes hierarchy.

FILTER argument should be a NIL or a list of filter functions which accept a pathname and return :ALLOW :DENY or NIL.

Package

reblocks-file-server/core.

Source

file-type.lisp.

Function: list-directory (route-path directory-relative-path filter &key directories-first-p)

Returns a list of files in the directory. All items of the list are relative.

Package

reblocks-file-server/core.

Source

file-type.lisp.


5.1.2 Generic functions

Generic Reader: directories-first-p (object)
Package

reblocks-file-server/core.

Methods
Reader Method: directories-first-p ((directory-widget directory-widget))

automatically generated reader method

Source

file-type.lisp.

Target Slot

directories-first-p.

Reader Method: directories-first-p ((file-server-route file-server-route))

automatically generated reader method

Source

file-type.lisp.

Target Slot

directories-first-p.

Generic Reader: filename-filter (object)
Package

reblocks-file-server/core.

Methods
Reader Method: filename-filter ((file-server-route file-server-route))

A regular expression to show only selected files.

Source

file-type.lisp.

Target Slot

filter.

Generic Reader: get-dir-listing (object)
Package

reblocks-file-server/core.

Methods
Reader Method: get-dir-listing ((file-server-route file-server-route))

When nil, directory contents is not shown.

Source

file-type.lisp.

Target Slot

dir-listing.

Generic Reader: get-root (object)
Package

reblocks-file-server/core.

Methods
Reader Method: get-root ((file-server-route file-server-route))

automatically generated reader method

Source

file-type.lisp.

Target Slot

root.


5.1.3 Standalone methods

Method: render ((widget file-widget) (theme tailwind-theme))
Package

reblocks-ui2/widget.

Source

file-type.lisp.

Method: render ((widget file-not-found-widget) (theme tailwind-theme))
Package

reblocks-ui2/widget.

Source

file-type.lisp.

Method: render ((widget directory-widget) (theme tailwind-theme))
Package

reblocks-ui2/widget.

Source

file-type.lisp.


5.1.4 Classes

Class: file-server-route
Package

reblocks-file-server/core.

Source

file-type.lisp.

Direct superclasses

page-route.

Direct methods
Direct slots
Slot: root
Type

pathname

Initargs

:root

Readers

get-root.

Writers

This slot is read-only.

Slot: dir-listing

When nil, directory contents is not shown.

Type

boolean

Initform

t

Initargs

:dir-listing

Readers

get-dir-listing.

Writers

This slot is read-only.

Slot: directories-first-p
Type

boolean

Initform

t

Initargs

:directories-first-p

Readers

directories-first-p.

Writers

This slot is read-only.

Slot: filter

A regular expression to show only selected files.

Type

reblocks-file-server/utils:filter-function

Initform

(lambda (pathname) (declare (ignore pathname)) t)

Initargs

:filter

Readers

filename-filter.

Writers

This slot is read-only.


5.1.5 Types

Type: filter-function ()
Package

reblocks-file-server/utils.

Source

file-type.lisp.


5.2 Internals


5.2.1 Ordinary functions

Function: compose-filters (filters)

Returns a function which calls each filter and returns :ALLOW or :DENY when the first of them returns it.

All filters should be the same arity.

Package

reblocks-file-server/utils.

Source

file-type.lisp.

Function: ensure-has-directory (pathname)
Package

reblocks-file-server/utils.

Source

file-type.lisp.

Function: file-server-handler (&key path)
Package

reblocks-file-server/core.

Source

file-type.lisp.

Function: get-parent (path)

Returns the parent directory of the given PATH as a pathname. Returns NIL if the path does not have a parent directory (e.g., root).

Package

reblocks-file-server/core.

Source

file-type.lisp.

Function: image-to-base64 (path)

Returns an image as base64 encoded string like this "data:image/png;base64,iVBOR...".

Package

reblocks-file-server/core.

Source

file-type.lisp.

Function: match-pathnames (pathname pathname-templates value-to-return)
Package

reblocks-file-server/utils.

Source

file-type.lisp.

Function: sort-pathnames-dirs-first (left right)
Package

reblocks-file-server/core.

Source

file-type.lisp.


5.2.2 Generic functions

Generic Reader: directory-widget-directory-relative-path (object)
Package

reblocks-file-server/core.

Methods
Reader Method: directory-widget-directory-relative-path ((directory-widget directory-widget))

Path of the current directory relative to the ‘route-root-path‘.

Source

file-type.lisp.

Target Slot

directory-relative-path.

Generic Reader: directory-widget-filter (object)
Package

reblocks-file-server/core.

Methods
Reader Method: directory-widget-filter ((directory-widget directory-widget))

Regex filter to show only entries matched by the filter..

Source

file-type.lisp.

Target Slot

filter.

Generic Reader: directory-widget-path (object)
Package

reblocks-file-server/core.

Methods
Reader Method: directory-widget-path ((directory-widget directory-widget))

A path extracted from current URL.

Source

file-type.lisp.

Target Slot

path.

Generic Reader: directory-widget-route-root-path (object)
Package

reblocks-file-server/core.

Methods
Reader Method: directory-widget-route-root-path ((directory-widget directory-widget))

An original path of the reblocks file server’s route.

Source

file-type.lisp.

Target Slot

route-root-path.

Generic Reader: file-not-found-path (object)
Package

reblocks-file-server/core.

Methods
Reader Method: file-not-found-path ((file-not-found-widget file-not-found-widget))

A path extracted from current URL.

Source

file-type.lisp.

Target Slot

path.

Generic Reader: file-widget-full-path (object)
Package

reblocks-file-server/core.

Methods
Reader Method: file-widget-full-path ((file-widget file-widget))

File’s pathname on the disk.

Source

file-type.lisp.

Target Slot

full-path.

Generic Reader: file-widget-path (object)
Package

reblocks-file-server/core.

Methods
Reader Method: file-widget-path ((file-widget file-widget))

A path extracted from current URL.

Source

file-type.lisp.

Target Slot

path.


5.2.3 Classes

Class: directory-widget
Package

reblocks-file-server/core.

Source

file-type.lisp.

Direct superclasses

ui-widget.

Direct methods
Direct slots
Slot: path

A path extracted from current URL.

Type

pathname

Initargs

:path

Readers

directory-widget-path.

Writers

This slot is read-only.

Slot: route-root-path

An original path of the reblocks file server’s route.

Type

pathname

Initargs

:route-root-path

Readers

directory-widget-route-root-path.

Writers

This slot is read-only.

Slot: directory-relative-path

Path of the current directory relative to the ‘route-root-path‘.

Type

pathname

Initargs

:directory-relative-path

Readers

directory-widget-directory-relative-path.

Writers

This slot is read-only.

Slot: directories-first-p
Type

boolean

Initform

t

Initargs

:directories-first-p

Readers

directories-first-p.

Writers

This slot is read-only.

Slot: filter

Regex filter to show only entries matched by the filter..

Type

function

Initform

(lambda (reblocks-file-server/core::f) (declare (ignore reblocks-file-server/core::f)) t)

Initargs

:filter

Readers

directory-widget-filter.

Writers

This slot is read-only.

Class: file-not-found-widget
Package

reblocks-file-server/core.

Source

file-type.lisp.

Direct superclasses

ui-widget.

Direct methods
Direct slots
Slot: path

A path extracted from current URL.

Type

pathname

Initargs

:path

Readers

file-not-found-path.

Writers

This slot is read-only.

Class: file-widget
Package

reblocks-file-server/core.

Source

file-type.lisp.

Direct superclasses

ui-widget.

Direct methods
Direct slots
Slot: path

A path extracted from current URL.

Type

pathname

Initargs

:path

Readers

file-widget-path.

Writers

This slot is read-only.

Slot: full-path

File’s pathname on the disk.

Type

pathname

Initargs

:full-path

Readers

file-widget-full-path.

Writers

This slot is read-only.


Appendix A Indexes


A.1 Concepts


A.2 Functions

Jump to:   A   C   D   E   F   G   I   L   M   R   S  
Index Entry  Section

A
allow: Public ordinary functions
allow-if: Public ordinary functions

C
compose-filters: Private ordinary functions

D
deny: Public ordinary functions
deny-all: Public ordinary functions
deny-if: Public ordinary functions
directories-first-p: Public generic functions
directories-first-p: Public generic functions
directories-first-p: Public generic functions
directory-widget-directory-relative-path: Private generic functions
directory-widget-directory-relative-path: Private generic functions
directory-widget-filter: Private generic functions
directory-widget-filter: Private generic functions
directory-widget-path: Private generic functions
directory-widget-path: Private generic functions
directory-widget-route-root-path: Private generic functions
directory-widget-route-root-path: Private generic functions

E
ensure-has-directory: Private ordinary functions

F
file-not-found-path: Private generic functions
file-not-found-path: Private generic functions
file-server: Public ordinary functions
file-server-handler: Private ordinary functions
file-widget-full-path: Private generic functions
file-widget-full-path: Private generic functions
file-widget-path: Private generic functions
file-widget-path: Private generic functions
filename-filter: Public generic functions
filename-filter: Public generic functions
Function, allow: Public ordinary functions
Function, allow-if: Public ordinary functions
Function, compose-filters: Private ordinary functions
Function, deny: Public ordinary functions
Function, deny-all: Public ordinary functions
Function, deny-if: Public ordinary functions
Function, ensure-has-directory: Private ordinary functions
Function, file-server: Public ordinary functions
Function, file-server-handler: Private ordinary functions
Function, get-parent: Private ordinary functions
Function, image-to-base64: Private ordinary functions
Function, list-directory: Public ordinary functions
Function, match-pathnames: Private ordinary functions
Function, sort-pathnames-dirs-first: Private ordinary functions

G
Generic Function, directories-first-p: Public generic functions
Generic Function, directory-widget-directory-relative-path: Private generic functions
Generic Function, directory-widget-filter: Private generic functions
Generic Function, directory-widget-path: Private generic functions
Generic Function, directory-widget-route-root-path: Private generic functions
Generic Function, file-not-found-path: Private generic functions
Generic Function, file-widget-full-path: Private generic functions
Generic Function, file-widget-path: Private generic functions
Generic Function, filename-filter: Public generic functions
Generic Function, get-dir-listing: Public generic functions
Generic Function, get-root: Public generic functions
get-dir-listing: Public generic functions
get-dir-listing: Public generic functions
get-parent: Private ordinary functions
get-root: Public generic functions
get-root: Public generic functions

I
image-to-base64: Private ordinary functions

L
list-directory: Public ordinary functions

M
match-pathnames: Private ordinary functions
Method, directories-first-p: Public generic functions
Method, directories-first-p: Public generic functions
Method, directory-widget-directory-relative-path: Private generic functions
Method, directory-widget-filter: Private generic functions
Method, directory-widget-path: Private generic functions
Method, directory-widget-route-root-path: Private generic functions
Method, file-not-found-path: Private generic functions
Method, file-widget-full-path: Private generic functions
Method, file-widget-path: Private generic functions
Method, filename-filter: Public generic functions
Method, get-dir-listing: Public generic functions
Method, get-root: Public generic functions
Method, render: Public standalone methods
Method, render: Public standalone methods
Method, render: Public standalone methods

R
render: Public standalone methods
render: Public standalone methods
render: Public standalone methods

S
sort-pathnames-dirs-first: Private ordinary functions


A.4 Data types

Jump to:   C   D   F   P   R   S   T  
Index Entry  Section

C
Class, directory-widget: Private classes
Class, file-not-found-widget: Private classes
Class, file-server-route: Public classes
Class, file-widget: Private classes

D
directory-widget: Private classes

F
File, file-type.lisp: The reblocks-file-server/core/file-type․lisp file
File, file-type.lisp: The reblocks-file-server/utils/file-type․lisp file
File, reblocks-file-server.asd: The reblocks-file-server/reblocks-file-server․asd file
file-not-found-widget: Private classes
file-server-route: Public classes
file-type.lisp: The reblocks-file-server/core/file-type․lisp file
file-type.lisp: The reblocks-file-server/utils/file-type․lisp file
file-widget: Private classes
filter-function: Public types

P
Package, reblocks-file-server/core: The reblocks-file-server/core package
Package, reblocks-file-server/utils: The reblocks-file-server/utils package

R
reblocks-file-server: The reblocks-file-server system
reblocks-file-server.asd: The reblocks-file-server/reblocks-file-server․asd file
reblocks-file-server/core: The reblocks-file-server/core system
reblocks-file-server/core: The reblocks-file-server/core package
reblocks-file-server/utils: The reblocks-file-server/utils system
reblocks-file-server/utils: The reblocks-file-server/utils package

S
System, reblocks-file-server: The reblocks-file-server system
System, reblocks-file-server/core: The reblocks-file-server/core system
System, reblocks-file-server/utils: The reblocks-file-server/utils system

T
Type, filter-function: Public types