Path implements IOReadableWritable, Serializable { public Path suffix(String suffix) { return new Path(getParent(), getName() + suffix); } Path();  Path(URI uri);  Path(String parent, String child);  Path(Path parent, String child);  Path(String parent, Path child);  Path(Path parent, Path child);  Path(String pathString);  Path(String scheme, String authority, String path); URI toUri(); FileSystem getFileSystem(); boolean isAbsolute(); String getName(); Path getParent(); Path suffix(String suffix); @Override String toString(); @Override boolean equals(Object o); @Override int hashCode(); int compareTo(Object o); int depth(); Path makeQualified(FileSystem fs); @Override void read(DataInputView in); @Override void write(DataOutputView out); static final String SEPARATOR; static final char SEPARATOR_CHAR; static final String CUR_DIR; }
@Test public void testSuffix() { Path p = new Path("/my/path"); p = p.suffix("_123"); assertEquals("/my/path_123", p.toUri().getPath()); p = new Path("/my/path/"); p = p.suffix("/abc"); assertEquals("/my/path/abc", p.toUri().getPath()); p = new Path("C:/my/windows/path"); p = p.suffix("/abc"); assertEquals("/C:/my/windows/path/abc", p.toUri().getPath()); }