This is an automated email from the ASF dual-hosted git repository. ggregory pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/commons-vfs.git
commit 6b7fe47fb1f7c0da4f46c77375110932e60d03bb Author: Gary Gregory <[email protected]> AuthorDate: Fri Jan 31 11:21:12 2025 -0500 Simplify test --- .../apache/commons/vfs2/provider/local/GenericFileNameParser.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/commons-vfs2/src/main/java/org/apache/commons/vfs2/provider/local/GenericFileNameParser.java b/commons-vfs2/src/main/java/org/apache/commons/vfs2/provider/local/GenericFileNameParser.java index a21f28d24..c9b49364e 100644 --- a/commons-vfs2/src/main/java/org/apache/commons/vfs2/provider/local/GenericFileNameParser.java +++ b/commons-vfs2/src/main/java/org/apache/commons/vfs2/provider/local/GenericFileNameParser.java @@ -60,11 +60,12 @@ public class GenericFileNameParser extends LocalFileNameParser { @Override protected String extractRootPrefix(final String uri, final StringBuilder name) throws FileSystemException { // TODO - this class isn't generic at all. Need to fix this - // Looking for <sep> - if (StringUtils.isEmpty(name) || name.charAt(0) != '/') { + // Looking for "/" + final String prefix = "/"; + if (!StringUtils.startsWith(name, prefix)) { throw new FileSystemException("vfs.provider.local/not-absolute-file-name.error", uri); } // do not strip the separator, BUT also return it ... - return "/"; + return prefix; } }
