|
18 | 18 | import static org.junit.Assert.fail;
|
19 | 19 |
|
20 | 20 | import java.awt.image.BufferedImage;
|
21 |
| -import java.io.BufferedInputStream; |
22 | 21 | import java.io.ByteArrayInputStream;
|
23 | 22 | import java.io.File;
|
24 |
| -import java.io.FileInputStream; |
25 |
| -import java.io.FileNotFoundException; |
26 | 23 | import java.io.IOException;
|
27 | 24 | import java.io.InputStream;
|
28 | 25 | import java.io.Serializable;
|
@@ -381,46 +378,6 @@ protected void assertFalse(final String message, final boolean condition) {
|
381 | 378 | Assert.assertFalse(message, condition);
|
382 | 379 | }
|
383 | 380 |
|
384 |
| - /** |
385 |
| - * Returns an input stream for the specified file name. Refer to {@link #getFileObject(String)} |
386 |
| - * for details on how the file is located. |
387 |
| - * @param fileName the base file name |
388 |
| - * @return the input stream |
389 |
| - * @throws FileNotFoundException if the file cannot be found |
390 |
| - */ |
391 |
| - public static InputStream getFileAsStream(final String fileName) throws FileNotFoundException { |
392 |
| - return new BufferedInputStream(new FileInputStream(getFileObject(fileName))); |
393 |
| - } |
394 |
| - |
395 |
| - /** |
396 |
| - * Returns a File object for the specified file name. This is different from just |
397 |
| - * <code>new File(fileName)</code> because it will adjust the location of the file |
398 |
| - * depending on how the code is being executed. |
399 |
| - * |
400 |
| - * @param fileName the base filename |
401 |
| - * @return the new File object |
402 |
| - * @throws FileNotFoundException if the file doesn't exist |
403 |
| - */ |
404 |
| - public static File getFileObject(final String fileName) throws FileNotFoundException { |
405 |
| - final String localizedName = fileName.replace('/', File.separatorChar); |
406 |
| - |
407 |
| - File file = new File(localizedName); |
408 |
| - if (!file.exists()) { |
409 |
| - file = new File("../../" + localizedName); |
410 |
| - } |
411 |
| - |
412 |
| - if (!file.exists()) { |
413 |
| - try { |
414 |
| - System.out.println("currentDir=" + new File(".").getCanonicalPath()); |
415 |
| - } |
416 |
| - catch (final IOException e) { |
417 |
| - e.printStackTrace(); |
418 |
| - } |
419 |
| - throw new FileNotFoundException(localizedName); |
420 |
| - } |
421 |
| - return file; |
422 |
| - } |
423 |
| - |
424 | 381 | /**
|
425 | 382 | * Sets the browser version.
|
426 | 383 | * @param browserVersion the browser version
|
|
0 commit comments