commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From e...@apache.org
Subject svn commit: r1656621 - in /commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2: ./ cache/ impl/ provider/ provider/ftps/ provider/hdfs/ provider/jar/ provider/ram/ provider/sftp/ provider/webdav/ util/
Date Tue, 03 Feb 2015 02:48:45 GMT
Author: ecki
Date: Tue Feb  3 02:48:44 2015
New Revision: 1656621

URL: http://svn.apache.org/r1656621
Log:
Remove checkstyle, findbugs and PMD errors: add javadoc, fix line length and redundant braces

Modified:
    commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/FileSystemOptions.java
    commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/VFS.java
    commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/cache/AbstractFilesCache.java
    commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/impl/DefaultFileMonitor.java
    commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/impl/DefaultFileSystemManager.java
    commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/impl/VFSClassLoader.java
    commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/AbstractRandomAccessContent.java
    commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/DefaultFileContent.java
    commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/DefaultURLConnection.java
    commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/UriParser.java
    commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/ftps/FtpsClientFactory.java
    commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/ftps/FtpsFileSystemConfigBuilder.java
    commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/hdfs/HdfsFileProvider.java
    commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/hdfs/HdfsFileSystem.java
    commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/jar/JarFileSystem.java
    commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/jar/JarURLConnectionImpl.java
    commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/ram/RamFileRandomAccessContent.java
    commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/ram/RamFileSystem.java
    commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/sftp/SftpClientFactory.java
    commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/sftp/SftpFileObject.java
    commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/webdav/WebdavFileSystem.java
    commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/util/CombinedResources.java

Modified: commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/FileSystemOptions.java
URL: http://svn.apache.org/viewvc/commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/FileSystemOptions.java?rev=1656621&r1=1656620&r2=1656621&view=diff
==============================================================================
--- commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/FileSystemOptions.java
(original)
+++ commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/FileSystemOptions.java
Tue Feb  3 02:48:44 2015
@@ -27,11 +27,17 @@ import java.util.TreeMap;
  * <p>
  * To use the options, pass them to {@link FileSystemManager#resolveFile(String,FileSystemOptions)}.
From there, the
  * options apply to all files that are resolved relative to that file.
- * </p>
  *
- * @see org.apache.commons.vfs2.provider.sftp.SftpFileSystemConfigBuilder
+ * @see org.apache.commons.vfs2.impl.DefaultFileSystemConfigBuilder
  * @see org.apache.commons.vfs2.provider.ftp.FtpFileSystemConfigBuilder
  * @see org.apache.commons.vfs2.provider.ftps.FtpsFileSystemConfigBuilder
+ * @see org.apache.commons.vfs2.provider.hdfs.HdfsFileSystemConfigBuilder
+ * @see org.apache.commons.vfs2.provider.http.HttpFileSystemConfigBuilder
+ * @see org.apache.commons.vfs2.provider.webdav.WebdavFileSystemConfigBuilder
+ * @see org.apache.commons.vfs2.provider.ram.RamFileSystemConfigBuilder
+ * @see org.apache.commons.vfs2.provider.res.ResourceFileSystemConfigBuilder
+ * @see org.apache.commons.vfs2.provider.sftp.SftpFileSystemConfigBuilder
+ *
  */
 public final class FileSystemOptions implements Cloneable
 {

Modified: commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/VFS.java
URL: http://svn.apache.org/viewvc/commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/VFS.java?rev=1656621&r1=1656620&r2=1656621&view=diff
==============================================================================
--- commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/VFS.java (original)
+++ commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/VFS.java Tue Feb 
3 02:48:44 2015
@@ -69,29 +69,15 @@ public final class VFS
             final Class<?> mgrClass = Class.forName(managerClassName);
             final FileSystemManager mgr = (FileSystemManager) mgrClass.newInstance();
 
-            /*
-            try
-            {
-                // Set the logger
-                final Method setLogMethod = mgrClass.getMethod("setLogger", new Class[]{Log.class});
-                final Log logger = LogFactory.getLog(VFS.class);
-                setLogMethod.invoke(mgr, new Object[]{logger});
-            }
-            catch (final NoSuchMethodException e)
-            {
-                // Ignore; don't set the logger
-            }
-            */
-
             try
             {
                 // Initialize
                 final Method initMethod = mgrClass.getMethod("init", (Class[]) null);
                 initMethod.invoke(mgr, (Object[]) null);
             }
-            catch (final NoSuchMethodException e)
+            catch (final NoSuchMethodException ignored)
             {
-                // Ignore; don't initialize
+                /* Ignore; don't initialize. */
             }
 
             return mgr;

Modified: commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/cache/AbstractFilesCache.java
URL: http://svn.apache.org/viewvc/commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/cache/AbstractFilesCache.java?rev=1656621&r1=1656620&r2=1656621&view=diff
==============================================================================
--- commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/cache/AbstractFilesCache.java
(original)
+++ commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/cache/AbstractFilesCache.java
Tue Feb  3 02:48:44 2015
@@ -21,6 +21,9 @@ import org.apache.commons.vfs2.FilesCach
 import org.apache.commons.vfs2.provider.AbstractVfsComponent;
 
 
+/**
+ * Abstract base class for FilesCache implementations.
+ */
 public abstract class AbstractFilesCache extends AbstractVfsComponent implements FilesCache
 {
     // @Override - commented in FilesCache interface

Modified: commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/impl/DefaultFileMonitor.java
URL: http://svn.apache.org/viewvc/commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/impl/DefaultFileMonitor.java?rev=1656621&r1=1656620&r2=1656621&view=diff
==============================================================================
--- commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/impl/DefaultFileMonitor.java
(original)
+++ commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/impl/DefaultFileMonitor.java
Tue Feb  3 02:48:44 2015
@@ -376,18 +376,15 @@ public class DefaultFileMonitor implemen
                     agent.check();
                 }
 
-                if (getChecksPerRun() > 0)
+                if (getChecksPerRun() > 0 && (iterFileNames + 1) % getChecksPerRun()
== 0)
                 {
-                    if (((iterFileNames + 1) % getChecksPerRun()) == 0)
+                    try
                     {
-                        try
-                        {
-                            Thread.sleep(getDelay());
-                        }
-                        catch (final InterruptedException e)
-                        {
-                            // Woke up.
-                        }
+                        Thread.sleep(getDelay());
+                    }
+                    catch (final InterruptedException e)
+                    {
+                        // Woke up.
                     }
                 }
 
@@ -528,19 +525,14 @@ public class DefaultFileMonitor implemen
 
             try
             {
-
-                if (this.fm.isRecursive())
+                if (this.fm.isRecursive() && child.getType().hasChildren())
                 {
-                    if (child.getType().hasChildren())
+                    final FileObject[] newChildren = child.getChildren();
+                    for (final FileObject element : newChildren)
                     {
-                        final FileObject[] newChildren = child.getChildren();
-                        for (final FileObject element : newChildren)
-                        {
-                            fireAllCreate(element);
-                        }
+                        fireAllCreate(element);
                     }
                 }
-
             }
             catch (final FileSystemException fse)
             {

Modified: commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/impl/DefaultFileSystemManager.java
URL: http://svn.apache.org/viewvc/commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/impl/DefaultFileSystemManager.java?rev=1656621&r1=1656620&r2=1656621&view=diff
==============================================================================
--- commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/impl/DefaultFileSystemManager.java
(original)
+++ commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/impl/DefaultFileSystemManager.java
Tue Feb  3 02:48:44 2015
@@ -910,13 +910,10 @@ public class DefaultFileSystemManager im
             return provider.parseUri(realBase, fullPath);
         }
 
-        if (scheme != null)
+        // An unknown scheme - hand it to the default provider - if possible
+        if (scheme != null && defaultProvider != null)
         {
-            // An unknown scheme - hand it to the default provider - if possible
-            if (defaultProvider != null)
-            {
-                return defaultProvider.parseUri(realBase, fullPath);
-            }
+            return defaultProvider.parseUri(realBase, fullPath);
         }
 
         // TODO: avoid fallback to this point

Modified: commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/impl/VFSClassLoader.java
URL: http://svn.apache.org/viewvc/commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/impl/VFSClassLoader.java?rev=1656621&r1=1656620&r2=1656621&view=diff
==============================================================================
--- commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/impl/VFSClassLoader.java
(original)
+++ commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/impl/VFSClassLoader.java
Tue Feb  3 02:48:44 2015
@@ -361,13 +361,12 @@ public class VFSClassLoader extends Secu
             {
                 return res.getURL();
             }
+            return null;
         }
-        catch (final Exception mue)
+        catch (final Exception ignored)
         {
-            /* Ignored. TODO: report? */
+            return null; // TODO: report?
         }
-
-        return null;
     }
 
     /**

Modified: commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/AbstractRandomAccessContent.java
URL: http://svn.apache.org/viewvc/commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/AbstractRandomAccessContent.java?rev=1656621&r1=1656620&r2=1656621&view=diff
==============================================================================
--- commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/AbstractRandomAccessContent.java
(original)
+++ commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/AbstractRandomAccessContent.java
Tue Feb  3 02:48:44 2015
@@ -28,11 +28,8 @@ import org.apache.commons.vfs2.util.Rand
  */
 public abstract class AbstractRandomAccessContent implements RandomAccessContent
 {
-    private final RandomAccessMode mode;
-
     protected AbstractRandomAccessContent(final RandomAccessMode mode)
     {
-        this.mode = mode;
     }
 
     /**

Modified: commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/DefaultFileContent.java
URL: http://svn.apache.org/viewvc/commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/DefaultFileContent.java?rev=1656621&r1=1656620&r2=1656621&view=diff
==============================================================================
--- commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/DefaultFileContent.java
(original)
+++ commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/DefaultFileContent.java
Tue Feb  3 02:48:44 2015
@@ -565,7 +565,7 @@ public final class DefaultFileContent im
         {
             streams.removeInstr(instr);
         }
-        if ((streams == null) || !streams.hasStreams())
+        if (streams == null || !streams.hasStreams())
         {
             // remove even when no value is set to remove key
             threadData.remove();
@@ -583,7 +583,7 @@ public final class DefaultFileContent im
         {
             streams.removeRastr(rac);
         }
-        if ((streams == null) || !streams.hasStreams())
+        if (streams == null || !streams.hasStreams())
         {
             // remove even when no value is set to remove key
             threadData.remove();
@@ -601,7 +601,7 @@ public final class DefaultFileContent im
         {
             streams.setOutstr(null);
         }
-        if ((streams == null) || !streams.hasStreams())
+        if (streams == null || !streams.hasStreams())
         {
             // remove even when no value is set to remove key
             threadData.remove();

Modified: commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/DefaultURLConnection.java
URL: http://svn.apache.org/viewvc/commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/DefaultURLConnection.java?rev=1656621&r1=1656620&r2=1656621&view=diff
==============================================================================
--- commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/DefaultURLConnection.java
(original)
+++ commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/DefaultURLConnection.java
Tue Feb  3 02:48:44 2015
@@ -68,12 +68,10 @@ public final class DefaultURLConnection
         {
             return content.getLastModifiedTime();
         }
-        catch (final FileSystemException fse)
+        catch (final FileSystemException ignored)
         {
-            // Ignore the exception
+            return -1; // TODO: report?
         }
-
-        return -1;
     }
 
     @Override
@@ -85,10 +83,8 @@ public final class DefaultURLConnection
         }
         catch (final FileSystemException fse)
         {
-            // Ignore the exception
+            return -1; // TODO: report?
         }
-
-        return -1;
     }
 
     @Override

Modified: commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/UriParser.java
URL: http://svn.apache.org/viewvc/commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/UriParser.java?rev=1656621&r1=1656620&r2=1656621&view=diff
==============================================================================
--- commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/UriParser.java
(original)
+++ commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/UriParser.java
Tue Feb  3 02:48:44 2015
@@ -183,13 +183,9 @@ public final class UriParser
         }
 
         // Remove trailing separator
-        if (!VFS.isUriStyle())
+        if (!VFS.isUriStyle() && maxlen > 1 && path.charAt(maxlen - 1)
== SEPARATOR_CHAR)
         {
-            if (maxlen > 0 && path.charAt(maxlen - 1) == SEPARATOR_CHAR
-                    && maxlen > 1)
-            {
-                path.delete(maxlen - 1, maxlen);
-            }
+            path.delete(maxlen - 1, maxlen);
         }
 
         return fileType;
@@ -397,8 +393,8 @@ public final class UriParser
             {
                 // Encode
                 final char[] digits =
-                    {Character.forDigit(((ch >> BITS_IN_HALF_BYTE) & LOW_MASK),
HEX_BASE),
-                     Character.forDigit((ch & LOW_MASK), HEX_BASE)};
+                    {Character.forDigit((ch >> BITS_IN_HALF_BYTE) & LOW_MASK, HEX_BASE),
+                     Character.forDigit(ch                        & LOW_MASK, HEX_BASE)};
                 buffer.setCharAt(index, '%');
                 buffer.insert(index + 1, digits);
                 index += 2;
@@ -509,8 +505,8 @@ public final class UriParser
             {
                 // Encode
                 final char[] digits =
-                    {Character.forDigit(((ch >> BITS_IN_HALF_BYTE) & LOW_MASK),
HEX_BASE),
-                     Character.forDigit((ch & LOW_MASK), HEX_BASE) };
+                    {Character.forDigit((ch >> BITS_IN_HALF_BYTE) & LOW_MASK, HEX_BASE),
+                     Character.forDigit(ch                        & LOW_MASK, HEX_BASE)};
                 buffer.setCharAt(index, '%');
                 buffer.insert(index + 1, digits);
                 index += 2;

Modified: commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/ftps/FtpsClientFactory.java
URL: http://svn.apache.org/viewvc/commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/ftps/FtpsClientFactory.java?rev=1656621&r1=1656620&r2=1656621&view=diff
==============================================================================
--- commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/ftps/FtpsClientFactory.java
(original)
+++ commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/ftps/FtpsClientFactory.java
Tue Feb  3 02:48:44 2015
@@ -59,6 +59,7 @@ public final class FtpsClientFactory
         return factory.createConnection(hostname, port, username, password, workingDirectory,
fileSystemOptions);
     }
 
+    /** Connection Factory for FTPS case. */
     private static final class FtpsConnectionFactory
         extends FtpClientFactory.ConnectionFactory<FTPSClient, FtpsFileSystemConfigBuilder>
     {

Modified: commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/ftps/FtpsFileSystemConfigBuilder.java
URL: http://svn.apache.org/viewvc/commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/ftps/FtpsFileSystemConfigBuilder.java?rev=1656621&r1=1656620&r2=1656621&view=diff
==============================================================================
--- commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/ftps/FtpsFileSystemConfigBuilder.java
(original)
+++ commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/ftps/FtpsFileSystemConfigBuilder.java
Tue Feb  3 02:48:44 2015
@@ -165,7 +165,7 @@ public final class FtpsFileSystemConfigB
      */
     public KeyManager getKeyManager(final FileSystemOptions opts)
     {
-        return (KeyManager)getParam(opts, KEY_MANAGER);
+        return (KeyManager) getParam(opts, KEY_MANAGER);
     }
 
     /**
@@ -198,7 +198,7 @@ public final class FtpsFileSystemConfigB
         final TrustManager trustManager;
         if (hasParam(opts, TRUST_MANAGER))
         {
-            trustManager = (TrustManager)getParam(opts, TRUST_MANAGER);
+            trustManager = (TrustManager) getParam(opts, TRUST_MANAGER);
         }
         else
         {

Modified: commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/hdfs/HdfsFileProvider.java
URL: http://svn.apache.org/viewvc/commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/hdfs/HdfsFileProvider.java?rev=1656621&r1=1656620&r2=1656621&view=diff
==============================================================================
--- commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/hdfs/HdfsFileProvider.java
(original)
+++ commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/hdfs/HdfsFileProvider.java
Tue Feb  3 02:48:44 2015
@@ -36,7 +36,7 @@ import org.apache.commons.vfs2.provider.
  */
 public class HdfsFileProvider extends AbstractOriginatingFileProvider
 {
-    protected static final Collection<Capability> CAPABILITIES = Collections.unmodifiableCollection(Arrays
+    static final Collection<Capability> CAPABILITIES = Collections.unmodifiableCollection(Arrays
             .asList(new Capability[]
             {
                     Capability.GET_TYPE,
@@ -58,7 +58,10 @@ public class HdfsFileProvider extends Ab
     }
 
     /**
-     * @see AbstractOriginatingFileProvider#doCreateFileSystem(org.apache.commons.vfs2.FileName,
FileSystemOptions)
+     * Create a new HdfsFileSystem instance.
+     * @param rootName Name of the root file.
+     * @param fileSystemOptions Configuration options for this instance.
+     * @throws FileSystemException if error occurred.
      */
     @Override
     protected FileSystem doCreateFileSystem(final FileName rootName, final FileSystemOptions
fileSystemOptions)
@@ -68,7 +71,8 @@ public class HdfsFileProvider extends Ab
     }
 
     /**
-     * @see org.apache.commons.vfs2.provider.FileProvider#getCapabilities()
+     * Get Capabilities of HdfsFileSystem.
+     * @return The capabilities (unmodifiable).
      */
     @Override
     public Collection<Capability> getCapabilities()
@@ -77,6 +81,8 @@ public class HdfsFileProvider extends Ab
     }
 
     /**
+     * Return config builder.
+     * @return A config builder for HdfsFileSystems.
      * @see org.apache.commons.vfs2.provider.AbstractFileProvider#getConfigBuilder()
      */
     @Override

Modified: commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/hdfs/HdfsFileSystem.java
URL: http://svn.apache.org/viewvc/commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/hdfs/HdfsFileSystem.java?rev=1656621&r1=1656620&r2=1656621&view=diff
==============================================================================
--- commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/hdfs/HdfsFileSystem.java
(original)
+++ commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/hdfs/HdfsFileSystem.java
Tue Feb  3 02:48:44 2015
@@ -109,7 +109,8 @@ public class HdfsFileSystem extends Abst
             if (this.fs == null)
             {
                 final String hdfsUri = name.getRootURI();
-                final String configName = HdfsFileSystemConfigBuilder.getInstance().getConfigName(getFileSystemOptions());
+                final HdfsFileSystemConfigBuilder builder = HdfsFileSystemConfigBuilder.getInstance();
+                final String configName = builder.getConfigName(getFileSystemOptions());
 
                 final Configuration conf = new Configuration(true);
                 conf.set(FileSystem.FS_DEFAULT_NAME_KEY, hdfsUri);

Modified: commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/jar/JarFileSystem.java
URL: http://svn.apache.org/viewvc/commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/jar/JarFileSystem.java?rev=1656621&r1=1656620&r2=1656621&view=diff
==============================================================================
--- commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/jar/JarFileSystem.java
(original)
+++ commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/jar/JarFileSystem.java
Tue Feb  3 02:48:44 2015
@@ -215,6 +215,7 @@ public class JarFileSystem extends ZipFi
     @Override
     protected ZipFile getZipFile() throws FileSystemException
     {
+        // make accessible
         return super.getZipFile();
     }
 

Modified: commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/jar/JarURLConnectionImpl.java
URL: http://svn.apache.org/viewvc/commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/jar/JarURLConnectionImpl.java?rev=1656621&r1=1656620&r2=1656621&view=diff
==============================================================================
--- commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/jar/JarURLConnectionImpl.java
(original)
+++ commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/jar/JarURLConnectionImpl.java
Tue Feb  3 02:48:44 2015
@@ -135,12 +135,10 @@ public class JarURLConnectionImpl
         {
             return (int) content.getSize();
         }
-        catch (final FileSystemException fse)
+        catch (final FileSystemException ignored)
         {
-            // Ignore the error.
+            return -1;
         }
-
-        return -1;
     }
 
 }

Modified: commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/ram/RamFileRandomAccessContent.java
URL: http://svn.apache.org/viewvc/commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/ram/RamFileRandomAccessContent.java?rev=1656621&r1=1656620&r2=1656621&view=diff
==============================================================================
--- commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/ram/RamFileRandomAccessContent.java
(original)
+++ commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/ram/RamFileRandomAccessContent.java
Tue Feb  3 02:48:44 2015
@@ -62,11 +62,6 @@ public class RamFileRandomAccessContent
     private final byte[] buffer1 = new byte[1];
 
     /**
-     * Mode
-     */
-    private final RandomAccessMode mode;
-
-    /**
      * File
      */
     private final RamFileObject file;
@@ -82,7 +77,6 @@ public class RamFileRandomAccessContent
         super();
         this.buf = file.getData().getContent();
         this.file = file;
-        this.mode = mode;
 
         rafis = new InputStream()
         {
@@ -306,7 +300,7 @@ public class RamFileRandomAccessContent
     @Override
     public boolean readBoolean() throws IOException
     {
-        return (this.readUnsignedByte() != 0);
+        return this.readUnsignedByte() != 0;
     }
 
     /*

Modified: commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/ram/RamFileSystem.java
URL: http://svn.apache.org/viewvc/commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/ram/RamFileSystem.java?rev=1656621&r1=1656620&r2=1656621&view=diff
==============================================================================
--- commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/ram/RamFileSystem.java
(original)
+++ commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/ram/RamFileSystem.java
Tue Feb  3 02:48:44 2015
@@ -269,7 +269,6 @@ public class RamFileSystem extends Abstr
                     {
                         os.write(i);
                     }
-                    os.flush();
                     os.close();
                 }
                 finally
@@ -278,10 +277,11 @@ public class RamFileSystem extends Abstr
                     {
                         is.close();
                     }
-                    catch (final IOException e)
+                    catch (final IOException ignored)
                     {
-                        // ignore on close exception
+                        /* ignore on close exception. */
                     }
+                    // TODO: close os
                 }
             }
             catch (final IOException e)

Modified: commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/sftp/SftpClientFactory.java
URL: http://svn.apache.org/viewvc/commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/sftp/SftpClientFactory.java?rev=1656621&r1=1656620&r2=1656621&view=diff
==============================================================================
--- commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/sftp/SftpClientFactory.java
(original)
+++ commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/sftp/SftpClientFactory.java
Tue Feb  3 02:48:44 2015
@@ -317,6 +317,7 @@ public final class SftpClientFactory
         return new File("");
     }
 
+    /** Interface JSchLogger with JCL. */
     private static class JSchLogger implements Logger
     {
         @Override

Modified: commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/sftp/SftpFileObject.java
URL: http://svn.apache.org/viewvc/commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/sftp/SftpFileObject.java?rev=1656621&r1=1656620&r2=1656621&view=diff
==============================================================================
--- commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/sftp/SftpFileObject.java
(original)
+++ commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/sftp/SftpFileObject.java
Tue Feb  3 02:48:44 2015
@@ -482,13 +482,10 @@ public class SftpFileObject extends Abst
             final LsEntry stat = iterator.next();
 
             String name = stat.getFilename();
-            if (VFS.isUriStyle())
+            if (VFS.isUriStyle() && stat.getAttrs().isDir()
+                    && name.charAt(name.length() - 1) != '/')
             {
-                if (stat.getAttrs().isDir()
-                        && name.charAt(name.length() - 1) != '/')
-                {
-                    name = name + "/";
-                }
+                name = name + "/";
             }
 
             if (name.equals(".") || name.equals("..") || name.equals("./")

Modified: commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/webdav/WebdavFileSystem.java
URL: http://svn.apache.org/viewvc/commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/webdav/WebdavFileSystem.java?rev=1656621&r1=1656620&r2=1656621&view=diff
==============================================================================
--- commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/webdav/WebdavFileSystem.java
(original)
+++ commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/webdav/WebdavFileSystem.java
Tue Feb  3 02:48:44 2015
@@ -44,6 +44,7 @@ public class WebdavFileSystem extends Ht
     @Override
     protected HttpClient getClient()
     {
+        // make accessible
         return super.getClient();
     }
 

Modified: commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/util/CombinedResources.java
URL: http://svn.apache.org/viewvc/commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/util/CombinedResources.java?rev=1656621&r1=1656620&r2=1656621&view=diff
==============================================================================
--- commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/util/CombinedResources.java
(original)
+++ commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/util/CombinedResources.java
Tue Feb  3 02:48:44 2015
@@ -96,15 +96,15 @@ public class CombinedResources extends R
                 {
                     properties.load(resource.openConnection().getInputStream());
                 }
-                catch (final IOException e)
+                catch (final IOException ignored)
                 {
-                    // ignore
+                    /* Ignored. */
                 }
             }
         }
-        catch (final IOException e)
+        catch (final IOException ignored)
         {
-            // ignore
+            /* Ignored. */
         }
     }
 



Mime
View raw message