Filesystem { public Flowable<String> readTextFileFromClasspath(String resourcePath) { URL resourceUri = getClass().getResource(resourcePath); if (resourceUri == null) { return Flowable.error(new NoSuchFileException(resourcePath)); } else { return readTextFile(getClass().getResource(resourcePath).getFile()); } }  Flowable<String> readTextFile(String pathToFile); Flowable<String> readTextFileFromClasspath(String resourcePath); Single<String> readTextFileFully(String pathToFile); Single<String> readTextFileFullyFromClasspath(String resourcePath); Completable writeFile(final String content, String filePath); Completable writeFileSync(String content, String filePath, boolean append); Completable writeFileSync(String content, Charset encoding, String filePath, boolean append);  }
@Test void testReadTextFileFromClasspath() { TestSubscriber<String> testSubscriber = filesystem.readTextFileFromClasspath("/someFile.txt").test(); testSubscriber.assertValueCount(3); testSubscriber.assertValues("This is some content in some file.", "", "This is more content."); }