Skip to content

Commit a3d040c

Browse files
committed
Reformat
1 parent 17f1cb2 commit a3d040c

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

src/main/java/org/codehaus/plexus/components/secdispatcher/internal/sources/FileMasterSource.java

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,9 @@
1818
*/
1919
package org.codehaus.plexus.components.secdispatcher.internal.sources;
2020

21-
import org.codehaus.plexus.components.secdispatcher.MasterSourceMeta;
22-
import org.codehaus.plexus.components.secdispatcher.SecDispatcher;
23-
import org.codehaus.plexus.components.secdispatcher.SecDispatcherException;
24-
2521
import javax.inject.Named;
2622
import javax.inject.Singleton;
23+
2724
import java.io.IOException;
2825
import java.nio.file.Files;
2926
import java.nio.file.Path;
@@ -32,6 +29,10 @@
3229
import java.util.Map;
3330
import java.util.Optional;
3431

32+
import org.codehaus.plexus.components.secdispatcher.MasterSourceMeta;
33+
import org.codehaus.plexus.components.secdispatcher.SecDispatcher;
34+
import org.codehaus.plexus.components.secdispatcher.SecDispatcherException;
35+
3536
/**
3637
* Password source that uses a plain file with plaintext master password (residing on things like an encrypted pen-drive
3738
* or partition). Idea is to "delegate" all the security to that data carrier (for example, it may ask for permission
@@ -96,7 +97,11 @@ private String readFile(String transformed) throws SecDispatcherException {
9697
Path file = Paths.get(transformed);
9798
if (file.isAbsolute() && Files.exists(file)) {
9899
try {
99-
return Files.readAllLines(file).stream().filter(l -> l.startsWith("#")).map(String::trim).findFirst().orElse(null);
100+
return Files.readAllLines(file).stream()
101+
.filter(l -> l.startsWith("#"))
102+
.map(String::trim)
103+
.findFirst()
104+
.orElse(null);
100105
} catch (IOException e) {
101106
throw new SecDispatcherException("Failed to read file '" + transformed + "'", e);
102107
}

0 commit comments

Comments
 (0)