Skip to content

Commit 6e190b2

Browse files
committed
Provide support on the PathFS side for path creation interception on the provider level.
1 parent e5bc1e6 commit 6e190b2

2 files changed

Lines changed: 8 additions & 2 deletions

File tree

src/main/java/cpw/mods/niofs/pathfs/PathFileSystem.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -163,9 +163,10 @@ public Path getPath(final String first, final String... more)
163163
var args = new String[more.length + 1];
164164
args[0] = first;
165165
System.arraycopy(more, 0, args, 1, more.length);
166-
return new PathPath(this, false, args);
166+
167+
return provider().createSubPath(this, args);
167168
}
168-
return new PathPath(this, false, first);
169+
return provider().createSubPath(this, first);
169170
}
170171

171172
@Override

src/main/java/cpw/mods/niofs/pathfs/PathFileSystemProvider.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -210,4 +210,9 @@ protected URI buildUriFor(final PathPath path) throws URISyntaxException, Illega
210210
null
211211
);
212212
}
213+
214+
protected Path createSubPath(final PathFileSystem pathFileSystem, final String... args)
215+
{
216+
return new PathPath(pathFileSystem, false, args);
217+
}
213218
}

0 commit comments

Comments
 (0)