You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "beise (via GitHub)" <gi...@apache.org> on 2023/09/18 11:23:32 UTC

[GitHub] [commons-vfs] beise opened a new pull request, #425: Feature/vfs 848 webdav config option

beise opened a new pull request, #425:
URL: https://github.com/apache/commons-vfs/pull/425

   (no comment)


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@commons.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [commons-vfs] garydgregory commented on pull request #425: Feature/vfs 848 webdav config option

Posted by "garydgregory (via GitHub)" <gi...@apache.org>.
garydgregory commented on PR #425:
URL: https://github.com/apache/commons-vfs/pull/425#issuecomment-1731213954

   Hi @beise 
   19 files changed? Something might have gone wrong when you updated this PR.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@commons.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [commons-vfs] beise commented on a diff in pull request #425: Feature/vfs 848 webdav config option

Posted by "beise (via GitHub)" <gi...@apache.org>.
beise commented on code in PR #425:
URL: https://github.com/apache/commons-vfs/pull/425#discussion_r1333239724


##########
commons-vfs2-jackrabbit2/src/main/java/org/apache/commons/vfs2/provider/webdav4/Webdav4FileName.java:
##########
@@ -0,0 +1,109 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.commons.vfs2.provider.webdav4;
+
+import org.apache.commons.vfs2.FileName;
+import org.apache.commons.vfs2.FileSystemException;
+import org.apache.commons.vfs2.FileType;
+import org.apache.commons.vfs2.provider.GenericURLFileName;
+import org.apache.commons.vfs2.util.URIUtils;
+
+/**
+ * Webdav4 file name that represents a URL.
+ *

Review Comment:
   @garydgregory 
   what exactly should I add here? I am new here, sorry for asking.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@commons.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [commons-vfs] beise commented on a diff in pull request #425: Feature/vfs 848 webdav config option

Posted by "beise (via GitHub)" <gi...@apache.org>.
beise commented on code in PR #425:
URL: https://github.com/apache/commons-vfs/pull/425#discussion_r1333224819


##########
commons-vfs2-jackrabbit2/src/test/java/org/apache/commons/vfs2/provider/webdav4/Webdav4FileNameTest.java:
##########
@@ -0,0 +1,219 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.commons.vfs2.provider.webdav4;
+
+import org.apache.commons.vfs2.FileSystemException;
+import org.apache.commons.vfs2.FileSystemManager;
+import org.apache.commons.vfs2.FileSystemOptions;
+import org.apache.commons.vfs2.VFS;
+import org.apache.commons.vfs2.impl.DefaultFileSystemManager;
+import org.apache.commons.vfs2.provider.GenericURLFileName;
+import org.junit.jupiter.api.Test;
+
+import static org.junit.jupiter.api.Assertions.assertEquals;
+
+/**
+ * Tests {@link Webdav4FileName}.
+ *
+ */
+public class Webdav4FileNameTest {
+    /**
+     * If the resolved path ends with a '/'
+     *
+     */
+    @Test
+    public void testWebdavUrlWithTrailingSlash() throws FileSystemException {
+        @SuppressWarnings("resource")
+        FileSystemOptions fsoptsWithTrailingSlash = new FileSystemOptions();
+        Webdav4FileSystemConfigBuilder.getInstance().setAppendTrailingSlash(fsoptsWithTrailingSlash, true);
+
+        final FileSystemManager fileSystemManager = VFS.getManager();
+
+        final String urlBase = "webdav4://localhost:80";
+        final String urlWithFile1 = "webdav4://localhost:80/File.txt";
+        final String urlWithFile2 = "webdav4://localhost:80/Path/File.txt";
+        final String urlWithFileWithoutExtension1 = "webdav4://localhost:80/File";
+        final String urlWithFileWithoutExtension2 = "webdav4://localhost:80/Path/File";
+        final String urlWithSubpath = "webdav4://localhost:80/Path/Sub Path/";
+        final String urlWithRelativePart1 = "webdav4://localhost:80/Path/.";
+        final String urlWithRelativePart2 = "webdav4://localhost:80/Path/./";
+        final String urlWithRelativePart3 = "webdav4://localhost:80/Path/../Decendant Path/";
+        final String urlWithRelativePart4 = "webdav4://localhost:80/Path/Sub Path/..";
+        final String urlWithRelativePart5 = "webdav4://localhost:80/Path/Sub Path/../";

Review Comment:
   @garydgregory 
   This should not be a Problem (I will extend the testcase). The part who decides to append a slash in `Webdav4FileName.getPathQueryEncoded(...)` base the decision on the getType() method ([VFS-846](https://issues.apache.org/jira/browse/VFS-846) ) and reconstructs the whole path again: [Webdav4FileName](https://github.com/beise/commons-vfs/blob/feature/VFS-848-Webdav-Config-Option/commons-vfs2-jackrabbit2/src/main/java/org/apache/commons/vfs2/provider/webdav4/Webdav4FileName.java#L87)
   
   There's a thing with your Examples: Every URL who not ends with a '/' or '.' or '..' are recognized as FileType.File
   
   If it should work like I sugggested, every Path must end with / otherwise [VFS-846](https://issues.apache.org/jira/browse/VFS-846) would fail too:
   For example:
   -  "webdav4://localhost:80/Path/Sub Path/?"
   -  "webdav4://localhost:80/Path/Sub Path/?foo=bar"
   -  "webdav4://localhost:80/Path/Sub Path/?foo=1&bar=2"
   -  "webdav4://localhost:80/Path/Sub Path/?foo=1&bar=2"
   -  "webdav4://localhost:80/Path/File?foo=1&bar=2"
   
   One question about URL's with an empty queryString like `webdav4://localhost:80/Path/Sub Path/?`:
   If the queryString is empty, should we remove the question mark at the end of the url?
   `if (getQueryString() == null || getQueryString().isEmpty()) { ... }`
   
   I took the code from [GenericURLFileName.java](https://github.com/apache/commons-vfs/blob/master/commons-vfs2/src/main/java/org/apache/commons/vfs2/provider/GenericURLFileName.java#L107-112)
   



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@commons.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [commons-vfs] garydgregory commented on pull request #425: Feature/vfs 848 webdav config option

Posted by "garydgregory (via GitHub)" <gi...@apache.org>.
garydgregory commented on PR #425:
URL: https://github.com/apache/commons-vfs/pull/425#issuecomment-1726062568

   @beise Please add a link to the Jira issue in the description (when there is one).


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@commons.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [commons-vfs] garydgregory commented on pull request #425: Feature/vfs 848 webdav config option

Posted by "garydgregory (via GitHub)" <gi...@apache.org>.
garydgregory commented on PR #425:
URL: https://github.com/apache/commons-vfs/pull/425#issuecomment-1723230588

   Is there a test to access a file that does not have an extension? How can this work if we add a path separator to add URLs? TY.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@commons.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [commons-vfs] beise commented on a diff in pull request #425: Feature/vfs 848 webdav config option

Posted by "beise (via GitHub)" <gi...@apache.org>.
beise commented on code in PR #425:
URL: https://github.com/apache/commons-vfs/pull/425#discussion_r1333238377


##########
commons-vfs2-jackrabbit2/src/test/java/org/apache/commons/vfs2/provider/webdav4/Webdav4FileNameTest.java:
##########
@@ -0,0 +1,219 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.commons.vfs2.provider.webdav4;
+
+import org.apache.commons.vfs2.FileSystemException;
+import org.apache.commons.vfs2.FileSystemManager;
+import org.apache.commons.vfs2.FileSystemOptions;
+import org.apache.commons.vfs2.VFS;
+import org.apache.commons.vfs2.impl.DefaultFileSystemManager;
+import org.apache.commons.vfs2.provider.GenericURLFileName;
+import org.junit.jupiter.api.Test;
+
+import static org.junit.jupiter.api.Assertions.assertEquals;
+
+/**
+ * Tests {@link Webdav4FileName}.
+ *
+ */
+public class Webdav4FileNameTest {
+    /**
+     * If the resolved path ends with a '/'
+     *

Review Comment:
   @garydgregory 
   what exactly should I add here? I am new here, sorry for asking.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@commons.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [commons-vfs] garydgregory commented on a diff in pull request #425: Feature/vfs 848 webdav config option

Posted by "garydgregory (via GitHub)" <gi...@apache.org>.
garydgregory commented on code in PR #425:
URL: https://github.com/apache/commons-vfs/pull/425#discussion_r1333062464


##########
commons-vfs2-jackrabbit2/src/test/java/org/apache/commons/vfs2/provider/webdav4/Webdav4FileNameTest.java:
##########
@@ -0,0 +1,219 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.commons.vfs2.provider.webdav4;
+
+import org.apache.commons.vfs2.FileSystemException;
+import org.apache.commons.vfs2.FileSystemManager;
+import org.apache.commons.vfs2.FileSystemOptions;
+import org.apache.commons.vfs2.VFS;
+import org.apache.commons.vfs2.impl.DefaultFileSystemManager;
+import org.apache.commons.vfs2.provider.GenericURLFileName;
+import org.junit.jupiter.api.Test;
+
+import static org.junit.jupiter.api.Assertions.assertEquals;
+
+/**
+ * Tests {@link Webdav4FileName}.
+ *

Review Comment:
   Remove extra * line.



##########
commons-vfs2-jackrabbit2/src/test/java/org/apache/commons/vfs2/provider/webdav4/Webdav4FileNameTest.java:
##########
@@ -0,0 +1,219 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.commons.vfs2.provider.webdav4;
+
+import org.apache.commons.vfs2.FileSystemException;
+import org.apache.commons.vfs2.FileSystemManager;
+import org.apache.commons.vfs2.FileSystemOptions;
+import org.apache.commons.vfs2.VFS;
+import org.apache.commons.vfs2.impl.DefaultFileSystemManager;

Review Comment:
   Remove unused import.



##########
commons-vfs2-jackrabbit2/src/test/java/org/apache/commons/vfs2/provider/webdav4/Webdav4FileNameTest.java:
##########
@@ -0,0 +1,219 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.commons.vfs2.provider.webdav4;
+
+import org.apache.commons.vfs2.FileSystemException;
+import org.apache.commons.vfs2.FileSystemManager;
+import org.apache.commons.vfs2.FileSystemOptions;
+import org.apache.commons.vfs2.VFS;
+import org.apache.commons.vfs2.impl.DefaultFileSystemManager;
+import org.apache.commons.vfs2.provider.GenericURLFileName;
+import org.junit.jupiter.api.Test;
+
+import static org.junit.jupiter.api.Assertions.assertEquals;
+
+/**
+ * Tests {@link Webdav4FileName}.
+ *
+ */
+public class Webdav4FileNameTest {
+    /**
+     * If the resolved path ends with a '/'
+     *
+     */
+    @Test
+    public void testWebdavUrlWithTrailingSlash() throws FileSystemException {
+        @SuppressWarnings("resource")
+        FileSystemOptions fsoptsWithTrailingSlash = new FileSystemOptions();
+        Webdav4FileSystemConfigBuilder.getInstance().setAppendTrailingSlash(fsoptsWithTrailingSlash, true);
+
+        final FileSystemManager fileSystemManager = VFS.getManager();
+
+        final String urlBase = "webdav4://localhost:80";
+        final String urlWithFile1 = "webdav4://localhost:80/File.txt";
+        final String urlWithFile2 = "webdav4://localhost:80/Path/File.txt";
+        final String urlWithFileWithoutExtension1 = "webdav4://localhost:80/File";
+        final String urlWithFileWithoutExtension2 = "webdav4://localhost:80/Path/File";
+        final String urlWithSubpath = "webdav4://localhost:80/Path/Sub Path/";
+        final String urlWithRelativePart1 = "webdav4://localhost:80/Path/.";
+        final String urlWithRelativePart2 = "webdav4://localhost:80/Path/./";
+        final String urlWithRelativePart3 = "webdav4://localhost:80/Path/../Decendant Path/";
+        final String urlWithRelativePart4 = "webdav4://localhost:80/Path/Sub Path/..";
+        final String urlWithRelativePart5 = "webdav4://localhost:80/Path/Sub Path/../";

Review Comment:
   Hm, what about queries like:
   
   - "webdav4://localhost:80/Path/Sub Path?"
   - "webdav4://localhost:80/Path/Sub Path?foo=bar"
   - "webdav4://localhost:80/Path/Sub Path?foo=1&bar=2"
   - "webdav4://localhost:80/Path/Sub Path?foo=1&bar=2"
   - "webdav4://localhost:80/Path/File?foo=1&bar=2"
   
   ?
   



##########
commons-vfs2-jackrabbit2/src/main/java/org/apache/commons/vfs2/provider/webdav4/Webdav4FileSystemConfigBuilder.java:
##########
@@ -84,6 +105,17 @@ public boolean isVersioning(final FileSystemOptions opts) {
         return getBoolean(opts, "versioning", false);
     }
 
+    /**
+     * Sets whether a trailing slash ( / ) should be appended to the path.
+     *
+     * @param opts The FileSystem options.
+     * @param appendTrailingSlash {@code true} to append slash, {@code false} not to.
+     * @see #setFollowRedirect
+     */

Review Comment:
   Add `@since` tag to any new public or protected element in `main`.



##########
commons-vfs2-jackrabbit2/src/main/java/org/apache/commons/vfs2/provider/webdav4/Webdav4FileSystemConfigBuilder.java:
##########
@@ -52,6 +62,17 @@ protected Class<? extends FileSystem> getConfigClass() {
         return Webdav4FileSystem.class;
     }
 
+    /**
+     * Gets whether a trailing slash ( / ) should be appended to the path.
+     *
+     * @param opts The FileSystem options.
+     * @return {@code true} to follow redirects, {@code false} not to.
+     * @see #setFollowRedirect
+     */

Review Comment:
   Add `@since` tag to any new public or protected element in `main`.



##########
commons-vfs2-jackrabbit2/src/main/java/org/apache/commons/vfs2/provider/webdav4/Webdav4FileSystemConfigBuilder.java:
##########
@@ -27,8 +27,18 @@
  */
 public final class Webdav4FileSystemConfigBuilder extends Http4FileSystemConfigBuilder {
 
+    /**
+     * Defines whether a trailing slash ( / ) should be appended to the path.
+     * <p>
+     * This parameter expects a value of type {@link Boolean}.
+     * </p>
+     */

Review Comment:
   Add `@since` tag to any new public or protected element in `main`.



##########
commons-vfs2-jackrabbit2/src/main/java/org/apache/commons/vfs2/provider/webdav4/Webdav4FileName.java:
##########
@@ -0,0 +1,109 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.commons.vfs2.provider.webdav4;
+
+import org.apache.commons.vfs2.FileName;
+import org.apache.commons.vfs2.FileSystemException;
+import org.apache.commons.vfs2.FileType;
+import org.apache.commons.vfs2.provider.GenericURLFileName;
+import org.apache.commons.vfs2.util.URIUtils;
+
+/**
+ * Webdav4 file name that represents a URL.
+ *

Review Comment:
   Add `@since` tag to any new public or protected element in `main`.



##########
commons-vfs2-jackrabbit2/src/test/java/org/apache/commons/vfs2/provider/webdav4/Webdav4FileNameTest.java:
##########
@@ -0,0 +1,219 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.commons.vfs2.provider.webdav4;
+
+import org.apache.commons.vfs2.FileSystemException;
+import org.apache.commons.vfs2.FileSystemManager;
+import org.apache.commons.vfs2.FileSystemOptions;
+import org.apache.commons.vfs2.VFS;
+import org.apache.commons.vfs2.impl.DefaultFileSystemManager;
+import org.apache.commons.vfs2.provider.GenericURLFileName;
+import org.junit.jupiter.api.Test;
+
+import static org.junit.jupiter.api.Assertions.assertEquals;
+
+/**
+ * Tests {@link Webdav4FileName}.
+ *
+ */
+public class Webdav4FileNameTest {
+    /**
+     * If the resolved path ends with a '/'
+     *

Review Comment:
   Remove extra * line.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@commons.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [commons-vfs] beise commented on a diff in pull request #425: Feature/vfs 848 webdav config option

Posted by "beise (via GitHub)" <gi...@apache.org>.
beise commented on code in PR #425:
URL: https://github.com/apache/commons-vfs/pull/425#discussion_r1333238377


##########
commons-vfs2-jackrabbit2/src/test/java/org/apache/commons/vfs2/provider/webdav4/Webdav4FileNameTest.java:
##########
@@ -0,0 +1,219 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.commons.vfs2.provider.webdav4;
+
+import org.apache.commons.vfs2.FileSystemException;
+import org.apache.commons.vfs2.FileSystemManager;
+import org.apache.commons.vfs2.FileSystemOptions;
+import org.apache.commons.vfs2.VFS;
+import org.apache.commons.vfs2.impl.DefaultFileSystemManager;
+import org.apache.commons.vfs2.provider.GenericURLFileName;
+import org.junit.jupiter.api.Test;
+
+import static org.junit.jupiter.api.Assertions.assertEquals;
+
+/**
+ * Tests {@link Webdav4FileName}.
+ *
+ */
+public class Webdav4FileNameTest {
+    /**
+     * If the resolved path ends with a '/'
+     *

Review Comment:
   @garydgregory 
   what exactly should I add here? I am new here, sorry for asking.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@commons.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [commons-vfs] garydgregory commented on a diff in pull request #425: Feature/vfs 848 webdav config option

Posted by "garydgregory (via GitHub)" <gi...@apache.org>.
garydgregory commented on code in PR #425:
URL: https://github.com/apache/commons-vfs/pull/425#discussion_r1333275195


##########
commons-vfs2-jackrabbit2/src/test/java/org/apache/commons/vfs2/provider/webdav4/Webdav4FileNameTest.java:
##########
@@ -0,0 +1,219 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.commons.vfs2.provider.webdav4;
+
+import org.apache.commons.vfs2.FileSystemException;
+import org.apache.commons.vfs2.FileSystemManager;
+import org.apache.commons.vfs2.FileSystemOptions;
+import org.apache.commons.vfs2.VFS;
+import org.apache.commons.vfs2.impl.DefaultFileSystemManager;
+import org.apache.commons.vfs2.provider.GenericURLFileName;
+import org.junit.jupiter.api.Test;
+
+import static org.junit.jupiter.api.Assertions.assertEquals;
+
+/**
+ * Tests {@link Webdav4FileName}.
+ *
+ */
+public class Webdav4FileNameTest {
+    /**
+     * If the resolved path ends with a '/'
+     *
+     */
+    @Test
+    public void testWebdavUrlWithTrailingSlash() throws FileSystemException {
+        @SuppressWarnings("resource")
+        FileSystemOptions fsoptsWithTrailingSlash = new FileSystemOptions();
+        Webdav4FileSystemConfigBuilder.getInstance().setAppendTrailingSlash(fsoptsWithTrailingSlash, true);
+
+        final FileSystemManager fileSystemManager = VFS.getManager();
+
+        final String urlBase = "webdav4://localhost:80";
+        final String urlWithFile1 = "webdav4://localhost:80/File.txt";
+        final String urlWithFile2 = "webdav4://localhost:80/Path/File.txt";
+        final String urlWithFileWithoutExtension1 = "webdav4://localhost:80/File";
+        final String urlWithFileWithoutExtension2 = "webdav4://localhost:80/Path/File";
+        final String urlWithSubpath = "webdav4://localhost:80/Path/Sub Path/";
+        final String urlWithRelativePart1 = "webdav4://localhost:80/Path/.";
+        final String urlWithRelativePart2 = "webdav4://localhost:80/Path/./";
+        final String urlWithRelativePart3 = "webdav4://localhost:80/Path/../Decendant Path/";
+        final String urlWithRelativePart4 = "webdav4://localhost:80/Path/Sub Path/..";
+        final String urlWithRelativePart5 = "webdav4://localhost:80/Path/Sub Path/../";

Review Comment:
   > There's a thing with your Examples: Every URL who not ends with a '/' or '.' or '..' are recognized as FileType.File
   
   Whatever issue we maybe have here, I think we should cover all forms of queries and define what is to be expected. 
   
   > If the queryString is empty, should we remove the question mark at the end of the url?
   
   You tell me ;-)



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@commons.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [commons-vfs] beise commented on pull request #425: Feature/vfs 848 webdav config option

Posted by "beise (via GitHub)" <gi...@apache.org>.
beise commented on PR #425:
URL: https://github.com/apache/commons-vfs/pull/425#issuecomment-1732271350

   Hi @garydgregory 
   sorry for the chaos.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@commons.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [commons-vfs] garydgregory merged pull request #425: Feature/vfs 848 webdav config option

Posted by "garydgregory (via GitHub)" <gi...@apache.org>.
garydgregory merged PR #425:
URL: https://github.com/apache/commons-vfs/pull/425


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@commons.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org