Skip to content

Commit 34528e2

Browse files
author
Vladimir Kotal
committed
use Paths.get()
1 parent 57011d5 commit 34528e2

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

opengrok-indexer/src/test/java/org/opengrok/indexer/authorization/AuthorizationPluginClassLoaderTest.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,10 @@
2323
package org.opengrok.indexer.authorization;
2424

2525
import java.io.File;
26+
import java.net.URISyntaxException;
2627
import java.net.URL;
28+
import java.nio.file.Paths;
29+
2730
import org.junit.Assert;
2831
import org.junit.Test;
2932
import org.opengrok.indexer.configuration.Group;
@@ -34,9 +37,10 @@ public class AuthorizationPluginClassLoaderTest {
3437

3538
private final File pluginDirectory;
3639

37-
public AuthorizationPluginClassLoaderTest() {
40+
public AuthorizationPluginClassLoaderTest() throws URISyntaxException {
3841
URL resource = AuthorizationPluginClassLoaderTest.class.getResource("/authorization/plugins/testplugins.jar");
39-
pluginDirectory = new File(resource.getFile()).getParentFile();
42+
pluginDirectory = Paths.get(resource.toURI()).toFile().getParentFile();
43+
Assert.assertTrue(pluginDirectory.isDirectory());
4044
}
4145

4246
@Test

0 commit comments

Comments
 (0)