|
@@ -1624,6 +1624,11 @@ public abstract class FileSystem extends Configured implements Closeable {
|
|
|
}
|
|
|
|
|
|
/** Check if a path exists.
|
|
|
+ *
|
|
|
+ * It is highly discouraged to call this method back to back with other
|
|
|
+ * {@link #getFileStatus(Path)} calls, as this will involve multiple redundant
|
|
|
+ * RPC calls in HDFS.
|
|
|
+ *
|
|
|
* @param f source path
|
|
|
* @return true if the path exists
|
|
|
* @throws IOException IO failure
|
|
@@ -1639,9 +1644,12 @@ public abstract class FileSystem extends Configured implements Closeable {
|
|
|
/** True iff the named path is a directory.
|
|
|
* Note: Avoid using this method. Instead reuse the FileStatus
|
|
|
* returned by getFileStatus() or listStatus() methods.
|
|
|
+ *
|
|
|
* @param f path to check
|
|
|
* @throws IOException IO failure
|
|
|
+ * @deprecated Use {@link #getFileStatus(Path)} instead
|
|
|
*/
|
|
|
+ @Deprecated
|
|
|
public boolean isDirectory(Path f) throws IOException {
|
|
|
try {
|
|
|
return getFileStatus(f).isDirectory();
|
|
@@ -1653,9 +1661,12 @@ public abstract class FileSystem extends Configured implements Closeable {
|
|
|
/** True iff the named path is a regular file.
|
|
|
* Note: Avoid using this method. Instead reuse the FileStatus
|
|
|
* returned by {@link #getFileStatus(Path)} or listStatus() methods.
|
|
|
+ *
|
|
|
* @param f path to check
|
|
|
* @throws IOException IO failure
|
|
|
+ * @deprecated Use {@link #getFileStatus(Path)} instead
|
|
|
*/
|
|
|
+ @Deprecated
|
|
|
public boolean isFile(Path f) throws IOException {
|
|
|
try {
|
|
|
return getFileStatus(f).isFile();
|