List of usage examples for org.apache.hadoop.fs AbstractFileSystem getFileStatus
public abstract FileStatus getFileStatus(final Path f) throws AccessControlException, FileNotFoundException, UnresolvedLinkException, IOException;
From source file:org.apache.ignite.igfs.HadoopIgfs20FileSystemAbstractSelfTest.java
License:Apache License
/** * Assert that a given path exists in a given FileSystem. * * @param fs FileSystem to check.//from ww w. j av a2 s . c om * @param p Path to check. * @throws IOException if the path does not exist. */ private void assertPathExists(AbstractFileSystem fs, Path p) throws IOException { FileStatus fileStatus = fs.getFileStatus(p); assertEquals(p, fileStatus.getPath()); assertNotSame(0, fileStatus.getModificationTime()); }
From source file:org.apache.ignite.igfs.HadoopIgfs20FileSystemAbstractSelfTest.java
License:Apache License
/** * Check path does not exist in a given FileSystem. * * @param fs FileSystem to check.//from w ww . ja v a 2s . c o m * @param path Path to check. */ private void assertPathDoesNotExist(final AbstractFileSystem fs, final Path path) { GridTestUtils.assertThrows(log, new Callable<Object>() { @Override public Object call() throws Exception { return fs.getFileStatus(path); } }, FileNotFoundException.class, null); }