commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ggreg...@apache.org
Subject svn commit: r1541171 - /commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/hdfs/HdfsRandomAccessContent.java
Date Tue, 12 Nov 2013 17:18:23 GMT
Author: ggregory
Date: Tue Nov 12 17:18:23 2013
New Revision: 1541171

URL: http://svn.apache.org/r1541171
Log:
Refactor to avoid duplicate code (as reported by CPD).

Modified:
    commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/hdfs/HdfsRandomAccessContent.java

Modified: commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/hdfs/HdfsRandomAccessContent.java
URL: http://svn.apache.org/viewvc/commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/hdfs/HdfsRandomAccessContent.java?rev=1541171&r1=1541170&r2=1541171&view=diff
==============================================================================
--- commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/hdfs/HdfsRandomAccessContent.java
(original)
+++ commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/hdfs/HdfsRandomAccessContent.java
Tue Nov 12 17:18:23 2013
@@ -19,7 +19,8 @@ package org.apache.commons.vfs2.provider
 import java.io.IOException;
 import java.io.InputStream;
 
-import org.apache.commons.vfs2.RandomAccessContent;
+import org.apache.commons.vfs2.provider.AbstractRandomAccessContent;
+import org.apache.commons.vfs2.util.RandomAccessMode;
 import org.apache.hadoop.fs.FSDataInputStream;
 import org.apache.hadoop.fs.FileSystem;
 import org.apache.hadoop.fs.Path;
@@ -30,7 +31,7 @@ import org.apache.hadoop.fs.Path;
  * 
  * @since 2.1
  */
-public class HdfsRandomAccessContent implements RandomAccessContent
+public class HdfsRandomAccessContent extends AbstractRandomAccessContent
 {
     private final FSDataInputStream fis;
     private final FileSystem fs;
@@ -47,6 +48,7 @@ public class HdfsRandomAccessContent imp
      */
     public HdfsRandomAccessContent(final Path path, final FileSystem fs) throws IOException
     {
+        super(RandomAccessMode.READ);
         this.fs = fs;
         this.path = path;
         this.fis = this.fs.open(this.path);
@@ -242,130 +244,4 @@ public class HdfsRandomAccessContent imp
         throw new UnsupportedOperationException();
     }
 
-    /**
-     * @see java.io.DataOutput#write(byte[])
-     */
-    @Override
-    public void write(final byte[] b) throws IOException
-    {
-        throw new UnsupportedOperationException();
-    }
-
-    /**
-     * @see java.io.DataOutput#write(byte[], int, int)
-     */
-    @Override
-    public void write(final byte[] b, final int off, final int len) throws IOException
-    {
-        throw new UnsupportedOperationException();
-    }
-
-    /**
-     * @see java.io.DataOutput#write(int)
-     */
-    @Override
-    public void write(final int b) throws IOException
-    {
-        throw new UnsupportedOperationException();
-    }
-
-    /**
-     * @see java.io.DataOutput#writeBoolean(boolean)
-     */
-    @Override
-    public void writeBoolean(final boolean v) throws IOException
-    {
-        throw new UnsupportedOperationException();
-    }
-
-    /**
-     * @see java.io.DataOutput#writeByte(int)
-     */
-    @Override
-    public void writeByte(final int v) throws IOException
-    {
-        throw new UnsupportedOperationException();
-    }
-
-    /**
-     * @see java.io.DataOutput#writeBytes(java.lang.String)
-     */
-    @Override
-    public void writeBytes(final String s) throws IOException
-    {
-        throw new UnsupportedOperationException();
-    }
-
-    /**
-     * @see java.io.DataOutput#writeChar(int)
-     */
-    @Override
-    public void writeChar(final int v) throws IOException
-    {
-        throw new UnsupportedOperationException();
-    }
-
-    /**
-     * @see java.io.DataOutput#writeChars(java.lang.String)
-     */
-    @Override
-    public void writeChars(final String s) throws IOException
-    {
-        throw new UnsupportedOperationException();
-    }
-
-    /**
-     * @see java.io.DataOutput#writeDouble(double)
-     */
-    @Override
-    public void writeDouble(final double v) throws IOException
-    {
-        throw new UnsupportedOperationException();
-    }
-
-    /**
-     * @see java.io.DataOutput#writeFloat(float)
-     */
-    @Override
-    public void writeFloat(final float v) throws IOException
-    {
-        throw new UnsupportedOperationException();
-    }
-
-    /**
-     * @see java.io.DataOutput#writeInt(int)
-     */
-    @Override
-    public void writeInt(final int v) throws IOException
-    {
-        throw new UnsupportedOperationException();
-    }
-
-    /**
-     * @see java.io.DataOutput#writeLong(long)
-     */
-    @Override
-    public void writeLong(final long v) throws IOException
-    {
-        throw new UnsupportedOperationException();
-    }
-
-    /**
-     * @see java.io.DataOutput#writeShort(int)
-     */
-    @Override
-    public void writeShort(final int v) throws IOException
-    {
-        throw new UnsupportedOperationException();
-    }
-
-    /**
-     * @see java.io.DataOutput#writeUTF(java.lang.String)
-     */
-    @Override
-    public void writeUTF(final String s) throws IOException
-    {
-        throw new UnsupportedOperationException();
-    }
-
 }



Mime
View raw message