Utility functions for dealing with file system objects, and in/out streams.
Utility functions for dealing with file system objects, and in/out streams.
(direct-url-to-file? url)Does this URL point to a file directly? i.e., does it use the file: protocol.
Does this URL point to a file directly? i.e., does it use the file: protocol.
(file-in-project? path-or-file)Return true if the given file (String or File) or Path belongs to the project directory (where the process was started).
Return true if the given file (String or File) or Path belongs to the project directory (where the process was started).
(last-modified-time this)Return the last modified time of a File or resource URL.
Return the last modified time of a File or resource URL.
(relativize-project-path path-or-file)Given a file or a path which lives in current process' directory, return its relative path in the project as a String.
Given a file or a path which lives in current process' directory, return its relative path in the project as a String.
(resource-artifact resource)Return the File from which the given resource URL would be loaded.
For file: URLs returns the location of the resource itself, for
jar:..!/... URLs returns the location of the archive containing the
resource. Returns a fully qualified File, even when the URL is relative.
Throws when the URL is not a file: or jar: URL.
Return the File from which the given resource URL would be loaded. For `file:` URLs returns the location of the resource itself, for `jar:..!/...` URLs returns the location of the archive containing the resource. Returns a fully qualified File, even when the URL is relative. Throws when the URL is not a `file:` or `jar:` URL.
(resource-jarfile jar-resource)Given a jar:file:...!/... URL, return the location of the jar file on the filesystem. Returns nil on any other URL.
Given a jar:file:...!/... URL, return the location of the jar file on the filesystem. Returns nil on any other URL.
(url-protocol url)Get the URL protocol as a string, e.g. http, file, jar.
Get the URL protocol as a string, e.g. http, file, jar.
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |