/** * Create a file within the test data directory at the given relative path. * * @param relativePath the path of the file within the test data directory; may not be null * @return the reference to the existing readable and writable file */ public static File createTestingFile(String relativePath) { Path path = createTestingPath(relativePath); return IoUtil.createFile(path); }
/** * Create a file within the test data directory at the given relative path. * * @param relativePath the path of the file within the test data directory; may not be null * @return the reference to the existing readable and writable file */ public static File createTestingFile(Path relativePath) { Path path = relativePath.toAbsolutePath(); if ( !inTestDataDir(path) ) { throw new IllegalStateException("Expecting '" + relativePath + "' to be within the testing directory"); } return IoUtil.createFile(path); }