Liking cljdoc? Tell your friends :D

metabase.plugins.files

Low-level file-related functions for implementing Metabase plugin functionality. These use the java.nio.file library rather than the usual java.io stuff because it abstracts better across different filesystems (such as files in a normal directory vs files inside a JAR.)

As much as possible, this namespace aims to abstract away the nio.file library and expose a set of high-level file-manipulation functions for the sorts of operations the plugin system needs to perform.

Low-level file-related functions for implementing Metabase plugin functionality. These use the `java.nio.file`
library rather than the usual `java.io` stuff because it abstracts better across different filesystems (such as
files in a normal directory vs files inside a JAR.)

As much as possible, this namespace aims to abstract away the `nio.file` library and expose a set of high-level
*file-manipulation* functions for the sorts of operations the plugin system needs to perform.
raw docstring

copy-files!clj

(copy-files! source-dir dest-dir)

Copy all files in source-dir to dest-dir. Overwrites existing files if last modified date is older than that of the source file.

Copy all files in `source-dir` to `dest-dir`. Overwrites existing files if last modified date is older than that of
the source file.
sourceraw docstring

create-dir-if-not-exists!clj

(create-dir-if-not-exists! path)

Self-explanatory. Create a directory with path if it does not already exist.

Self-explanatory. Create a directory with `path` if it does not already exist.
sourceraw docstring

do-with-open-path-to-resourceclj

(do-with-open-path-to-resource resource f)

Impl for with-open-path-to-resource.

Impl for `with-open-path-to-resource`.
sourceraw docstring

file-exists-in-archive?clj

(file-exists-in-archive? archive-path & path-components)

True is a file exists in an archive.

True is a file exists in an archive.
sourceraw docstring

files-seqclj

(files-seq path)

Get a sequence of all files in path, presumably a directory or an archive of some sort (like a JAR).

Get a sequence of all files in `path`, presumably a directory or an archive of some sort (like a JAR).
sourceraw docstring

get-pathclj

(get-path & path-components)

Get a Path for a file or directory in the default (i.e., system) filesystem named by string path component(s).

(get-path "/Users/cam/metabase/metabase/plugins") ;; -> #object[sun.nio.fs.UnixPath 0x4d378139 "/Users/cam/metabase/metabase/plugins"]

Get a `Path` for a file or directory in the default (i.e., system) filesystem named by string path component(s).

(get-path "/Users/cam/metabase/metabase/plugins")
;; -> #object[sun.nio.fs.UnixPath 0x4d378139 "/Users/cam/metabase/metabase/plugins"]
sourceraw docstring

readable?clj

(readable? path)

True if we can read the file at path.

True if we can read the file at `path`.
sourceraw docstring

regular-file?clj

(regular-file? path)

True if path refers to a regular file (as opposed to something like directory).

True if `path` refers to a regular file (as opposed to something like directory).
sourceraw docstring

slurp-file-from-archiveclj

(slurp-file-from-archive archive-path & path-components)

Read the entire contents of a file from a archive (such as a JAR).

Read the entire contents of a file from a archive (such as a JAR).
sourceraw docstring

with-open-path-to-resourcecljmacro

(with-open-path-to-resource [path-binding resource-filename-str] & body)

Execute body with an Path to a resource file (i.e. a file in the project resources/ directory), cleaning up when finished.

Throws a FileNotFoundException if the resource does not exist; be sure to check with io/resource or similar before calling this.

Execute `body` with an Path to a resource file (i.e. a file in the project `resources/` directory), cleaning up when
finished.

Throws a FileNotFoundException if the resource does not exist; be sure to check with `io/resource` or similar before
calling this.
sourceraw docstring

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close