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/14 16:58:05 UTC

[commons-vfs] branch master updated (423c08d -> 4dfca70)

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 423c08d  VFS-570 Add HDFS write support (#114)
     new 6abfda7  [VFS-570] Add HDFS write support #114.
     new 8b246d4  Better local var name.
     new 999685b  Sort methods in AB order.
     new a216213  Remove trailing whitespace.
     new 4dfca70  Use final.

The 5 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/hdfs/HdfsFileObject.java |  94 +++++----
 .../vfs2/provider/hdfs/HdfsFileProvider.java       |   2 +-
 .../commons/vfs2/provider/hdfs/HdfsFileSystem.java |  20 +-
 .../provider/hdfs/HdfsFileSystemConfigBuilder.java | 210 ++++++++++-----------
 src/changes/changes.xml                            |   3 +
 5 files changed, 162 insertions(+), 167 deletions(-)


[commons-vfs] 02/05: Better local var name.

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 8b246d42ddfaeea1d0827a78d5872cab35ca54e6
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Mon Sep 14 12:55:59 2020 -0400

    Better local var name.
---
 .../commons/vfs2/provider/hdfs/HdfsFileSystem.java   | 20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)

diff --git a/commons-vfs2/src/main/java/org/apache/commons/vfs2/provider/hdfs/HdfsFileSystem.java b/commons-vfs2/src/main/java/org/apache/commons/vfs2/provider/hdfs/HdfsFileSystem.java
index 72b60b4..f45caf8 100644
--- a/commons-vfs2/src/main/java/org/apache/commons/vfs2/provider/hdfs/HdfsFileSystem.java
+++ b/commons-vfs2/src/main/java/org/apache/commons/vfs2/provider/hdfs/HdfsFileSystem.java
@@ -150,14 +150,14 @@ public class HdfsFileSystem extends AbstractFileSystem {
             }
         }
 
-        final boolean useCache = null != getContext().getFileSystemManager().getFilesCache();
-        FileObject file;
+        final boolean useCache = null != getFileSystemManager().getFilesCache();
+        FileObject fileObject;
         if (useCache) {
-            file = this.getFileFromCache(name);
+            fileObject = this.getFileFromCache(name);
         } else {
-            file = null;
+            fileObject = null;
         }
-        if (null == file) {
+        if (null == fileObject) {
             String path = null;
             try {
                 path = URLDecoder.decode(name.getPath(), "UTF-8");
@@ -165,19 +165,19 @@ public class HdfsFileSystem extends AbstractFileSystem {
                 path = name.getPath();
             }
             final Path filePath = new Path(path);
-            file = new HdfsFileObject((AbstractFileName) name, this, fs, filePath);
-            file = decorateFileObject(file);
+            fileObject = new HdfsFileObject((AbstractFileName) name, this, fs, filePath);
+            fileObject = decorateFileObject(fileObject);
             if (useCache) {
-                this.putFileToCache(file);
+                this.putFileToCache(fileObject);
             }
         }
         /**
          * resync the file information if requested
          */
         if (getFileSystemManager().getCacheStrategy().equals(CacheStrategy.ON_RESOLVE)) {
-            file.refresh();
+            fileObject.refresh();
         }
-        return file;
+        return fileObject;
     }
 
 }


[commons-vfs] 01/05: [VFS-570] Add HDFS write support #114.

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 6abfda72c10ea678d7a1c6fcbda4cb5185789104
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Mon Sep 14 12:55:38 2020 -0400

    [VFS-570] Add HDFS write support #114.
---
 .../commons/vfs2/provider/hdfs/HdfsFileObject.java | 24 ++++++++--------------
 src/changes/changes.xml                            |  3 +++
 2 files changed, 11 insertions(+), 16 deletions(-)

diff --git a/commons-vfs2/src/main/java/org/apache/commons/vfs2/provider/hdfs/HdfsFileObject.java b/commons-vfs2/src/main/java/org/apache/commons/vfs2/provider/hdfs/HdfsFileObject.java
index 4d41858..4cec2f4 100644
--- a/commons-vfs2/src/main/java/org/apache/commons/vfs2/provider/hdfs/HdfsFileObject.java
+++ b/commons-vfs2/src/main/java/org/apache/commons/vfs2/provider/hdfs/HdfsFileObject.java
@@ -32,7 +32,6 @@ import org.apache.commons.vfs2.RandomAccessContent;
 import org.apache.commons.vfs2.provider.AbstractFileName;
 import org.apache.commons.vfs2.provider.AbstractFileObject;
 import org.apache.commons.vfs2.util.RandomAccessMode;
-import org.apache.hadoop.fs.FSDataOutputStream;
 import org.apache.hadoop.fs.FileStatus;
 import org.apache.hadoop.fs.FileSystem;
 import org.apache.hadoop.fs.Path;
@@ -73,22 +72,13 @@ public class HdfsFileObject extends AbstractFileObject<HdfsFileSystem> {
         if (!super.canRenameTo(newfile)) {
             return false;
         }
-
-        FileStatus newfileStat = null;
         try {
-            newfileStat = this.hdfs.getFileStatus(new Path(newfile.getName().getPath()));
+            return this.hdfs.getFileStatus(new Path(newfile.getName().getPath())) == null;
         } catch (final FileNotFoundException e) {
-            // do nothing       
+            return false;
         } catch (IOException e) {
             throw new IllegalStateException(e);
         }
-        if (newfileStat == null) {
-            return true;
-        } else if (newfileStat.isDirectory() || newfileStat.isFile()) {
-            return false;
-        }
-
-        return false;
     }
 
     /**
@@ -140,20 +130,20 @@ public class HdfsFileObject extends AbstractFileObject<HdfsFileSystem> {
     }
 
     /**
-     * @see org.apache.commons.vfs2.provider.AbstractFileObject#doGetOutputStream()
+     * @see org.apache.commons.vfs2.provider.AbstractFileObject#doGetOutputStream(boolean)
+     * @since 2.7.0
      */
     @Override
     protected OutputStream doGetOutputStream(final boolean append) throws Exception {
         if (append) {
             throw new FileSystemException("vfs.provider/write-append-not-supported.error", this.path.getName());
-        } else {
-            FSDataOutputStream out = hdfs.create(this.path);
-            return out;
         }
+        return hdfs.create(this.path);
     }
 
     /**
      * @see org.apache.commons.vfs2.provider.AbstractFileObject#doDelete()
+     * @since 2.7.0
      */
     @Override
     protected void doDelete() throws Exception {
@@ -162,6 +152,7 @@ public class HdfsFileObject extends AbstractFileObject<HdfsFileSystem> {
 
     /**
      * @see org.apache.commons.vfs2.provider.AbstractFileObject#doCreateFolder()
+     * @since 2.7.0
      */
     @Override
     protected void doCreateFolder() throws Exception {
@@ -170,6 +161,7 @@ public class HdfsFileObject extends AbstractFileObject<HdfsFileSystem> {
 
     /**
      * @see org.apache.commons.vfs2.provider.AbstractFileObject#doRename(FileObject)
+     * @since 2.7.0
      */
     @Override
     protected void doRename(FileObject newfile) throws Exception {
diff --git a/src/changes/changes.xml b/src/changes/changes.xml
index 624e4fc..66de430 100644
--- a/src/changes/changes.xml
+++ b/src/changes/changes.xml
@@ -101,6 +101,9 @@ The <action> type attribute can be add,update,fix,remove.
       <action issue="VFS-777" dev="ggregory" due-to="Bing-ok, Gary Gregory" type="fix">
         NoSuchMethodError due to multiple versions of commons-codec:commons-codec:jar.
       </action>
+      <action issue="VFS-570" dev="ggregory" due-to="garpinc, Gary Gregory" type="add">
+        Add HDFS write support #114.
+      </action>
       <!-- UPDATES -->
       <action issue="VFS-755" dev="ggregory" due-to="Gary Gregory" type="update">
         Update org.apache.httpcomponents:httpclient from 4.5.10 to 4.5.11.


[commons-vfs] 03/05: Sort methods in AB order.

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 999685b605db9b19adfde33925e63809df3927dc
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Mon Sep 14 12:56:20 2020 -0400

    Sort methods in AB order.
---
 .../commons/vfs2/provider/hdfs/HdfsFileObject.java |  76 ++++----
 .../provider/hdfs/HdfsFileSystemConfigBuilder.java | 210 ++++++++++-----------
 2 files changed, 143 insertions(+), 143 deletions(-)

diff --git a/commons-vfs2/src/main/java/org/apache/commons/vfs2/provider/hdfs/HdfsFileObject.java b/commons-vfs2/src/main/java/org/apache/commons/vfs2/provider/hdfs/HdfsFileObject.java
index 4cec2f4..19b367f 100644
--- a/commons-vfs2/src/main/java/org/apache/commons/vfs2/provider/hdfs/HdfsFileObject.java
+++ b/commons-vfs2/src/main/java/org/apache/commons/vfs2/provider/hdfs/HdfsFileObject.java
@@ -95,6 +95,24 @@ public class HdfsFileObject extends AbstractFileObject<HdfsFileSystem> {
     }
 
     /**
+     * @see org.apache.commons.vfs2.provider.AbstractFileObject#doCreateFolder()
+     * @since 2.7.0
+     */
+    @Override
+    protected void doCreateFolder() throws Exception {
+        hdfs.mkdirs(this.path);
+    }
+
+    /**
+     * @see org.apache.commons.vfs2.provider.AbstractFileObject#doDelete()
+     * @since 2.7.0
+     */
+    @Override
+    protected void doDelete() throws Exception {
+        hdfs.delete(this.path, true);
+    }
+
+    /**
      * @see org.apache.commons.vfs2.provider.AbstractFileObject#doGetAttributes()
      */
     @Override
@@ -130,54 +148,27 @@ public class HdfsFileObject extends AbstractFileObject<HdfsFileSystem> {
     }
 
     /**
-     * @see org.apache.commons.vfs2.provider.AbstractFileObject#doGetOutputStream(boolean)
-     * @since 2.7.0
+     * @see org.apache.commons.vfs2.provider.AbstractFileObject#doGetLastModifiedTime()
      */
     @Override
-    protected OutputStream doGetOutputStream(final boolean append) throws Exception {
-        if (append) {
-            throw new FileSystemException("vfs.provider/write-append-not-supported.error", this.path.getName());
+    protected long doGetLastModifiedTime() throws Exception {
+        doAttach();
+        if (null != this.stat) {
+            return this.stat.getModificationTime();
         }
-        return hdfs.create(this.path);
-    }
-
-    /**
-     * @see org.apache.commons.vfs2.provider.AbstractFileObject#doDelete()
-     * @since 2.7.0
-     */
-    @Override
-    protected void doDelete() throws Exception {
-        hdfs.delete(this.path, true);
-    }
-
-    /**
-     * @see org.apache.commons.vfs2.provider.AbstractFileObject#doCreateFolder()
-     * @since 2.7.0
-     */
-    @Override
-    protected void doCreateFolder() throws Exception {
-        hdfs.mkdirs(this.path);
+        return -1;
     }
 
     /**
-     * @see org.apache.commons.vfs2.provider.AbstractFileObject#doRename(FileObject)
+     * @see org.apache.commons.vfs2.provider.AbstractFileObject#doGetOutputStream(boolean)
      * @since 2.7.0
      */
     @Override
-    protected void doRename(FileObject newfile) throws Exception {
-        hdfs.rename(this.path, new Path(newfile.getName().getPath()));
-    }
-
-    /**
-     * @see org.apache.commons.vfs2.provider.AbstractFileObject#doGetLastModifiedTime()
-     */
-    @Override
-    protected long doGetLastModifiedTime() throws Exception {
-        doAttach();
-        if (null != this.stat) {
-            return this.stat.getModificationTime();
+    protected OutputStream doGetOutputStream(final boolean append) throws Exception {
+        if (append) {
+            throw new FileSystemException("vfs.provider/write-append-not-supported.error", this.path.getName());
         }
-        return -1;
+        return hdfs.create(this.path);
     }
 
     /**
@@ -274,6 +265,15 @@ public class HdfsFileObject extends AbstractFileObject<HdfsFileSystem> {
     }
 
     /**
+     * @see org.apache.commons.vfs2.provider.AbstractFileObject#doRename(FileObject)
+     * @since 2.7.0
+     */
+    @Override
+    protected void doRename(FileObject newfile) throws Exception {
+        hdfs.rename(this.path, new Path(newfile.getName().getPath()));
+    }
+
+    /**
      * @see org.apache.commons.vfs2.provider.AbstractFileObject#doSetAttribute(java.lang.String, java.lang.Object)
      */
     @Override
diff --git a/commons-vfs2/src/main/java/org/apache/commons/vfs2/provider/hdfs/HdfsFileSystemConfigBuilder.java b/commons-vfs2/src/main/java/org/apache/commons/vfs2/provider/hdfs/HdfsFileSystemConfigBuilder.java
index 6e0114a..fb8630c 100644
--- a/commons-vfs2/src/main/java/org/apache/commons/vfs2/provider/hdfs/HdfsFileSystemConfigBuilder.java
+++ b/commons-vfs2/src/main/java/org/apache/commons/vfs2/provider/hdfs/HdfsFileSystemConfigBuilder.java
@@ -41,10 +41,6 @@ public final class HdfsFileSystemConfigBuilder extends FileSystemConfigBuilder {
     private static final String KEY_CONFIG_STREAM = "configStream";
     private static final String KEY_CONFIG_CONF = "configConf";
 
-    private HdfsFileSystemConfigBuilder() {
-        super("hdfs.");
-    }
-
     /**
      * @return HdfsFileSystemConfigBuilder instance
      */
@@ -52,6 +48,10 @@ public final class HdfsFileSystemConfigBuilder extends FileSystemConfigBuilder {
         return BUILDER;
     }
 
+    private HdfsFileSystemConfigBuilder() {
+        super("hdfs.");
+    }
+
     /**
      * @return HDFSFileSystem
      */
@@ -61,6 +61,28 @@ public final class HdfsFileSystemConfigBuilder extends FileSystemConfigBuilder {
     }
 
     /**
+     * Get alternate configuration object.
+     *
+     * @return alternate configuration object or {@code null}.
+     * @param opts The FileSystemOptions.
+     * @see #setConfigConfiguration(FileSystemOptions, Configuration)
+     */
+    public Configuration getConfigConfiguration(final FileSystemOptions opts) {
+        return (Configuration) this.getParam(opts, KEY_CONFIG_CONF);
+    }
+
+    /**
+     * Get alternate configuration input stream.
+     *
+     * @return alternate configuration input stream or {@code null}.
+     * @param opts The FileSystemOptions.
+     * @see #setConfigInputStream(FileSystemOptions, InputStream)
+     */
+    public InputStream getConfigInputStream(final FileSystemOptions opts) {
+        return (InputStream) this.getParam(opts, KEY_CONFIG_STREAM);
+    }
+
+    /**
      * Get names of alternate configuration resources.
      *
      * @return resource name list of alternate configurations or {@code null}.
@@ -73,6 +95,85 @@ public final class HdfsFileSystemConfigBuilder extends FileSystemConfigBuilder {
     }
 
     /**
+     * Get paths of alternate configuration file system files.
+     *
+     * @return list of full paths of alternate configuration files or {@code null}.
+     * @param opts The FileSystemOptions.
+     * @see #setConfigPath(FileSystemOptions, Path)
+     */
+    public Path[] getConfigPaths(final FileSystemOptions opts) {
+        final String pathNames = this.getString(opts, KEY_CONFIG_PATHS);
+        if (pathNames == null || pathNames.isEmpty()) {
+            return null;
+        }
+        final String[] paths = pathNames.split(",");
+        return Arrays.stream(paths).map(Path::new).toArray(Path[]::new);
+    }
+
+    /**
+     * Get URLs of alternate configurations.
+     *
+     * @return list of alternate configuration URLs or {@code null}.
+     * @param opts The FileSystemOptions.
+     * @see #setConfigURL(FileSystemOptions, URL)
+     */
+    public URL[] getConfigURLs(final FileSystemOptions opts) {
+        try {
+            final String urlNames = this.getString(opts, KEY_CONFIG_URLS);
+            if (urlNames == null || urlNames.isEmpty()) {
+                return null;
+            }
+            final String[] urls = urlNames.split(",");
+            final URL[] realURLs = new URL[urls.length];
+            for (int i = 0; i < urls.length; i++) {
+                realURLs[i] = new URL(urls[i]);
+            }
+            return realURLs;
+        } catch (final MalformedURLException mue) {
+            // This should never happen because we save it in the proper form
+        }
+        return null;
+    }
+
+    /**
+     * Sets the configuration object to be loaded after the defaults.
+     * <p>
+     * Specifies an already initialized configuration object to override any specific HDFS settings. The property will
+     * be passed on to {@code org.apache.hadoop.conf.Configuration#addResource(Configuration)} after the URL was set as
+     * the default name with: {@code Configuration#set(FileSystem.FS_DEFAULT_NAME_KEY, url)}.
+     * <p>
+     * One use for this is to set a different value for the {@code dfs.client.use.datanode.hostname} property in order
+     * to access HDFS files stored in an AWS installation (from outside their firewall). There are other possible uses
+     * too.
+     *
+     * @param opts The FileSystemOptions to modify.
+     * @param configuration additional configuration object or {@code null} to unset any configuration object previously
+     *            set.
+     */
+    public void setConfigConfiguration(final FileSystemOptions opts, final Configuration configuration) {
+        this.setParam(opts, KEY_CONFIG_CONF, configuration);
+    }
+
+    /**
+     * Sets the input stream of configuration file to be loaded after the defaults.
+     * <p>
+     * Specifies an input stream connected to a config file to override any specific HDFS settings. The property will be
+     * passed on to {@code org.apache.hadoop.conf.Configuration#addResource(InputStream)} after the URL was set as the
+     * default name with: {@code Configuration#set(FileSystem.FS_DEFAULT_NAME_KEY, url)}.
+     * <p>
+     * One use for this is to set a different value for the {@code dfs.client.use.datanode.hostname} property in order
+     * to access HDFS files stored in an AWS installation (from outside their firewall). There are other possible uses
+     * too.
+     *
+     * @param opts The FileSystemOptions to modify.
+     * @param inputStream input stream of additional configuration file or {@code null} to unset the configuration input
+     *            stream previously set up.
+     */
+    public void setConfigInputStream(final FileSystemOptions opts, final InputStream inputStream) {
+        this.setParam(opts, KEY_CONFIG_STREAM, inputStream);
+    }
+
+    /**
      * Sets the name of configuration resource to be loaded after the defaults.
      * <p>
      * Specifies the name of a config resource to override any specific HDFS settings. The property will be passed on to
@@ -111,22 +212,6 @@ public final class HdfsFileSystemConfigBuilder extends FileSystemConfigBuilder {
     }
 
     /**
-     * Get paths of alternate configuration file system files.
-     *
-     * @return list of full paths of alternate configuration files or {@code null}.
-     * @param opts The FileSystemOptions.
-     * @see #setConfigPath(FileSystemOptions, Path)
-     */
-    public Path[] getConfigPaths(final FileSystemOptions opts) {
-        final String pathNames = this.getString(opts, KEY_CONFIG_PATHS);
-        if (pathNames == null || pathNames.isEmpty()) {
-            return null;
-        }
-        final String[] paths = pathNames.split(",");
-        return Arrays.stream(paths).map(Path::new).toArray(Path[]::new);
-    }
-
-    /**
      * Sets the full path of configuration file to be loaded after the defaults.
      * <p>
      * Specifies the path of a local file system config file to override any specific HDFS settings. The property will
@@ -158,31 +243,6 @@ public final class HdfsFileSystemConfigBuilder extends FileSystemConfigBuilder {
     }
 
     /**
-     * Get URLs of alternate configurations.
-     *
-     * @return list of alternate configuration URLs or {@code null}.
-     * @param opts The FileSystemOptions.
-     * @see #setConfigURL(FileSystemOptions, URL)
-     */
-    public URL[] getConfigURLs(final FileSystemOptions opts) {
-        try {
-            final String urlNames = this.getString(opts, KEY_CONFIG_URLS);
-            if (urlNames == null || urlNames.isEmpty()) {
-                return null;
-            }
-            final String[] urls = urlNames.split(",");
-            final URL[] realURLs = new URL[urls.length];
-            for (int i = 0; i < urls.length; i++) {
-                realURLs[i] = new URL(urls[i]);
-            }
-            return realURLs;
-        } catch (final MalformedURLException mue) {
-            // This should never happen because we save it in the proper form
-        }
-        return null;
-    }
-
-    /**
      * Sets the URL of configuration file to be loaded after the defaults.
      * <p>
      * Specifies the URL of a config file to override any specific HDFS settings. The property will be passed on to
@@ -212,64 +272,4 @@ public final class HdfsFileSystemConfigBuilder extends FileSystemConfigBuilder {
         }
     }
 
-    /**
-     * Get alternate configuration input stream.
-     *
-     * @return alternate configuration input stream or {@code null}.
-     * @param opts The FileSystemOptions.
-     * @see #setConfigInputStream(FileSystemOptions, InputStream)
-     */
-    public InputStream getConfigInputStream(final FileSystemOptions opts) {
-        return (InputStream) this.getParam(opts, KEY_CONFIG_STREAM);
-    }
-
-    /**
-     * Sets the input stream of configuration file to be loaded after the defaults.
-     * <p>
-     * Specifies an input stream connected to a config file to override any specific HDFS settings. The property will be
-     * passed on to {@code org.apache.hadoop.conf.Configuration#addResource(InputStream)} after the URL was set as the
-     * default name with: {@code Configuration#set(FileSystem.FS_DEFAULT_NAME_KEY, url)}.
-     * <p>
-     * One use for this is to set a different value for the {@code dfs.client.use.datanode.hostname} property in order
-     * to access HDFS files stored in an AWS installation (from outside their firewall). There are other possible uses
-     * too.
-     *
-     * @param opts The FileSystemOptions to modify.
-     * @param inputStream input stream of additional configuration file or {@code null} to unset the configuration input
-     *            stream previously set up.
-     */
-    public void setConfigInputStream(final FileSystemOptions opts, final InputStream inputStream) {
-        this.setParam(opts, KEY_CONFIG_STREAM, inputStream);
-    }
-
-    /**
-     * Get alternate configuration object.
-     *
-     * @return alternate configuration object or {@code null}.
-     * @param opts The FileSystemOptions.
-     * @see #setConfigConfiguration(FileSystemOptions, Configuration)
-     */
-    public Configuration getConfigConfiguration(final FileSystemOptions opts) {
-        return (Configuration) this.getParam(opts, KEY_CONFIG_CONF);
-    }
-
-    /**
-     * Sets the configuration object to be loaded after the defaults.
-     * <p>
-     * Specifies an already initialized configuration object to override any specific HDFS settings. The property will
-     * be passed on to {@code org.apache.hadoop.conf.Configuration#addResource(Configuration)} after the URL was set as
-     * the default name with: {@code Configuration#set(FileSystem.FS_DEFAULT_NAME_KEY, url)}.
-     * <p>
-     * One use for this is to set a different value for the {@code dfs.client.use.datanode.hostname} property in order
-     * to access HDFS files stored in an AWS installation (from outside their firewall). There are other possible uses
-     * too.
-     *
-     * @param opts The FileSystemOptions to modify.
-     * @param configuration additional configuration object or {@code null} to unset any configuration object previously
-     *            set.
-     */
-    public void setConfigConfiguration(final FileSystemOptions opts, final Configuration configuration) {
-        this.setParam(opts, KEY_CONFIG_CONF, configuration);
-    }
-
 }


[commons-vfs] 05/05: Use final.

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 4dfca70b13f4e426bde0ce563de23b61b6b63a13
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Mon Sep 14 12:57:18 2020 -0400

    Use final.
---
 .../java/org/apache/commons/vfs2/provider/hdfs/HdfsFileObject.java  | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/commons-vfs2/src/main/java/org/apache/commons/vfs2/provider/hdfs/HdfsFileObject.java b/commons-vfs2/src/main/java/org/apache/commons/vfs2/provider/hdfs/HdfsFileObject.java
index 19b367f..c78709c 100644
--- a/commons-vfs2/src/main/java/org/apache/commons/vfs2/provider/hdfs/HdfsFileObject.java
+++ b/commons-vfs2/src/main/java/org/apache/commons/vfs2/provider/hdfs/HdfsFileObject.java
@@ -76,7 +76,7 @@ public class HdfsFileObject extends AbstractFileObject<HdfsFileSystem> {
             return this.hdfs.getFileStatus(new Path(newfile.getName().getPath())) == null;
         } catch (final FileNotFoundException e) {
             return false;
-        } catch (IOException e) {
+        } catch (final IOException e) {
             throw new IllegalStateException(e);
         }
     }
@@ -269,7 +269,7 @@ public class HdfsFileObject extends AbstractFileObject<HdfsFileSystem> {
      * @since 2.7.0
      */
     @Override
-    protected void doRename(FileObject newfile) throws Exception {
+    protected void doRename(final FileObject newfile) throws Exception {
         hdfs.rename(this.path, new Path(newfile.getName().getPath()));
     }
 
@@ -288,7 +288,7 @@ public class HdfsFileObject extends AbstractFileObject<HdfsFileSystem> {
     protected boolean doSetLastModifiedTime(final long modtime) throws Exception {
         try {
             hdfs.setTimes(this.path, modtime, System.currentTimeMillis());
-        } catch (IOException ioe) {
+        } catch (final IOException ioe) {
             throw new FileSystemException(ioe);
         }
         return true;


[commons-vfs] 04/05: Remove trailing whitespace.

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 a216213da265cde6f1fca3f7c3586cec55f73b8f
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Mon Sep 14 12:56:47 2020 -0400

    Remove trailing whitespace.
---
 .../java/org/apache/commons/vfs2/provider/hdfs/HdfsFileProvider.java    | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/commons-vfs2/src/main/java/org/apache/commons/vfs2/provider/hdfs/HdfsFileProvider.java b/commons-vfs2/src/main/java/org/apache/commons/vfs2/provider/hdfs/HdfsFileProvider.java
index d9376ec..248a04c 100644
--- a/commons-vfs2/src/main/java/org/apache/commons/vfs2/provider/hdfs/HdfsFileProvider.java
+++ b/commons-vfs2/src/main/java/org/apache/commons/vfs2/provider/hdfs/HdfsFileProvider.java
@@ -37,7 +37,7 @@ import org.apache.commons.vfs2.provider.http.HttpFileNameParser;
 public class HdfsFileProvider extends AbstractOriginatingFileProvider {
 
     static final Collection<Capability> CAPABILITIES = Collections
-            .unmodifiableCollection(Arrays.asList(Capability.GET_TYPE, Capability.READ_CONTENT, 
+            .unmodifiableCollection(Arrays.asList(Capability.GET_TYPE, Capability.READ_CONTENT,
                     Capability.CREATE,
                     Capability.DELETE,
                     Capability.RENAME,