@Test public void shouldThrowOnNullArgument() throws FileNotFoundException { assertThrows(NoPathParameterException.class, () -> FileUtil.toFile(null), "toFile(null)"); }
public static File toFile(String path) throws NoPathParameterException, FileNotFoundException { if (path == null) { throw new NoPathParameterException("Missing path parameter"); } File file = new File(env.getSourceRootFile(), path); if (!file.isFile()) { throw new FileNotFoundException("File " + file.toString() + "not found"); } return file; }
FileUtil { public static File toFile(String path) throws NoPathParameterException, FileNotFoundException { if (path == null) { throw new NoPathParameterException("Missing path parameter"); } File file = new File(env.getSourceRootFile(), path); if (!file.isFile()) { throw new FileNotFoundException("File " + file.toString() + "not found"); } return file; } }
FileUtil { public static File toFile(String path) throws NoPathParameterException, FileNotFoundException { if (path == null) { throw new NoPathParameterException("Missing path parameter"); } File file = new File(env.getSourceRootFile(), path); if (!file.isFile()) { throw new FileNotFoundException("File " + file.toString() + "not found"); } return file; } private  FileUtil(); }
FileUtil { public static File toFile(String path) throws NoPathParameterException, FileNotFoundException { if (path == null) { throw new NoPathParameterException("Missing path parameter"); } File file = new File(env.getSourceRootFile(), path); if (!file.isFile()) { throw new FileNotFoundException("File " + file.toString() + "not found"); } return file; } private  FileUtil(); static File toFile(String path); }
FileUtil { public static File toFile(String path) throws NoPathParameterException, FileNotFoundException { if (path == null) { throw new NoPathParameterException("Missing path parameter"); } File file = new File(env.getSourceRootFile(), path); if (!file.isFile()) { throw new FileNotFoundException("File " + file.toString() + "not found"); } return file; } private  FileUtil(); static File toFile(String path);  }