Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FakeSftpServerRule.createDirectory should accept a varargs parameter #3

Closed
helpermethod opened this issue Aug 4, 2017 · 2 comments
Closed

Comments

@helpermethod
Copy link

Hi,

it would be awesome if createDirectory would accept a varargs String parameter, something like

public void createDirectory(String... paths) throws IOException {
    this.verifyThatTestIsRunning("create directory");
    Arrays.stream(paths).forEach(path -> {
        Path pathAsObject = this.fileSystem.getPath(path, new String[0]);
        Files.createDirectories(pathAsObject, new FileAttribute[0]);
    });
}

This way, the method would still be backwards compatible but creating multiple directories would be simplified.

@stefanbirkner
Copy link
Owner

Hi Oliver,

thanks for the feature request. I'm thinking about creating a second method createDirectories(String... paths) for that feature. This is because other APIs create a folder a/b/c when you call createDirectory("a", "b", "c"); and I don't want to confuse the users. What do you think about the method name createDirectories?

@helpermethod
Copy link
Author

Sounds perfect!

stefanbirkner added a commit that referenced this issue Sep 18, 2017
Users don't have to call `createDirectory` for each directory.

Fixes #3.
stefanbirkner added a commit that referenced this issue Sep 19, 2017
Users don't have to call `createDirectory` for each directory.

Fixes #3.
stefanbirkner added a commit that referenced this issue Sep 19, 2017
Users don't have to call `createDirectory` for each directory.

Fixes #3.
stefanbirkner added a commit that referenced this issue Sep 19, 2017
Users don't have to call `createDirectory` for each directory.

Fixes #3.
stefanbirkner added a commit that referenced this issue Sep 19, 2017
Users don't have to call `createDirectory` for each directory.

Fixes #3.
stefanbirkner added a commit that referenced this issue Sep 20, 2017
Users don't have to call `createDirectory` for each directory.

Fixes #3.
stefanbirkner added a commit that referenced this issue Sep 20, 2017
Users don't have to call `createDirectory` for each directory.

Fixes #3.
stefanbirkner added a commit that referenced this issue Nov 1, 2017
Users don't have to call `createDirectory` for each directory.

Fixes #3.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants