File tree Expand file tree Collapse file tree 1 file changed +3
-4
lines changed
src/test/java/org/codehaus/plexus/util Expand file tree Collapse file tree 1 file changed +3
-4
lines changed Original file line number Diff line number Diff line change 33
33
import java .io .Writer ;
34
34
import java .net .URL ;
35
35
import java .nio .file .Files ;
36
+ import java .nio .file .Paths ;
36
37
import java .util .Properties ;
37
38
38
39
import org .junit .Before ;
@@ -885,14 +886,12 @@ public void testFileUtils()
885
886
final URL url = this .getClass ().getResource ( path );
886
887
assertNotNull ( path + " was not found." , url );
887
888
888
- String filename = url .getFile ();
889
- // The following line applies a fix for spaces in a path
890
- filename = replaceAll ( filename , "%20" , " " );
889
+ final String filename = Paths .get (url .toURI ()).toString ();
891
890
final String filename2 = "test2.txt" ;
892
891
893
892
assertTrue ( "test.txt extension == \" txt\" " , FileUtils .getExtension ( filename ).equals ( "txt" ) );
894
893
895
- assertTrue ( "Test file does not exist: " + filename , FileUtils .fileExists ( filename ) );
894
+ assertTrue ( "Test file does exist: " + filename , FileUtils .fileExists ( filename ) );
896
895
897
896
assertTrue ( "Second test file does not exist" , !FileUtils .fileExists ( filename2 ) );
898
897
You can’t perform that action at this time.
0 commit comments