You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by gg...@apache.org on 2020/09/25 17:35:11 UTC

[commons-vfs] branch master updated (c9036e7 -> 61cf469)

This is an automated email from the ASF dual-hosted git repository.

ggregory pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/commons-vfs.git.


    from c9036e7  Bump actions/checkout from v2.3.2 to v2.3.3 (#130)
     new f9e1a03  No need to nest else clause.
     new bcce8ed  Remove unnecessary exception handling in test.
     new 050b1fb  Sort members.
     new 61cf469  Merge branch 'master' of https://gitbox.apache.org/repos/asf/commons-vfs

The 4 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../commons/vfs2/provider/GenericURLFileName.java  |  5 +--
 .../org/apache/commons/vfs2/test/UrlTests.java     | 43 ++++++++++------------
 2 files changed, 20 insertions(+), 28 deletions(-)


[commons-vfs] 01/04: No need to nest else clause.

Posted by gg...@apache.org.
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 f9e1a03d2b39f90b33a364b9a612a45ff3ad58e4
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Wed Sep 23 10:17:51 2020 -0400

    No need to nest else clause.
---
 .../java/org/apache/commons/vfs2/provider/GenericURLFileName.java    | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/commons-vfs2/src/main/java/org/apache/commons/vfs2/provider/GenericURLFileName.java b/commons-vfs2/src/main/java/org/apache/commons/vfs2/provider/GenericURLFileName.java
index a5526e7..58ababe 100644
--- a/commons-vfs2/src/main/java/org/apache/commons/vfs2/provider/GenericURLFileName.java
+++ b/commons-vfs2/src/main/java/org/apache/commons/vfs2/provider/GenericURLFileName.java
@@ -16,8 +16,6 @@
  */
 package org.apache.commons.vfs2.provider;
 
-import java.net.URISyntaxException;
-
 import org.apache.commons.vfs2.FileName;
 import org.apache.commons.vfs2.FileSystemException;
 import org.apache.commons.vfs2.FileType;
@@ -73,9 +71,8 @@ public class GenericURLFileName extends GenericFileName {
         if (getQueryString() == null) {
             if (charset != null) {
                 return URIUtils.encodePath(getPathDecoded(), charset);
-            } else {
-                return URIUtils.encodePath(getPathDecoded());
             }
+            return URIUtils.encodePath(getPathDecoded());
         }
 
         final StringBuilder sb = new StringBuilder(BUFFER_SIZE);


[commons-vfs] 02/04: Remove unnecessary exception handling in test.

Posted by gg...@apache.org.
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 bcce8edd6384b1566027aeb3057b2cfa0d97ca87
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Wed Sep 23 10:51:27 2020 -0400

    Remove unnecessary exception handling in test.
---
 .../src/test/java/org/apache/commons/vfs2/test/UrlTests.java       | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)

diff --git a/commons-vfs2/src/test/java/org/apache/commons/vfs2/test/UrlTests.java b/commons-vfs2/src/test/java/org/apache/commons/vfs2/test/UrlTests.java
index 9409281..1602def 100644
--- a/commons-vfs2/src/test/java/org/apache/commons/vfs2/test/UrlTests.java
+++ b/commons-vfs2/src/test/java/org/apache/commons/vfs2/test/UrlTests.java
@@ -47,12 +47,7 @@ public class UrlTests extends AbstractProviderTestCase {
 
         assertEquals(file.getName().getURI(), url.toExternalForm());
 
-        final URL parentURL;
-        try {
-            parentURL = new URL(url, "..");
-        } catch (final MalformedURLException e) {
-            throw e;
-        }
+        final URL parentURL = new URL(url, "..");
         assertEquals(file.getParent().getURL(), parentURL);
 
         final URL rootURL = new URL(url, "/");


[commons-vfs] 03/04: Sort members.

Posted by gg...@apache.org.
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 050b1fb25d9d9a8d4514b04f718ba98d3d4d12e5
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Wed Sep 23 11:58:48 2020 -0400

    Sort members.
---
 .../org/apache/commons/vfs2/test/UrlTests.java     | 36 +++++++++++-----------
 1 file changed, 18 insertions(+), 18 deletions(-)

diff --git a/commons-vfs2/src/test/java/org/apache/commons/vfs2/test/UrlTests.java b/commons-vfs2/src/test/java/org/apache/commons/vfs2/test/UrlTests.java
index 1602def..0169ae6 100644
--- a/commons-vfs2/src/test/java/org/apache/commons/vfs2/test/UrlTests.java
+++ b/commons-vfs2/src/test/java/org/apache/commons/vfs2/test/UrlTests.java
@@ -39,6 +39,24 @@ public class UrlTests extends AbstractProviderTestCase {
     }
 
     /**
+     * Tests that unknown files have no content.
+     */
+    public void testUnknownURL() throws Exception {
+        // Try getting the content of an unknown file
+        final FileObject unknownFile = getReadFolder().resolveFile("unknown-file");
+        assertFalse(unknownFile.exists());
+
+        final URLConnection connection = unknownFile.getURL().openConnection();
+        try {
+            connection.getInputStream();
+            fail();
+        } catch (final IOException e) {
+            assertSameMessage("vfs.provider/read-not-file.error", unknownFile, e);
+        }
+        assertEquals(-1, connection.getContentLength());
+    }
+
+    /**
      * Tests url.
      */
     public void testURL() throws Exception {
@@ -92,22 +110,4 @@ public class UrlTests extends AbstractProviderTestCase {
                 f2.getFileSystem());
     }
 
-    /**
-     * Tests that unknown files have no content.
-     */
-    public void testUnknownURL() throws Exception {
-        // Try getting the content of an unknown file
-        final FileObject unknownFile = getReadFolder().resolveFile("unknown-file");
-        assertFalse(unknownFile.exists());
-
-        final URLConnection connection = unknownFile.getURL().openConnection();
-        try {
-            connection.getInputStream();
-            fail();
-        } catch (final IOException e) {
-            assertSameMessage("vfs.provider/read-not-file.error", unknownFile, e);
-        }
-        assertEquals(-1, connection.getContentLength());
-    }
-
 }


[commons-vfs] 04/04: Merge branch 'master' of https://gitbox.apache.org/repos/asf/commons-vfs

Posted by gg...@apache.org.
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 61cf46988bf34ed26f0eea27b8f6bea79de3f17d
Merge: 050b1fb c9036e7
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Fri Sep 25 13:30:43 2020 -0400

    Merge branch 'master' of https://gitbox.apache.org/repos/asf/commons-vfs

 .github/workflows/maven.yml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)