File: dir.md

package info (click to toggle)
bnd 5.0.1-3
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye
  • size: 44,092 kB
  • sloc: java: 249,039; xml: 90,727; sh: 655; perl: 153; makefile: 95; python: 47; javascript: 9
file content (21 lines) | stat: -rw-r--r-- 624 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
---
layout: default
class: Macro
title: dir ( ';' FILE )*
summary: Returns a list of the directories containing each specified file
---

    public String _dir(String[] args) {
        if (args.length < 2) {
            reporter.warning("Need at least one file name for ${dir;...}");
            return null;
        }
        String result = Arrays.stream(args, 1, args.length)
            .map(domain::getFile)
            .filter(File::exists)
            .map(File::getParentFile)
            .filter(File::exists)
            .map(IO::absolutePath)
            .collect(Strings.joining());
        return result;
    }