private boolean openNextFile() {
    try {
      if (compressionInput!=null) {
        compressionInput.close();
      } else if (currentFile!=null) {
        currentFile.close();
      }
      currentFile=null;
      compressionInput=null;

      currentFilePath++;
      if (currentFilePath >= filePathList.length) { return false; }

      currentFile=this.fs.open(filePathList[currentFilePath]);

      // is the file gzipped?
      if ((compressionCodec!=null) && (filePathList[currentFilePath].getName().endsWith("gz"))) {
        compressionInput=new DataInputStream(compressionCodec.createInputStream(currentFile));
        LOG.info("Compression enabled");
      }

    } catch (IOException ex) {
      LOG.info("IOError opening " + filePathList[currentFilePath].toString() + " - message: " + ex.getMessage());
      return false;
    }
    return true;
  }