commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ggreg...@apache.org
Subject svn commit: r1808388 [2/2] - in /commons/proper/vfs/trunk: commons-vfs2-examples/src/main/java/org/apache/commons/vfs2/example/ commons-vfs2-examples/src/main/java/org/apache/commons/vfs2/libcheck/ commons-vfs2-sandbox/src/main/java/org/apache/commons/...
Date Thu, 14 Sep 2017 19:43:40 GMT
Modified: commons/proper/vfs/trunk/commons-vfs2-sandbox/src/main/java/org/apache/commons/vfs2/provider/smb/SmbFileRandomAccessContent.java
URL: http://svn.apache.org/viewvc/commons/proper/vfs/trunk/commons-vfs2-sandbox/src/main/java/org/apache/commons/vfs2/provider/smb/SmbFileRandomAccessContent.java?rev=1808388&r1=1808387&r2=1808388&view=diff
==============================================================================
--- commons/proper/vfs/trunk/commons-vfs2-sandbox/src/main/java/org/apache/commons/vfs2/provider/smb/SmbFileRandomAccessContent.java
(original)
+++ commons/proper/vfs/trunk/commons-vfs2-sandbox/src/main/java/org/apache/commons/vfs2/provider/smb/SmbFileRandomAccessContent.java
Thu Sep 14 19:43:40 2017
@@ -32,26 +32,20 @@ import org.apache.commons.vfs2.util.Rand
 /**
  * RandomAccess for smb files
  */
-class SmbFileRandomAccessContent extends AbstractRandomAccessContent
-{
+class SmbFileRandomAccessContent extends AbstractRandomAccessContent {
     private final SmbRandomAccessFile raf;
     private final InputStream rafis;
 
-    SmbFileRandomAccessContent(final SmbFile smbFile, final RandomAccessMode mode) throws
FileSystemException
-    {
+    SmbFileRandomAccessContent(final SmbFile smbFile, final RandomAccessMode mode) throws
FileSystemException {
         super(mode);
 
-        try
-        {
+        try {
             raf = new SmbRandomAccessFile(smbFile, mode.getModeString());
-            rafis = new InputStream()
-            {
+            rafis = new InputStream() {
                 @Override
-                public int available() throws IOException
-                {
+                public int available() throws IOException {
                     final long available = raf.length() - raf.getFilePointer();
-                    if (available > Integer.MAX_VALUE)
-                    {
+                    if (available > Integer.MAX_VALUE) {
                         return Integer.MAX_VALUE;
                     }
 
@@ -59,232 +53,187 @@ class SmbFileRandomAccessContent extends
                 }
 
                 @Override
-                public void close() throws IOException
-                {
+                public void close() throws IOException {
                     raf.close();
                 }
 
                 @Override
-                public int read() throws IOException
-                {
+                public int read() throws IOException {
                     return raf.readByte();
                 }
 
                 @Override
-                public int read(final byte[] b) throws IOException
-                {
+                public int read(final byte[] b) throws IOException {
                     return raf.read(b);
                 }
 
                 @Override
-                public int read(final byte[] b, final int off, final int len) throws IOException
-                {
+                public int read(final byte[] b, final int off, final int len) throws IOException
{
                     return raf.read(b, off, len);
                 }
 
                 @Override
-                public long skip(final long n) throws IOException
-                {
+                public long skip(final long n) throws IOException {
                     raf.seek(raf.getFilePointer() + n);
                     return n;
                 }
             };
-        }
-        catch (final MalformedURLException e)
-        {
+        } catch (final MalformedURLException e) {
             throw new FileSystemException("vfs.provider/random-access-open-failed.error",
smbFile, e);
-        }
-        catch (final SmbException e)
-        {
+        } catch (final SmbException e) {
             throw new FileSystemException("vfs.provider/random-access-open-failed.error",
smbFile, e);
-        }
-        catch (final UnknownHostException e)
-        {
+        } catch (final UnknownHostException e) {
             throw new FileSystemException("vfs.provider/random-access-open-failed.error",
smbFile, e);
         }
     }
 
-    public void close() throws IOException
-    {
+    public void close() throws IOException {
         raf.close();
     }
 
-    public long getFilePointer() throws IOException
-    {
+    public long getFilePointer() throws IOException {
         return raf.getFilePointer();
     }
 
-    public InputStream getInputStream() throws IOException
-    {
+    public InputStream getInputStream() throws IOException {
         return rafis;
     }
 
-    public long length() throws IOException
-    {
+    public long length() throws IOException {
         return raf.length();
     }
 
-    public boolean readBoolean() throws IOException
-    {
+    public boolean readBoolean() throws IOException {
         return raf.readBoolean();
     }
 
-    public byte readByte() throws IOException
-    {
+    public byte readByte() throws IOException {
         return raf.readByte();
     }
 
-    public char readChar() throws IOException
-    {
+    public char readChar() throws IOException {
         return raf.readChar();
     }
 
-    public double readDouble() throws IOException
-    {
+    public double readDouble() throws IOException {
         return raf.readDouble();
     }
 
-    public float readFloat() throws IOException
-    {
+    public float readFloat() throws IOException {
         return raf.readFloat();
     }
 
-    public void readFully(final byte[] b) throws IOException
-    {
+    public void readFully(final byte[] b) throws IOException {
         raf.readFully(b);
     }
 
-    public void readFully(final byte[] b, final int off, final int len) throws IOException
-    {
+    public void readFully(final byte[] b, final int off, final int len) throws IOException
{
         raf.readFully(b, off, len);
     }
 
-    public int readInt() throws IOException
-    {
+    public int readInt() throws IOException {
         return raf.readInt();
     }
 
-    public long readLong() throws IOException
-    {
+    public long readLong() throws IOException {
         return raf.readLong();
     }
 
-    public short readShort() throws IOException
-    {
+    public short readShort() throws IOException {
         return raf.readShort();
     }
 
-    public int readUnsignedByte() throws IOException
-    {
+    public int readUnsignedByte() throws IOException {
         return raf.readUnsignedByte();
     }
 
-    public int readUnsignedShort() throws IOException
-    {
+    public int readUnsignedShort() throws IOException {
         return raf.readUnsignedShort();
     }
 
-    public String readUTF() throws IOException
-    {
+    public String readUTF() throws IOException {
         return raf.readUTF();
     }
 
-    public void seek(final long pos) throws IOException
-    {
+    public void seek(final long pos) throws IOException {
         raf.seek(pos);
     }
 
-    public void setLength(final long newLength) throws IOException
-    {
+    public void setLength(final long newLength) throws IOException {
         raf.setLength(newLength);
     }
 
-    public int skipBytes(final int n) throws IOException
-    {
+    public int skipBytes(final int n) throws IOException {
         return raf.skipBytes(n);
     }
 
     @Override
-    public void write(final byte[] b) throws IOException
-    {
+    public void write(final byte[] b) throws IOException {
         raf.write(b);
     }
 
     @Override
-    public void write(final byte[] b, final int off, final int len) throws IOException
-    {
+    public void write(final byte[] b, final int off, final int len) throws IOException {
         raf.write(b, off, len);
     }
 
     @Override
-    public void write(final int b) throws IOException
-    {
+    public void write(final int b) throws IOException {
         raf.write(b);
     }
 
     @Override
-    public void writeBoolean(final boolean v) throws IOException
-    {
+    public void writeBoolean(final boolean v) throws IOException {
         raf.writeBoolean(v);
     }
 
     @Override
-    public void writeByte(final int v) throws IOException
-    {
+    public void writeByte(final int v) throws IOException {
         raf.writeByte(v);
     }
 
     @Override
-    public void writeBytes(final String s) throws IOException
-    {
+    public void writeBytes(final String s) throws IOException {
         raf.writeBytes(s);
     }
 
     @Override
-    public void writeChar(final int v) throws IOException
-    {
+    public void writeChar(final int v) throws IOException {
         raf.writeChar(v);
     }
 
     @Override
-    public void writeChars(final String s) throws IOException
-    {
+    public void writeChars(final String s) throws IOException {
         raf.writeChars(s);
     }
 
     @Override
-    public void writeDouble(final double v) throws IOException
-    {
+    public void writeDouble(final double v) throws IOException {
         raf.writeDouble(v);
     }
 
     @Override
-    public void writeFloat(final float v) throws IOException
-    {
+    public void writeFloat(final float v) throws IOException {
         raf.writeFloat(v);
     }
 
     @Override
-    public void writeInt(final int v) throws IOException
-    {
+    public void writeInt(final int v) throws IOException {
         raf.writeInt(v);
     }
 
     @Override
-    public void writeLong(final long v) throws IOException
-    {
+    public void writeLong(final long v) throws IOException {
         raf.writeLong(v);
     }
 
     @Override
-    public void writeShort(final int v) throws IOException
-    {
+    public void writeShort(final int v) throws IOException {
         raf.writeShort(v);
     }
 
     @Override
-    public void writeUTF(final String str) throws IOException
-    {
+    public void writeUTF(final String str) throws IOException {
         raf.writeUTF(str);
     }
 

Modified: commons/proper/vfs/trunk/commons-vfs2-sandbox/src/main/java/org/apache/commons/vfs2/provider/smb/SmbFileSystem.java
URL: http://svn.apache.org/viewvc/commons/proper/vfs/trunk/commons-vfs2-sandbox/src/main/java/org/apache/commons/vfs2/provider/smb/SmbFileSystem.java?rev=1808388&r1=1808387&r2=1808388&view=diff
==============================================================================
--- commons/proper/vfs/trunk/commons-vfs2-sandbox/src/main/java/org/apache/commons/vfs2/provider/smb/SmbFileSystem.java
(original)
+++ commons/proper/vfs/trunk/commons-vfs2-sandbox/src/main/java/org/apache/commons/vfs2/provider/smb/SmbFileSystem.java
Thu Sep 14 19:43:40 2017
@@ -29,11 +29,8 @@ import org.apache.commons.vfs2.provider.
 /**
  * An SMB file system.
  */
-public class SmbFileSystem
-    extends AbstractFileSystem
-{
-    protected SmbFileSystem(final FileName rootName, final FileSystemOptions fileSystemOptions)
-    {
+public class SmbFileSystem extends AbstractFileSystem {
+    protected SmbFileSystem(final FileName rootName, final FileSystemOptions fileSystemOptions)
{
         super(rootName, null, fileSystemOptions);
     }
 
@@ -41,8 +38,7 @@ public class SmbFileSystem
      * Creates a file object.
      */
     @Override
-    protected FileObject createFile(final AbstractFileName name) throws FileSystemException
-    {
+    protected FileObject createFile(final AbstractFileName name) throws FileSystemException
{
         return new SmbFileObject(name, this);
     }
 
@@ -50,8 +46,7 @@ public class SmbFileSystem
      * Returns the capabilities of this file system.
      */
     @Override
-    protected void addCapabilities(final Collection<Capability> caps)
-    {
+    protected void addCapabilities(final Collection<Capability> caps) {
         caps.addAll(SmbFileProvider.capabilities);
     }
 }

Modified: commons/proper/vfs/trunk/commons-vfs2-sandbox/src/main/java/org/apache/commons/vfs2/util/FileObjectDataSource.java
URL: http://svn.apache.org/viewvc/commons/proper/vfs/trunk/commons-vfs2-sandbox/src/main/java/org/apache/commons/vfs2/util/FileObjectDataSource.java?rev=1808388&r1=1808387&r2=1808388&view=diff
==============================================================================
--- commons/proper/vfs/trunk/commons-vfs2-sandbox/src/main/java/org/apache/commons/vfs2/util/FileObjectDataSource.java
(original)
+++ commons/proper/vfs/trunk/commons-vfs2-sandbox/src/main/java/org/apache/commons/vfs2/util/FileObjectDataSource.java
Thu Sep 14 19:43:40 2017
@@ -28,39 +28,30 @@ import org.apache.commons.vfs2.FileSyste
 /**
  * (Sandbox) Provide access to a FileObject as JAF DataSource.
  */
-public class FileObjectDataSource implements DataSource
-{
+public class FileObjectDataSource implements DataSource {
     private final FileObject fo;
 
-    public FileObjectDataSource(final FileObject fo)
-    {
+    public FileObjectDataSource(final FileObject fo) {
         this.fo = fo;
     }
 
-    public InputStream getInputStream() throws IOException
-    {
+    public InputStream getInputStream() throws IOException {
         return fo.getContent().getInputStream();
     }
 
-    public OutputStream getOutputStream() throws IOException
-    {
+    public OutputStream getOutputStream() throws IOException {
         return fo.getContent().getOutputStream();
     }
 
-    public String getContentType()
-    {
-        try
-        {
+    public String getContentType() {
+        try {
             return fo.getContent().getContentInfo().getContentType();
-        }
-        catch (final FileSystemException e)
-        {
+        } catch (final FileSystemException e) {
             throw new RuntimeException(e);
         }
     }
 
-    public String getName()
-    {
+    public String getName() {
         return fo.getName().getBaseName();
     }
 }

Modified: commons/proper/vfs/trunk/commons-vfs2-sandbox/src/main/java/org/apache/commons/vfs2/util/RACRandomAccessFile.java
URL: http://svn.apache.org/viewvc/commons/proper/vfs/trunk/commons-vfs2-sandbox/src/main/java/org/apache/commons/vfs2/util/RACRandomAccessFile.java?rev=1808388&r1=1808387&r2=1808388&view=diff
==============================================================================
--- commons/proper/vfs/trunk/commons-vfs2-sandbox/src/main/java/org/apache/commons/vfs2/util/RACRandomAccessFile.java
(original)
+++ commons/proper/vfs/trunk/commons-vfs2-sandbox/src/main/java/org/apache/commons/vfs2/util/RACRandomAccessFile.java
Thu Sep 14 19:43:40 2017
@@ -22,127 +22,104 @@ import java.io.RandomAccessFile;
 import org.apache.commons.vfs2.RandomAccessContent;
 
 /**
- * (Sandbox) Encapsulates a {@link RandomAccessContent} instance, allowing it to be used
- * as a {@link RandomAccessFile} instance.
+ * (Sandbox) Encapsulates a {@link RandomAccessContent} instance, allowing it to be used
as a {@link RandomAccessFile}
+ * instance.
  */
-public class RACRandomAccessFile extends RandomAccessFile implements RandomAccessContent
-{
+public class RACRandomAccessFile extends RandomAccessFile implements RandomAccessContent
{
     private final byte[] singleByteBuf = new byte[1];
 
     private RandomAccessContent rac;
 
-    public RACRandomAccessFile(final RandomAccessContent rac) throws IOException
-    {
+    public RACRandomAccessFile(final RandomAccessContent rac) throws IOException {
         this(createTempFile());
         this.rac = rac;
     }
 
-    private RACRandomAccessFile(final File tempFile) throws IOException
-    {
+    private RACRandomAccessFile(final File tempFile) throws IOException {
         super(tempFile, "r");
         deleteTempFile(tempFile);
     }
 
-    private static File createTempFile() throws IOException
-    {
+    private static File createTempFile() throws IOException {
         return File.createTempFile("fraf", "");
     }
 
-    private void deleteTempFile(final File tempFile)
-    {
-        try
-        {
+    private void deleteTempFile(final File tempFile) {
+        try {
             super.close();
-        }
-        catch (final IOException ex)
-        {
+        } catch (final IOException ex) {
             throw new RuntimeException(ex);
-        }
-        finally
-        {
+        } finally {
             /* ignored = */ tempFile.delete();
         }
     }
 
     @Override
-    public long getFilePointer() throws IOException
-    {
+    public long getFilePointer() throws IOException {
         return this.rac.getFilePointer();
     }
 
     @Override
-    public void seek(final long pos) throws IOException
-    {
+    public void seek(final long pos) throws IOException {
         this.rac.seek(pos);
     }
 
     @Override
-    public int skipBytes(final int n) throws IOException
-    {
+    public int skipBytes(final int n) throws IOException {
         return this.rac.skipBytes(n);
     }
 
     @Override
-    public long length() throws IOException
-    {
+    public long length() throws IOException {
         return this.rac.length();
     }
 
     @Override
-    public void setLength(final long newLength) throws IOException
-    {
+    public void setLength(final long newLength) throws IOException {
         throw new IOException("Underlying RandomAccessContent instance length cannot be modified.");
     }
 
-    public InputStream getInputStream() throws IOException
-    {
+    public InputStream getInputStream() throws IOException {
         return this.rac.getInputStream();
     }
 
     @Override
-    public void close() throws IOException
-    {
+    public void close() throws IOException {
         this.rac.close();
     }
 
     @Override
-    public final int read(final byte[] b) throws IOException
-    {
+    public final int read(final byte[] b) throws IOException {
         return read(b, 0, b.length);
     }
 
     @Override
-    public final int read() throws IOException
-    {
+    public final int read() throws IOException {
         final byte[] buf = this.singleByteBuf;
         final int count = read(buf, 0, 1);
         return count < 0 ? -1 : buf[0] & 0xFF;
     }
 
     @Override
-    public int read(final byte[] b, final int off, final int len) throws IOException
-    {
+    public int read(final byte[] b, final int off, final int len) throws IOException {
         this.rac.readFully(b, off, len);
         return len;
     }
 
     @Override
-    public final void write(final int b) throws IOException
-    {
+    public final void write(final int b) throws IOException {
         final byte[] buf = this.singleByteBuf;
         buf[0] = (byte) b;
         write(buf, 0, 1);
     }
 
     @Override
-    public final void write(final byte[] b) throws IOException
-    {
+    public final void write(final byte[] b) throws IOException {
         write(b, 0, b.length);
     }
 
     @Override
-    public void write(final byte[] b, final int off, final int len) throws IOException
-    {
+    public void write(final byte[] b, final int off, final int len) throws IOException {
         this.rac.write(b, off, len);
     }
 

Modified: commons/proper/vfs/trunk/commons-vfs2-sandbox/src/main/java/org/apache/commons/vfs2/util/SharedRandomContentInputStream.java
URL: http://svn.apache.org/viewvc/commons/proper/vfs/trunk/commons-vfs2-sandbox/src/main/java/org/apache/commons/vfs2/util/SharedRandomContentInputStream.java?rev=1808388&r1=1808387&r2=1808388&view=diff
==============================================================================
--- commons/proper/vfs/trunk/commons-vfs2-sandbox/src/main/java/org/apache/commons/vfs2/util/SharedRandomContentInputStream.java
(original)
+++ commons/proper/vfs/trunk/commons-vfs2-sandbox/src/main/java/org/apache/commons/vfs2/util/SharedRandomContentInputStream.java
Thu Sep 14 19:43:40 2017
@@ -32,8 +32,7 @@ import org.apache.commons.vfs2.RandomAcc
 /**
  * (Sandbox) A wrapper to an FileObject to get a {@link javax.mail.internet.SharedInputStream}.
  */
-public class SharedRandomContentInputStream extends BufferedInputStream implements SharedInputStream
-{
+public class SharedRandomContentInputStream extends BufferedInputStream implements SharedInputStream
{
     private final Set<SharedRandomContentInputStream> createdStreams;
     private final FileObject fo;
     private final long fileStart;
@@ -43,14 +42,11 @@ public class SharedRandomContentInputStr
     private long resetCount;
 
     private SharedRandomContentInputStream(final Set<SharedRandomContentInputStream>
createdStreams,
-                                           final FileObject fo, final long fileStart, final
long fileEnd,
-                                           final InputStream is)
-        throws FileSystemException
-    {
+            final FileObject fo, final long fileStart, final long fileEnd, final InputStream
is)
+            throws FileSystemException {
         super(is);
 
-        if (!fo.getFileSystem().hasCapability(Capability.RANDOM_ACCESS_READ))
-        {
+        if (!fo.getFileSystem().hasCapability(Capability.RANDOM_ACCESS_READ)) {
             throw new FileSystemException("vfs.util/missing-capability.error", Capability.RANDOM_ACCESS_READ);
         }
 
@@ -59,23 +55,18 @@ public class SharedRandomContentInputStr
         this.fileEnd = fileEnd;
         this.createdStreams = createdStreams;
 
-        synchronized (createdStreams)
-        {
+        synchronized (createdStreams) {
             createdStreams.add(this);
         }
     }
 
-    public SharedRandomContentInputStream(final FileObject fo) throws FileSystemException
-    {
+    public SharedRandomContentInputStream(final FileObject fo) throws FileSystemException
{
         this(new HashSet<SharedRandomContentInputStream>(), fo, 0, -1, fo.getContent().getInputStream());
     }
 
-
     @Override
-    public synchronized int read() throws IOException
-    {
-        if (checkEnd())
-        {
+    public synchronized int read() throws IOException {
+        if (checkEnd()) {
             return -1;
         }
         final int r = super.read();
@@ -85,15 +76,12 @@ public class SharedRandomContentInputStr
     }
 
     @Override
-    public synchronized int read(final byte[] b, final int off, int len) throws IOException
-    {
-        if (checkEnd())
-        {
+    public synchronized int read(final byte[] b, final int off, int len) throws IOException
{
+        if (checkEnd()) {
             return -1;
         }
 
-        if (fileEnd > -1 && calcFilePosition(len) > fileEnd)
-        {
+        if (fileEnd > -1 && calcFilePosition(len) > fileEnd) {
             // we can not read past our end
             len = (int) (fileEnd - getFilePosition());
         }
@@ -105,15 +93,12 @@ public class SharedRandomContentInputStr
     }
 
     @Override
-    public synchronized long skip(long n) throws IOException
-    {
-        if (checkEnd())
-        {
+    public synchronized long skip(long n) throws IOException {
+        if (checkEnd()) {
             return -1;
         }
 
-        if (fileEnd > -1 && calcFilePosition(n) > fileEnd)
-        {
+        if (fileEnd > -1 && calcFilePosition(n) > fileEnd) {
             // we can not skip past our end
             n = fileEnd - getFilePosition();
         }
@@ -125,106 +110,73 @@ public class SharedRandomContentInputStr
     }
 
     /*
-    public synchronized int available() throws IOException
-    {
-        long realFileEnd = fileEnd;
-        if (realFileEnd < 0)
-        {
-            realFileEnd = fo.getContent().getSize();
-        }
-        if (realFileEnd < 0)
-        {
-            // we cant determine if there is really something available
-            return 8192;
-        }
-
-        long available = realFileEnd - (fileStart + pos);
-        if (available > Integer.MAX_VALUE)
-        {
-            return Integer.MAX_VALUE;
-        }
+     * public synchronized int available() throws IOException { long realFileEnd = fileEnd;
if (realFileEnd < 0) {
+     * realFileEnd = fo.getContent().getSize(); } if (realFileEnd < 0) { // we cant determine
if there is really
+     * something available return 8192; }
+     * 
+     * long available = realFileEnd - (fileStart + pos); if (available > Integer.MAX_VALUE)
{ return Integer.MAX_VALUE;
+     * }
+     * 
+     * return (int) available; }
+     */
 
-        return (int) available;
-    }
-    */
-
-    private boolean checkEnd()
-    {
+    private boolean checkEnd() {
         return fileEnd > -1 && (getFilePosition() >= fileEnd);
     }
 
-    protected long getFilePosition()
-    {
+    protected long getFilePosition() {
         return fileStart + pos;
     }
 
-    protected long calcFilePosition(final long nadd)
-    {
+    protected long calcFilePosition(final long nadd) {
         return getFilePosition() + nadd;
     }
 
     @Override
-    public synchronized void mark(final int readlimit)
-    {
+    public synchronized void mark(final int readlimit) {
         super.mark(readlimit);
         resetCount = 0;
     }
 
     @Override
-    public synchronized void reset() throws IOException
-    {
+    public synchronized void reset() throws IOException {
         super.reset();
         pos -= resetCount;
         resetCount = 0;
     }
 
-    public long getPosition()
-    {
+    public long getPosition() {
         return pos;
     }
 
-
     @Override
-    public void close() throws IOException
-    {
+    public void close() throws IOException {
         super.close();
 
-        synchronized (createdStreams)
-        {
+        synchronized (createdStreams) {
             createdStreams.remove(this);
         }
     }
 
-    public InputStream newStream(final long start, final long end)
-    {
-        try
-        {
+    public InputStream newStream(final long start, final long end) {
+        try {
             final long newFileStart = this.fileStart + start;
             final long newFileEnd = end < 0 ? this.fileEnd : this.fileStart + end;
 
             final RandomAccessContent rac = fo.getContent().getRandomAccessContent(RandomAccessMode.READ);
             rac.seek(newFileStart);
-            return new SharedRandomContentInputStream(
-                createdStreams,
-                fo,
-                newFileStart,
-                newFileEnd,
-                rac.getInputStream());
-        }
-        catch (final IOException e)
-        {
+            return new SharedRandomContentInputStream(createdStreams, fo, newFileStart, newFileEnd,
+                    rac.getInputStream());
+        } catch (final IOException e) {
             throw new RuntimeException(e);
         }
     }
 
-    public void closeAll() throws IOException
-    {
-        synchronized (createdStreams)
-        {
+    public void closeAll() throws IOException {
+        synchronized (createdStreams) {
             final SharedRandomContentInputStream[] streams = new SharedRandomContentInputStream[createdStreams.size()];
             createdStreams.toArray(streams);
-            for (final SharedRandomContentInputStream stream : streams)
-            {
+            for (final SharedRandomContentInputStream stream : streams) {
                 stream.close();
             }
         }

Modified: commons/proper/vfs/trunk/commons-vfs2-sandbox/src/test/java/org/apache/commons/vfs2/provider/smb/test/FileNameTestCase.java
URL: http://svn.apache.org/viewvc/commons/proper/vfs/trunk/commons-vfs2-sandbox/src/test/java/org/apache/commons/vfs2/provider/smb/test/FileNameTestCase.java?rev=1808388&r1=1808387&r2=1808388&view=diff
==============================================================================
--- commons/proper/vfs/trunk/commons-vfs2-sandbox/src/test/java/org/apache/commons/vfs2/provider/smb/test/FileNameTestCase.java
(original)
+++ commons/proper/vfs/trunk/commons-vfs2-sandbox/src/test/java/org/apache/commons/vfs2/provider/smb/test/FileNameTestCase.java
Thu Sep 14 19:43:40 2017
@@ -24,17 +24,16 @@ import org.apache.commons.vfs2.provider.
 /**
  * Some additional SMB file name test cases.
  */
-public class FileNameTestCase
-    extends AbstractVfsTestCase
-{
+public class FileNameTestCase extends AbstractVfsTestCase {
     /**
      * Tests parsing a URI into its parts.
+     * 
      * @throws Exception in case of error
      */
-    public void testParseUri() throws Exception
-    {
+    public void testParseUri() throws Exception {
         // Simple name
-        SmbFileName name = (SmbFileName) SmbFileNameParser.getInstance().parseUri(null, null,
"smb://hostname/share/file");
+        SmbFileName name = (SmbFileName) SmbFileNameParser.getInstance().parseUri(null, null,
+                "smb://hostname/share/file");
         assertEquals("smb", name.getScheme());
         assertNull(name.getUserName());
         assertNull(name.getPassword());
@@ -113,10 +112,10 @@ public class FileNameTestCase
 
     /**
      * Tests error handling in URI parser.
+     * 
      * @throws Exception in case of error
      */
-    public void testBadlyFormedUri() throws Exception
-    {
+    public void testBadlyFormedUri() throws Exception {
         // Does not start with smb://
         testBadlyFormedUri("smb:", "vfs.provider/missing-double-slashes.error");
         testBadlyFormedUri("smb:/", "vfs.provider/missing-double-slashes.error");
@@ -145,15 +144,11 @@ public class FileNameTestCase
     /**
      * Assert that parsing a URI fails with the expected error.
      */
-    private void testBadlyFormedUri(final String uri, final String errorMsg)
-    {
-        try
-        {
+    private void testBadlyFormedUri(final String uri, final String errorMsg) {
+        try {
             SmbFileNameParser.getInstance().parseUri(null, null, uri);
             fail();
-        }
-        catch (final FileSystemException e)
-        {
+        } catch (final FileSystemException e) {
             assertSameMessage(errorMsg, uri, e);
         }
     }

Modified: commons/proper/vfs/trunk/commons-vfs2-sandbox/src/test/java/org/apache/commons/vfs2/provider/smb/test/SmbProviderTestCase.java
URL: http://svn.apache.org/viewvc/commons/proper/vfs/trunk/commons-vfs2-sandbox/src/test/java/org/apache/commons/vfs2/provider/smb/test/SmbProviderTestCase.java?rev=1808388&r1=1808387&r2=1808388&view=diff
==============================================================================
--- commons/proper/vfs/trunk/commons-vfs2-sandbox/src/test/java/org/apache/commons/vfs2/provider/smb/test/SmbProviderTestCase.java
(original)
+++ commons/proper/vfs/trunk/commons-vfs2-sandbox/src/test/java/org/apache/commons/vfs2/provider/smb/test/SmbProviderTestCase.java
Thu Sep 14 19:43:40 2017
@@ -29,19 +29,13 @@ import org.apache.commons.vfs2.test.Prov
 /**
  * Tests for the SMB file system.
  */
-public class SmbProviderTestCase
-    extends AbstractProviderTestConfig
-    implements ProviderTestConfig
-{
+public class SmbProviderTestCase extends AbstractProviderTestConfig implements ProviderTestConfig
{
     private static final String TEST_URI = "test.smb.uri";
-    public static Test suite() throws Exception
-    {
-        if (System.getProperty(TEST_URI) != null)
-        {
+
+    public static Test suite() throws Exception {
+        if (System.getProperty(TEST_URI) != null) {
             return new ProviderTestSuite(new SmbProviderTestCase());
-        }
-        else
-        {
+        } else {
             return notConfigured(SmbProviderTestCase.class);
         }
     }
@@ -50,9 +44,7 @@ public class SmbProviderTestCase
      * Prepares the file system manager.
      */
     @Override
-    public void prepare(final DefaultFileSystemManager manager)
-        throws Exception
-    {
+    public void prepare(final DefaultFileSystemManager manager) throws Exception {
         manager.addProvider("smb", new SmbFileProvider());
     }
 
@@ -60,8 +52,7 @@ public class SmbProviderTestCase
      * Returns the base folder for tests.
      */
     @Override
-    public FileObject getBaseTestFolder(final FileSystemManager manager) throws Exception
-    {
+    public FileObject getBaseTestFolder(final FileSystemManager manager) throws Exception
{
         final String uri = System.getProperty(TEST_URI);
         return manager.resolveFile(uri);
     }

Modified: commons/proper/vfs/trunk/commons-vfs2/src/test/java/org/apache/commons/vfs2/provider/webdav/test/WebdavProviderTestCase.java
URL: http://svn.apache.org/viewvc/commons/proper/vfs/trunk/commons-vfs2/src/test/java/org/apache/commons/vfs2/provider/webdav/test/WebdavProviderTestCase.java?rev=1808388&r1=1808387&r2=1808388&view=diff
==============================================================================
--- commons/proper/vfs/trunk/commons-vfs2/src/test/java/org/apache/commons/vfs2/provider/webdav/test/WebdavProviderTestCase.java
(original)
+++ commons/proper/vfs/trunk/commons-vfs2/src/test/java/org/apache/commons/vfs2/provider/webdav/test/WebdavProviderTestCase.java
Thu Sep 14 19:43:40 2017
@@ -256,9 +256,13 @@ public class WebdavProviderTestCase exte
     }
 
     /**
-     * Tears down resources for this test case. <ol> <li>Shuts down the embedded
Jackrabbit</li> <li>Extra clean up for
-     * org.apache.commons.httpclient.MultiThreadedHttpConnectionManager</li> <li>Remove
temporary repository
-     * directory.</li> </ol> Stops the embedded Apache WebDAV Server.
+     * Tears down resources for this test case.
+     * <ol>
+     * <li>Shuts down the embedded Jackrabbit</li>
+     * <li>Extra clean up for org.apache.commons.httpclient.MultiThreadedHttpConnectionManager</li>
+     * <li>Remove temporary repository directory.</li>
+     * </ol>
+     * Stops the embedded Apache WebDAV Server.
      *
      * @throws Exception @throws
      */



Mime
View raw message