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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to