There are frameworks that make check the type and do things accordingly. Cascading, for example, behaves differently if it is a FileInputFormat.