code: public static Path getSanitizedPath(FileSystem fs, Path directory) throws IOException {
          if(directory.getName().endsWith("#LATEST")) {
              // getparent strips out #LATEST
              return getLatestVersionedPath(fs, directory.getParent(), null);
          }
  
          return directory;
      }
docs: Does the same thing as getLatestVersionedPath, but checks to see if the
  directory contains #LATEST. If it doesn't, it just returns what was
  passed in.
  
  @param fs
  @param directory
  @return
  @throws IOException