This is not necessary. We have the following API in TachyonFile.java.

public boolean isFolder()