Paths { public static String addUUID(String pathStr, String uuid) { Preconditions.checkArgument(StringUtils.isNotEmpty(pathStr), "empty path"); Preconditions.checkArgument(StringUtils.isNotEmpty(uuid), "empty uuid"); if (pathStr.contains(uuid)) { return pathStr; } int dot; int lastSlash = pathStr.lastIndexOf('/'); if (lastSlash >= 0) { Preconditions.checkState(lastSlash + 1 < pathStr.length(), "Bad path: " + pathStr); dot = pathStr.indexOf('.', lastSlash); } else { dot = pathStr.indexOf('.'); } if (dot >= 0) { return pathStr.substring(0, dot) + "-" + uuid + pathStr.substring(dot); } else { return pathStr + "-" + uuid; } } private  Paths(); static String addUUID(String pathStr, String uuid); static String getParent(String pathStr); static String getRelativePath(Path basePath,
      Path fullPath); static Path path(Path parent, String... child); static Path getLocalTaskAttemptTempDir(final Configuration conf,
      final String uuid,
      final TaskAttemptID attemptID); static void clearTempFolderInfo(final TaskAttemptID attemptID); @VisibleForTesting static void resetTempFolderCache(); static Path tempDirForStaging(FileSystem fs,
      Configuration conf); static Path getMultipartUploadCommitsDirectory(Configuration conf,
      String uuid); static Set<String> getPartitions(Path attemptPath,
      List<? extends FileStatus> taskOutput);  }
@Test public void testUUIDDir() throws Throwable { intercept(IllegalStateException.class, () -> addUUID("/dest/", "UUID")); }
@Test public void testUUIDEmptyDir() throws Throwable { intercept(IllegalArgumentException.class, () -> addUUID("", "UUID")); }
@Test public void testEmptyUUID() throws Throwable { intercept(IllegalArgumentException.class, () -> addUUID("part-0000.gz", "")); }