Author: ecki Date: Sun Jan 11 18:38:59 2015 New Revision: 1650947 URL: http://svn.apache.org/r1650947 Log: [sandbox] resolve all checkstyle warnings in smb provider
Modified: commons/proper/vfs/trunk/sandbox/src/main/java/org/apache/commons/vfs2/provider/smb/SmbFileName.java commons/proper/vfs/trunk/sandbox/src/main/java/org/apache/commons/vfs2/provider/smb/SmbFileNameParser.java commons/proper/vfs/trunk/sandbox/src/main/java/org/apache/commons/vfs2/provider/smb/SmbFileObject.java commons/proper/vfs/trunk/sandbox/src/main/java/org/apache/commons/vfs2/provider/smb/SmbFileProvider.java commons/proper/vfs/trunk/sandbox/src/main/java/org/apache/commons/vfs2/provider/smb/SmbFileRandomAccessContent.java Modified: commons/proper/vfs/trunk/sandbox/src/main/java/org/apache/commons/vfs2/provider/smb/SmbFileName.java URL: http://svn.apache.org/viewvc/commons/proper/vfs/trunk/sandbox/src/main/java/org/apache/commons/vfs2/provider/smb/SmbFileName.java?rev=1650947&r1=1650946&r2=1650947&view=diff ============================================================================== --- commons/proper/vfs/trunk/sandbox/src/main/java/org/apache/commons/vfs2/provider/smb/SmbFileName.java (original) +++ commons/proper/vfs/trunk/sandbox/src/main/java/org/apache/commons/vfs2/provider/smb/SmbFileName.java Sun Jan 11 18:38:59 2015 @@ -87,6 +87,9 @@ public class SmbFileName extends Generic /** * Factory method for creating name instances. + * + * @param path path of file. + * @param type file or directory * @return new SmbFileName object, never null. */ @Override Modified: commons/proper/vfs/trunk/sandbox/src/main/java/org/apache/commons/vfs2/provider/smb/SmbFileNameParser.java URL: http://svn.apache.org/viewvc/commons/proper/vfs/trunk/sandbox/src/main/java/org/apache/commons/vfs2/provider/smb/SmbFileNameParser.java?rev=1650947&r1=1650946&r2=1650947&view=diff ============================================================================== --- commons/proper/vfs/trunk/sandbox/src/main/java/org/apache/commons/vfs2/provider/smb/SmbFileNameParser.java (original) +++ commons/proper/vfs/trunk/sandbox/src/main/java/org/apache/commons/vfs2/provider/smb/SmbFileNameParser.java Sun Jan 11 18:38:59 2015 @@ -29,11 +29,12 @@ import org.apache.commons.vfs2.provider. */ public class SmbFileNameParser extends URLFileNameParser { - private final static SmbFileNameParser INSTANCE = new SmbFileNameParser(); + private static final SmbFileNameParser INSTANCE = new SmbFileNameParser(); + private static final int SMB_PORT = 139; public SmbFileNameParser() { - super(139); + super(SMB_PORT); } public static FileNameParser getInstance() @@ -42,7 +43,8 @@ public class SmbFileNameParser extends U } @Override - public FileName parseUri(final VfsComponentContext context, final FileName base, final String filename) throws FileSystemException + public FileName parseUri(final VfsComponentContext context, final FileName base, + final String filename) throws FileSystemException { final StringBuilder name = new StringBuilder(); Modified: commons/proper/vfs/trunk/sandbox/src/main/java/org/apache/commons/vfs2/provider/smb/SmbFileObject.java URL: http://svn.apache.org/viewvc/commons/proper/vfs/trunk/sandbox/src/main/java/org/apache/commons/vfs2/provider/smb/SmbFileObject.java?rev=1650947&r1=1650946&r2=1650947&view=diff ============================================================================== --- commons/proper/vfs/trunk/sandbox/src/main/java/org/apache/commons/vfs2/provider/smb/SmbFileObject.java (original) +++ commons/proper/vfs/trunk/sandbox/src/main/java/org/apache/commons/vfs2/provider/smb/SmbFileObject.java Sun Jan 11 18:38:59 2015 @@ -75,7 +75,8 @@ public class SmbFileObject file = null; } - private SmbFile createSmbFile(final FileName fileName) throws MalformedURLException, SmbException, FileSystemException + private SmbFile createSmbFile(final FileName fileName) + throws MalformedURLException, SmbException, FileSystemException { final SmbFileName smbFileName = (SmbFileName) fileName; @@ -86,7 +87,9 @@ public class SmbFileObject NtlmPasswordAuthentication auth; try { - authData = UserAuthenticatorUtils.authenticate(getFileSystem().getFileSystemOptions(), SmbFileProvider.AUTHENTICATOR_TYPES); + authData = UserAuthenticatorUtils.authenticate( + getFileSystem().getFileSystemOptions(), + SmbFileProvider.AUTHENTICATOR_TYPES); auth = new NtlmPasswordAuthentication( UserAuthenticatorUtils.toString( @@ -256,7 +259,8 @@ public class SmbFileObject } @Override - protected boolean doSetLastModifiedTime(final long modtime) throws Exception { + protected boolean doSetLastModifiedTime(final long modtime) throws Exception + { file.setLastModified(modtime); return true; } Modified: commons/proper/vfs/trunk/sandbox/src/main/java/org/apache/commons/vfs2/provider/smb/SmbFileProvider.java URL: http://svn.apache.org/viewvc/commons/proper/vfs/trunk/sandbox/src/main/java/org/apache/commons/vfs2/provider/smb/SmbFileProvider.java?rev=1650947&r1=1650946&r2=1650947&view=diff ============================================================================== --- commons/proper/vfs/trunk/sandbox/src/main/java/org/apache/commons/vfs2/provider/smb/SmbFileProvider.java (original) +++ commons/proper/vfs/trunk/sandbox/src/main/java/org/apache/commons/vfs2/provider/smb/SmbFileProvider.java Sun Jan 11 18:38:59 2015 @@ -36,29 +36,31 @@ public class SmbFileProvider extends AbstractOriginatingFileProvider implements FileProvider { - protected final static Collection<Capability> capabilities = Collections.unmodifiableCollection(Arrays.asList(new Capability[] - { - Capability.CREATE, - Capability.DELETE, - Capability.RENAME, - Capability.GET_TYPE, - Capability.GET_LAST_MODIFIED, - Capability.SET_LAST_MODIFIED_FILE, - Capability.SET_LAST_MODIFIED_FOLDER, - Capability.LIST_CHILDREN, - Capability.READ_CONTENT, - Capability.URI, - Capability.WRITE_CONTENT, - Capability.APPEND_CONTENT, - Capability.RANDOM_ACCESS_READ, - Capability.RANDOM_ACCESS_WRITE - })); - - public final static UserAuthenticationData.Type[] AUTHENTICATOR_TYPES = new UserAuthenticationData.Type[] + /** Authentication data supported by this provider. */ + public static final UserAuthenticationData.Type[] AUTHENTICATOR_TYPES = new UserAuthenticationData.Type[] { UserAuthenticationData.USERNAME, UserAuthenticationData.PASSWORD, UserAuthenticationData.DOMAIN }; + static final Collection<Capability> capabilities = + Collections.unmodifiableCollection(Arrays.asList(new Capability[] + { + Capability.CREATE, + Capability.DELETE, + Capability.RENAME, + Capability.GET_TYPE, + Capability.GET_LAST_MODIFIED, + Capability.SET_LAST_MODIFIED_FILE, + Capability.SET_LAST_MODIFIED_FOLDER, + Capability.LIST_CHILDREN, + Capability.READ_CONTENT, + Capability.URI, + Capability.WRITE_CONTENT, + Capability.APPEND_CONTENT, + Capability.RANDOM_ACCESS_READ, + Capability.RANDOM_ACCESS_WRITE + })); + public SmbFileProvider() { super(); Modified: commons/proper/vfs/trunk/sandbox/src/main/java/org/apache/commons/vfs2/provider/smb/SmbFileRandomAccessContent.java URL: http://svn.apache.org/viewvc/commons/proper/vfs/trunk/sandbox/src/main/java/org/apache/commons/vfs2/provider/smb/SmbFileRandomAccessContent.java?rev=1650947&r1=1650946&r2=1650947&view=diff ============================================================================== --- commons/proper/vfs/trunk/sandbox/src/main/java/org/apache/commons/vfs2/provider/smb/SmbFileRandomAccessContent.java (original) +++ commons/proper/vfs/trunk/sandbox/src/main/java/org/apache/commons/vfs2/provider/smb/SmbFileRandomAccessContent.java Sun Jan 11 18:38:59 2015 @@ -71,13 +71,13 @@ class SmbFileRandomAccessContent extends } @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); } @@ -149,12 +149,12 @@ class SmbFileRandomAccessContent extends 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); } @@ -194,7 +194,8 @@ class SmbFileRandomAccessContent extends raf.seek(pos); } - public void setLength(final long newLength) throws IOException { + public void setLength(final long newLength) throws IOException + { raf.setLength(newLength); } @@ -204,13 +205,13 @@ class SmbFileRandomAccessContent extends } @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); }