Code example for File

Methods: getAbsolutePath, listFiles

0
LOG.warn("EventLogReader did not find any pre-existing logs to read from, no directories under writeDir:" + _topLevelLogDir);
    } 
    else 
    { 
      if (_readSessionDir.listFiles().length > 0)
      { 
        Encoding encoding = getEncoding(_readSessionDir.listFiles()[0]);
        for (File f: _readSessionDir.listFiles())
        { 
          LOG.info(f.getAbsolutePath());
          if (getEncoding(f) != encoding)
          { 
            LOG.error("Encoding " + encoding + " did not match encoding for File " + f.getAbsolutePath());
          } 
          else 
          { 
            _filesToRead.add(f);
          } 
        } 
      } 
      else 
      { 
      } 
 
      Collections.sort(_filesToRead,new LastModifiedSorter());
 
      _eventSeen = false;
      _firstEventContent = null;
      _lastEopOffset = -1;
      LOG.info("Configured with top-level log Directory :" + _topLevelLogDir.getAbsolutePath());
      LOG.info("Inferred read-session directory :" + _readSessionDir.getAbsolutePath());
      if (_filesToRead.size()== 0)
      { 
        LOG.warn("EventLogReader did not find any pre-existing logs to read from, no files under read session Dir:" + _readSessionDir);
      } 
    }