Liking cljdoc? Tell your friends :D

szew.io.fu

Wrappers for java.nio.file Path and Files utilities.

Wrappers for java.nio.file Path and Files utilities.
raw docstring

absolute-pathclj

(absolute-path a-path)

Convert to Path, get absolute path via Path.toAbsolutePath method.

Convert to Path, get absolute path via Path.toAbsolutePath method.
raw docstring

absolute?clj

(absolute? a-path)

Checks if resulting Path is absolute via Path.isAbsolute call.

Checks if resulting Path is absolute via Path.isAbsolute call.
raw docstring

all-subpathsclj

(all-subpaths a-path)

Returns all Path ancestors from given point, going up.

Lazy!

Returns all Path ancestors from given point, going up.

Lazy!
raw docstring

attrclj

(attr a-path attribute)
(attr a-path attribute options)

Get attribute from a Path via Files/getAttribute call.

Accepts link options.

Get attribute from a Path via Files/getAttribute call.

Accepts link options.
raw docstring

attr!clj

(attr! a-path attribute value)
(attr! a-path attribute value options)

Set attribute value on a Path via Files/setAttribute call.

Accepts link options.

Set attribute value on a Path via Files/setAttribute call.

Accepts link options.
raw docstring

attrsclj

(attrs a-path attributes)
(attrs a-path attributes options)

Produces a map of selected attributes via Files/readAttributes call.

Accepts link options.

Attributes can be:

"" for all basic attributes, "dos:" for all DOS expected attributes, "posix:*" for all POSIX attributes, "size,lastModifiedTime,lastAccessTime" to get selected basic values "posix:permissions,size" to pick more specifig values.

Produces a map of selected attributes via Files/readAttributes call.

Accepts link options.

Attributes can be:

"*" for all basic attributes,
"dos:*" for all DOS expected attributes,
"posix:*" for all POSIX attributes,
"size,lastModifiedTime,lastAccessTime" to get selected basic values
"posix:permissions,size" to pick more specifig values.
raw docstring

attrs-structclj

(attrs-struct path)
(attrs-struct path options)
(attrs-struct path attr-class options)

Read Path attributes into given class instance via Files/readAttributes call.

Accepts attribute class and link options. Defaults to BasicFileAttributes class and no options.

Read Path attributes into given class instance via Files/readAttributes call.

Accepts attribute class and link options. Defaults to BasicFileAttributes
class and no options.
raw docstring

basenameclj

(basename a-path)

Convert to path, make absolute, normalize, get file-name, stringify that.

Convert to path, make absolute, normalize, get file-name, stringify that.
raw docstring

buffered-readerclj

(buffered-reader a-path)
(buffered-reader a-path charset)

Produces BufferedReader with Files/newBufferedReader call.

Produces BufferedReader with Files/newBufferedReader call.
raw docstring

buffered-writerclj

(buffered-writer a-path options)
(buffered-writer a-path charset options)

Produces BufferedWriter with Files/newBufferedWriter call.

Produces BufferedWriter with Files/newBufferedWriter call.
raw docstring

bytes->pathclj

(bytes->path a-path some-bytes options)

Writes some-bytes to a-path via Files/write call.

Accepts open options.

Writes some-bytes to a-path via Files/write call.

Accepts open options.
raw docstring

charset-pleaseclj

(charset-please enc)

Get Charset or String, give Charset back via Charset/forName call.

Get Charset or String, give Charset back via Charset/forName call.
raw docstring

Conversionscljprotocol

Best effort Conversion protocol.

Best effort Conversion protocol.

->fileclj

(->file this)

Convert to File instance.

Convert to File instance.

->pathclj

(->path this)

Convert to Path instance.

Convert to Path instance.

->stringclj

(->string this)

Convert to String instance.

Convert to String instance.

->uriclj

(->uri this)

Convert to URI instance.

Convert to URI instance.

->urlclj

(->url this)

Convert to URL instance.

Convert to URL instance.
raw docstring

copy!clj

(copy! file-1 file-2)
(copy! file-1 file-2 options)

Copy file-1 to file-2 via Files/copy call.

Accepts copy options

See stream-in! and stream-out! for copies from and to streams.

Copy file-1 to file-2 via Files/copy call.

Accepts copy options

See `stream-in!` and `stream-out!` for copies from and to streams.
raw docstring

copy-optionclj

Map of keywords to StandardCopyOption enums.

Map of keywords to StandardCopyOption enums.
raw docstring

copy-optsclj

(copy-opts)
(copy-opts options)

Accepts opts, keywords are subbed with copy-option, other values passed on.

Accepts opts, keywords are subbed with copy-option, other values passed on.
raw docstring

copy-tree!clj

(copy-tree! from to)
(copy-tree! from to options)

Recursively copy a file tree with copy options in iteration order.

Returns a lazy sequence of [from to] path pairs. Skips entry point directory unless it's explicitly part of to path. If from is a file copies that file under to directory. If skipped then default copy options are :copy-attributes and :replace-existing. If :copy-attributes specified then tries to at least maintain last-modified-time across files and directories.

It is lazy, so either dorun or realize into a collection.

Recursively copy a file tree with copy options in iteration order.

Returns a lazy sequence of [from to] path pairs. Skips entry point directory
unless it's explicitly part of to path. If from is a file copies that file
under to directory. If skipped then default copy options are :copy-attributes
and :replace-existing. If :copy-attributes specified then tries to at least
maintain last-modified-time across files and directories.

It is lazy, so either dorun or realize into a collection.
raw docstring

create-directories!clj

(create-directories! a-path)
(create-directories! a-path attrs)

Create all directories in Path via Files/createDirectories call.

Accepts optional FileAttribute container.

Create all directories in Path via Files/createDirectories call.

Accepts optional FileAttribute container.
raw docstring

create-directory!clj

(create-directory! a-path)
(create-directory! a-path attrs)

Create directory in Path via Files/createDirectory call.

Accepts optional FileAttribute container.

Create directory in Path via Files/createDirectory call.

Accepts optional FileAttribute container.
raw docstring

create-file!clj

(create-file! a-path)
(create-file! a-path attrs)

Create file in Path via Files/createFile call.

Create file in Path via Files/createFile call.
raw docstring

create-link!clj

(create-link! link-path existing-path)

Create hard link to existing-path in link-path via Files/createLink call.

Create hard link to existing-path in link-path via Files/createLink call.
raw docstring

create-symbolic-link!clj

(create-symbolic-link! link-path existing-path)
(create-symbolic-link! link-path existing-path attrs)

Create link-path to existing-path symbolic link via Files/createSymbolicLink call.

Create link-path to existing-path symbolic link via Files/createSymbolicLink
call.
raw docstring

create-temp-directory!clj

(create-temp-directory! prefix)
(create-temp-directory! prefix attrs)

Create temporary directory at default TEMP location with given prefix via Files/createTempDirectory call.

Create temporary directory at default TEMP location with given prefix via
Files/createTempDirectory call.
raw docstring

create-temp-directory-at!clj

(create-temp-directory-at! a-path prefix)
(create-temp-directory-at! a-path prefix attrs)

Create a temporary directory at Path location with given prefix via Files/createTempDirectory call.

Create a temporary directory at Path location with given prefix via
Files/createTempDirectory call.
raw docstring

create-temp-file!clj

(create-temp-file! prefix suffix)
(create-temp-file! prefix suffix attrs)

Create temporary file at default TEMP location with given prefix and suffix via Files/createTempFile call.

Create temporary file at default TEMP location with given prefix and suffix
via Files/createTempFile call.
raw docstring

create-temp-file-at!clj

(create-temp-file-at! a-path prefix suffix)
(create-temp-file-at! a-path prefix suffix attrs)

Create temporary file at Path location with given prefix and suffix via Files/createTempFile call.

Create temporary file at Path location with given prefix and suffix via
Files/createTempFile call.
raw docstring

cwdclj

(cwd)

Current working directory of JVM instance as absolute path.

Current working directory of JVM instance as absolute path.
raw docstring

delete!clj

(delete! a-path)

Delete a file via Files/delete call.

Delete a file via Files/delete call.
raw docstring

delete-if-exists!clj

(delete-if-exists! a-path)

Delete a fil via Files/deleteIfExists call.

Delete a fil via Files/deleteIfExists call.
raw docstring

delete-on-exit!clj

(delete-on-exit! a-file)

Mark given file for deletion on JVM exit via File.deleteOnExit call.

Mark given file for deletion on JVM exit via File.deleteOnExit call.
raw docstring

delete-tree!clj

(delete-tree! a-path)
(delete-tree! a-path skip-root?)

Recursively delete all files, then directories. Returns sequence of paths.

Walks the tree depth-first, files get deleted in FIFO order and directories go in LIFO order. Lazy, so please make sure to either use dorun or realize it into a collection.

Recursively delete all files, then directories. Returns sequence of paths.

Walks the tree depth-first, files get deleted in FIFO order and directories
go in LIFO order. Lazy, so please make sure to either use dorun or realize
it into a collection.
raw docstring

dir->streamclj

(dir->stream a-path)

Returns a Stream<Path> of directory contents.

Remember to close the Stream after use.

Returns a Stream<Path> of directory contents.

Remember to close the Stream after use.
raw docstring

dir->vecclj

(dir->vec a-path)

Returns a [Path] of directory contents.

Returns a [Path] of directory contents.
raw docstring

directory?clj

(directory? a-path)
(directory? a-path options)

Checks if given file is a directory via Files/isDirectory call.

Accepts link options.

Checks if given file is a directory via Files/isDirectory call.

Accepts link options.
raw docstring

ends-with?clj

(ends-with? path-1 path-2)

Check if Path path-1 ends with path-2 via Path.endsWith call.

Check if Path path-1 ends with path-2 via Path.endsWith call.
raw docstring

executable?clj

(executable? a-path)

Checks if resulting Path is executable via Files/isExecutable call.

Checks if resulting Path is executable via Files/isExecutable call.
raw docstring

exists?clj

(exists? a-path)
(exists? a-path options)

Checks if resulting Path exists via Files/exists call.

Accepts link options.

Checks if resulting Path exists via Files/exists call.

Accepts link options.
raw docstring

file-attrsclj

(file-attrs)
(file-attrs attributes)

Accepts attributes, packs them into FileAttribute typed array.

Accepts attributes, packs them into FileAttribute typed array.
raw docstring

file-nameclj

(file-name a-path)

Convert to Path, get file name Path via Path.getFileName method.

Convert to Path, get file name Path via Path.getFileName method.
raw docstring

file-storeclj

(file-store a-path)

Get file store of Path via Files/getFileStore call.

Get file store of Path via Files/getFileStore call.
raw docstring

file-systemclj

(file-system a-path)

Convert to Path, get file system via Path.getFileSystem call.

Convert to Path, get file system via Path.getFileSystem call.
raw docstring

file?clj

(file? a-path)
(file? a-path options)

Checks if resulting Path is a regular file via Path.isRegularFile call.

Accepts link options.

Checks if resulting Path is a regular file via Path.isRegularFile call.

Accepts link options.
raw docstring

fs-rootsclj

(fs-roots)

Get available filesystem roots as paths from File/listRoots call.

Get available filesystem roots as paths from File/listRoots call.
raw docstring

hidden?clj

(hidden? a-path)

Checks if resulting Path is a hidden file via Files/isHidden call.

Checks if resulting Path is a hidden file via Files/isHidden call.
raw docstring

input-streamclj

(input-stream a-path)
(input-stream a-path options)

Produces InputStream with Files/newInputStream call.

Produces InputStream with Files/newInputStream call.
raw docstring

is-empty?clj

(is-empty? a-path)

True for childless directories, 0 byte files and non-existing Paths.

Checks for existence first, then tries to resolve with real-path.

Anything else: throws ExceptionInfo.

True for childless directories, 0 byte files and non-existing Paths.

Checks for existence first, then tries to resolve with real-path.

Anything else: throws ExceptionInfo.
raw docstring

last-modified-timeclj

(last-modified-time a-path)
(last-modified-time a-path options)

Get last modified time FileTime via Files/getLastModifiedTime call.

Accepts link options.

Get last modified time FileTime via Files/getLastModifiedTime call.

Accepts link options.
raw docstring

last-modified-time!clj

(last-modified-time! a-path lmt)

Set last modified time value from FileTime via Files/setLastModifiedtime call.

Set last modified time value from FileTime via Files/setLastModifiedtime
call.
raw docstring

lines->pathclj

(lines->path a-path some-lines options)
(lines->path a-path some-lines charset options)

Writes some-lines Iterable to a-path via Files/write call.

Accepts open options.

Writes some-lines Iterable to a-path via Files/write call.

Accepts open options.
raw docstring

Map of keywords to LinkOption enums.

Map of keywords to LinkOption enums.
raw docstring

(link-opts)
(link-opts options)

Accepts opts, keywords are subbed with link-option, other values passed on.

Accepts opts, keywords are subbed with link-option, other values passed on.
raw docstring

lookup-optionclj

(lookup-option option-object)

Reverse lookup of option object to respective keyword. Not found: nil.

Reverse lookup of option object to respective keyword. Not found: nil.
raw docstring

move!clj

(move! path-1 path-2)
(move! path-1 path-2 options)

Move path-1 to path-2 via Files/move call.

Accepts copy options.

Move path-1 to path-2 via Files/move call.

Accepts copy options.
raw docstring

mtimeclj

(mtime a-path)

Get last modified time as Instant from a path.

Get last modified time as Instant from a path.
raw docstring

mtime!clj

(mtime! a-path)
(mtime! a-path an-instant)

Change modified time of file based on given Instant or to current time.

Change modified time of file based on given Instant or to current time.
raw docstring

normalize-pathclj

(normalize-path a-path)

Convert to Path, normalize it via Path.normalize call

Convert to Path, normalize it via Path.normalize call
raw docstring

not-exists?clj

(not-exists? a-path)
(not-exists? a-path options)

Checks if resulting Path does not exist via Files/notExists call.

Accepts link options.

Checks if resulting Path does not exist via Files/notExists call.

Accepts link options.
raw docstring

open-optionclj

Map of keywords to StandardOpenOption enums.

Map of keywords to StandardOpenOption enums.
raw docstring

open-optsclj

(open-opts)
(open-opts options)

Accepts opts, keywords are subbed with open-option, other values passed on.

Accepts opts, keywords are subbed with open-option, other values passed on.
raw docstring

output-streamclj

(output-stream a-path)
(output-stream a-path options)

Produces OutputStream with Files/newOutputStream call.

Produces OutputStream with Files/newOutputStream call.
raw docstring

ownerclj

(owner a-path)
(owner a-path options)

Get UserPrincipal via Files/getOwner call.

Accepts link options.

Get UserPrincipal via Files/getOwner call.

Accepts link options.
raw docstring

owner!clj

(owner! a-path new-owner)

Set UserPrincipal owner on a Path via Files/setOwner call.

Set UserPrincipal owner on a Path via Files/setOwner call.
raw docstring

parent-pathclj

(parent-path a-path)

Convert to Path, get parent Path via Path.getParent method.

Convert to Path, get parent Path via Path.getParent method.
raw docstring

pathclj

(path path & paths)

Builds a Path from given String(s) via Path/get static method.

Runs all arguments through to-string to avoid trouble, so just keep in mind that Conversions protocol and the fact that nil returns valid, empty string, which does not produce a path segment, but when resolved to absolute path will be equal to current working directory.

This allows to work with strings, paths, files and nils with no hassle and with URLs and URIs with some attention, as their string representations are absolute paths.

Builds a Path from given String(s) via Path/get static method.

Runs all arguments through to-string to avoid trouble, so just keep in mind
that Conversions protocol and the fact that nil returns valid, empty string,
which does not produce a path segment, but when resolved to absolute path
will be equal to current working directory.

This allows to work with strings, paths, files and nils with no hassle
and with URLs and URIs with some attention, as their string representations
are absolute paths.
raw docstring

path->bytesclj

(path->bytes a-path)

Returns bytes content via Files/readAllBytes call.

Returns bytes content via Files/readAllBytes call.
raw docstring

path->linesclj

(path->lines a-path)
(path->lines a-path charset)

Returns a lazy Stream<String> from Path and encoding via Files/lines call.

Remember to close Stream after use.

Returns a lazy Stream<String> from Path and encoding via Files/lines call.

Remember to close Stream after use.
raw docstring

path->stringclj

(path->string a-path)
(path->string a-path charset)

Returns string content via Files/readString call.

Returns string content via Files/readString call.
raw docstring

path-elementsclj

(path-elements a-path)

Convert to Path, return vector of Path.iterator produced segments.

Convert to Path, return vector of Path.iterator produced segments.
raw docstring

path-name-atclj

(path-name-at a-path idx)

Convert to Path, get segment Path at index idx via Path.getName call.

Convert to Path, get segment Path at index idx via Path.getName call.
raw docstring

path-name-countclj

(path-name-count a-path)

Convert to Path, get segment count via Path.getNameCount call.

Convert to Path, get segment count via Path.getNameCount call.
raw docstring

pathable?clj

(pathable? obj)

Checks if obj has ->string defined.

Checks if obj has ->string defined.
raw docstring

perms->attrclj

(perms->attr permissions)

Produce a set of FileAttributes based on PosixFilePermission, via call to PosixFilePermissions/asFileAttribute.

Produce a set of FileAttributes based on PosixFilePermission, via call
to PosixFilePermissions/asFileAttribute.
raw docstring

perms->stringclj

(perms->string permissions)

Translate collection of PosixFilePermission objects into a String via call to PosixFilePermissions/toString.

Counterpart of string->perms function.

Translate collection of PosixFilePermission objects into a String via call
to PosixFilePermissions/toString.

Counterpart of string->perms function.
raw docstring

posix-permsclj

(posix-perms a-path)
(posix-perms a-path options)

Get POSIX file permissions via Files/getPosixFilePermissions call.

Accepts link options.

Get POSIX file permissions via Files/getPosixFilePermissions call.

Accepts link options.
raw docstring

posix-perms!clj

(posix-perms! a-path file-permissions)

Sets POSIX file permissions on Path via Files/setPosixFilePermissions call.

Sets POSIX file permissions on Path via Files/setPosixFilePermissions call.
raw docstring

probe-content-typeclj

(probe-content-type a-path)

Try to probe content type via Files/probeContentType call.

Try to probe content type via Files/probeContentType call.
raw docstring

pruning-path-seqclj

(pruning-path-seq entry)
(pruning-path-seq entry follow?)

Like file-seq, but works on Path and can prune branches based on predicate.

If follow? returns false - Path is not processed, directory not entered. Predicate will be first executed on given entry.

Why?

Ever went into a massive .svn directory? Now you can have tree-seq that prunes the entire Path of enquiry and moves on. Pretty nice!

Like file-seq, but works on Path and can prune branches based on predicate.

If `follow?` returns false - Path is not processed, directory not entered.
Predicate will be first executed on given entry.

Why?

Ever went into a massive .svn directory? Now you can have tree-seq that
prunes the entire Path of enquiry and moves on. Pretty nice!
raw docstring

readable?clj

(readable? a-path)

Checks if resulting Path is readable via Files/isReadable call.

Checks if resulting Path is readable via Files/isReadable call.
raw docstring

real-pathclj

(real-path a-path)
(real-path a-path options)

Convert to Path, get real path via Path.toRealPath method.

Accepts link options.

Convert to Path, get real path via Path.toRealPath method.

Accepts link options.
raw docstring

relativize-pathclj

(relativize-path path-1 path-2)

Create relative Path between path-1 and path-2 via Path.relativize call.

Create relative Path between path-1 and path-2 via Path.relativize call.
raw docstring

resolve-pathclj

(resolve-path path-1 path-2)

Create resolved Path between path-2 and path-1 via Path.resolve call.

Create resolved Path between path-2 and path-1 via Path.resolve call.
raw docstring

resolve-sibling-pathclj

(resolve-sibling-path path-1 path-2)

Create sibling Path between path-1 and path-2 via Path.resolveSibling call.

Create sibling Path between path-1 and path-2 via Path.resolveSibling call.
raw docstring

root-pathclj

(root-path a-path)

Convert to Path, get root Path via Path.getRoot, nil if none present.

Convert to Path, get root Path via Path.getRoot, nil if none present.
raw docstring

same-file?clj

(same-file? file-1 file-2)

Checks if file-1 and file-2 the same file via Files/isSameFile call.

Checks if file-1 and file-2 the same file via Files/isSameFile call.
raw docstring

sane-pathclj

(sane-path a-path)

Make path absolute first and normalized later. Keep your sanity.

Make path absolute first and normalized later. Keep your sanity.
raw docstring

select-optionsclj

(select-options pool opts)

Lookup keyword options in given pool, translate if found, drop otherwise. Pass non-keywords 'as is'.

Lookup keyword options in given pool, translate if found, drop otherwise.
Pass non-keywords 'as is'.
raw docstring

sizeclj

(size a-path)

Read size attribute of a Path via Files/size call.

Read size attribute of a Path via Files/size call.
raw docstring

starts-with?clj

(starts-with? path-1 path-2)

Check if Path path-1 starts with path-2 via Path.startsWith call.

Check if Path path-1 starts with path-2 via Path.startsWith call.
raw docstring

stream-in!clj

(stream-in! stream-1 path-2)
(stream-in! stream-1 path-2 options)

Copy InputStream stream-1 to path-2 via Files/copy call.

Accepts copy options

See copy! for file to file and stream-out! for to stream copy.

Copy InputStream stream-1 to path-2 via Files/copy call.

Accepts copy options

See `copy!` for file to file and `stream-out!` for to stream copy.
raw docstring

stream-out!clj

(stream-out! path-1 stream-2)

Copy path-1 to OutputStream via Files/copy call.

See stream-in! for stream to file and copy! for file to file.

Copy path-1 to OutputStream via Files/copy call.

See `stream-in!` for stream to file and `copy!` for file to file.
raw docstring

string->pathclj

(string->path a-path a-string options)
(string->path a-path a-string charset options)

Writes a-string to a-path via Files/writeString call.

Accepts open options.

Writes a-string to a-path via Files/writeString call.

Accepts open options.
raw docstring

string->permsclj

(string->perms rwx)

Translate 'rwxrwxrwx' String into PosixFilePermission enums set via call to PosixFilePermissions/fromString.

Counterpart of perms->string function.

Translate 'rwxrwxrwx' String into PosixFilePermission enums set via call
to PosixFilePermissions/fromString.

Counterpart of perms->string function.
raw docstring

subpathclj

(subpath a-path begin end)

Call Path.subpath to produce segments spanning from begin to end indices.

Call Path.subpath to produce segments spanning from begin to end indices.
raw docstring

symbolic-link?clj

(symbolic-link? a-path)

Checks if resulting Path is a symbolic link via Files/isSymbolicLink call.

Checks if resulting Path is a symbolic link via Files/isSymbolicLink call.
raw docstring

to-fileclj

(to-file object)

Tries to convert object to File.

Tries to convert object to File.
raw docstring

to-pathclj

(to-path object)

Tries to convert object to Path.

Tries to convert object to Path.
raw docstring

to-stringclj

(to-string object)

Tries to convert object to String.

Tries to convert object to String.
raw docstring

to-uriclj

(to-uri object)

Tries to convert object to URI.

Tries to convert object to URI.
raw docstring

to-urlclj

(to-url object)

Tries to convert object to URL.

Tries to convert object to URL.
raw docstring

url-decodeclj

(url-decode a-string)
(url-decode a-string enc)

Calls URLDecoder.decode on a-string with encoding, UTF-8 by default.

Calls URLDecoder.decode on a-string with encoding, UTF-8 by default.
raw docstring

url-decode-pathclj

(url-decode-path a-path)

URL-decode given path as UTF-8, element by element.

URL-decode given path as UTF-8, element by element.
raw docstring

url-encodeclj

(url-encode a-string)
(url-encode a-string enc)

Calls URLEncoder.encode on a-string with encoding, UTF-8 by default.

Calls URLEncoder.encode on a-string with encoding, UTF-8 by default.
raw docstring

url-encode-pathclj

(url-encode-path a-path)

URL-encode given path as UTF-8, element by element.

URL-encode given path as UTF-8, element by element.
raw docstring

visit-optionclj

Map of keywords to FileVisitOption enums.

Map of keywords to FileVisitOption enums.
raw docstring

visit-optsclj

(visit-opts)
(visit-opts options)

Accepts opts, keywords are subbed with file-visit-option, others passed on.

Accepts opts, keywords are subbed with file-visit-option, others passed on.
raw docstring

writable?clj

(writable? a-path)

Czech of resulting Path is writable via Files/isWritable call.

Czech of resulting Path is writable via Files/isWritable call.
raw docstring

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

× close