SimplePathBuilder implements PathBuilder { @Override public File getCurrentDirectoryFile() { if (this.currentFile != null) { return this.currentFile; } if (URISchemeType.FILE.isURL(this.currentURL)) { return new File(this.currentURL.getPath()); } try { return FileSystem.getUserHomeDirectory(); } catch (IOException exception) { return new File((String) null); } } SimplePathBuilder();  SimplePathBuilder(String currentDirectory);  SimplePathBuilder(File currentDirectory);  SimplePathBuilder(URL currentDirectory); @Override void setCurrentDirectory(String currentDirectory); @Override void setCurrentDirectory(File currentDirectory); @Override void setCurrentDirectory(URL currentDirectory); @Override File getCurrentDirectoryFile(); @Override URL getCurrentDirectoryURL();  }
@Test public void testGetCurrentDirectoryFile() throws Exception { assertEquals(this.userHome, this.builder.getCurrentDirectoryFile()); this.builder.setCurrentDirectory("file:./toto"); assertEquals(new File("./toto"), this.builder.getCurrentDirectoryFile()); this.builder.setCurrentDirectory("http: assertEquals(this.userHome, this.builder.getCurrentDirectoryFile()); this.builder.setCurrentDirectory("https: assertEquals(this.userHome, this.builder.getCurrentDirectoryFile()); this.builder.setCurrentDirectory("ftp: assertEquals(this.userHome, this.builder.getCurrentDirectoryFile()); this.builder.setCurrentDirectory("jar:file:test.jar!/toto"); assertEquals(this.userHome, this.builder.getCurrentDirectoryFile()); this.builder.setCurrentDirectory("./toto"); assertEquals(new File("./toto"), this.builder.getCurrentDirectoryFile()); }