commonlib/src/main/java/com/streamsets/pipeline/lib/io/LiveFile.java
public LiveFile refresh() throws IOException {
    LiveFile refresh = this;
    boolean changed;
    try {
      BasicFileAttributes attrs = Files.readAttributes(path, BasicFileAttributes.class);
      String iNodeCurrent = attrs.fileKey().toString();
      int headLenCurrent = (int) Math.min(headLen, attrs.size());
      String headHashCurrent = computeHash(path, headLenCurrent);
      changed = !this.iNode.equals(iNodeCurrent) || !this.headHash.equals(headHashCurrent);
    } catch (NoSuchFileException ex) {
      changed = true;
    }
    if (changed) {
      try (DirectoryStream<Path> directoryStream = Files.newDirectoryStream(path.getParent())) {
        for (Path path : directoryStream) {
          BasicFileAttributes attrs = Files.readAttributes(path, BasicFileAttributes.class);
          String iNode = attrs.fileKey().toString();
          int headLen = (int) Math.min(this.headLen, attrs.size());
          String headHash = computeHash(path, headLen);
          if (iNode.equals(this.iNode) && headHash.equals(this.headHash)) {
            if (headLen == 0) {
              headLen = (int) Math.min(HEAD_LEN, attrs.size());
              headHash = computeHash(path, headLen);
            }
            refresh = new LiveFile(path, iNode, headHash, headLen);
            break;
          }
        }
      }
    }
    return refresh;
  }
public LiveFile refresh() throws IOException {
    LiveFile refresh = this;
    boolean changed;
    try {
      BasicFileAttributes attrs = Files.readAttributes(path, BasicFileAttributes.class);
      String iNodeCurrent = attrs.fileKey().toString();
      int headLenCurrent = (int) Math.min(headLen, attrs.size());
      String headHashCurrent = computeHash(path, headLenCurrent);
      changed = !this.iNode.equals(iNodeCurrent) || !this.headHash.equals(headHashCurrent);
    } catch (NoSuchFileException ex) {
      changed = true;
    }
    if (changed) {
      try (DirectoryStream<Path> directoryStream = Files.newDirectoryStream(path.getParent())) {
        for (Path path : directoryStream) {
          BasicFileAttributes attrs = Files.readAttributes(path, BasicFileAttributes.class);
          String iNode = attrs.fileKey().toString();
          int headLen = (int) Math.min(this.headLen, attrs.size());
          String headHash = computeHash(path, headLen);
          if (iNode.equals(this.iNode) && headHash.equals(this.headHash)) {
            if (headLen == 0) {
              headLen = (int) Math.min(HEAD_LEN, attrs.size());
              headHash = computeHash(path, headLen);
            }
            refresh = new LiveFile(path, iNode, headHash, headLen);
            break;
          }
        }
      }
    }
    return refresh;
  }
Refreshes the <code>LiveFile</code>, if the file was renamed, the path will have the new name.

@return the refreshed file if the file has been renamed, or itself if the file has not been rename or the file
does not exist in the directory anymore.
@throws IOException thrown if the LiveFile could not be refreshed