Author: ecki Date: Sun Jan 11 18:09:19 2015 New Revision: 1650937 URL: http://svn.apache.org/r1650937 Log: [sandbox] resolve all checkstyle warnings in mime provider
Added: commons/proper/vfs/trunk/sandbox/src/main/java/org/apache/commons/vfs2/provider/mime/package.html Modified: commons/proper/vfs/trunk/sandbox/src/main/java/org/apache/commons/vfs2/provider/mime/MimeAttributesMap.java commons/proper/vfs/trunk/sandbox/src/main/java/org/apache/commons/vfs2/provider/mime/MimeFileContentInfoFactory.java commons/proper/vfs/trunk/sandbox/src/main/java/org/apache/commons/vfs2/provider/mime/MimeFileObject.java commons/proper/vfs/trunk/sandbox/src/main/java/org/apache/commons/vfs2/provider/mime/MimeFileProvider.java commons/proper/vfs/trunk/sandbox/src/main/java/org/apache/commons/vfs2/provider/mime/MimeFileSystem.java Modified: commons/proper/vfs/trunk/sandbox/src/main/java/org/apache/commons/vfs2/provider/mime/MimeAttributesMap.java URL: http://svn.apache.org/viewvc/commons/proper/vfs/trunk/sandbox/src/main/java/org/apache/commons/vfs2/provider/mime/MimeAttributesMap.java?rev=1650937&r1=1650936&r2=1650937&view=diff ============================================================================== --- commons/proper/vfs/trunk/sandbox/src/main/java/org/apache/commons/vfs2/provider/mime/MimeAttributesMap.java (original) +++ commons/proper/vfs/trunk/sandbox/src/main/java/org/apache/commons/vfs2/provider/mime/MimeAttributesMap.java Sun Jan 11 18:09:19 2015 @@ -39,18 +39,18 @@ import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; /** - * A map which tries to allow access to the various aspects of the mail + * A map which tries to allow access to the various aspects of the mail. */ public class MimeAttributesMap implements Map<String, Object> { - private final Log log = LogFactory.getLog(MimeAttributesMap.class); - - private final static String OBJECT_PREFIX = "obj."; + private static final String OBJECT_PREFIX = "obj."; + private final Log log = LogFactory.getLog(MimeAttributesMap.class); private final Part part; + private final Map<String, Method> mimeMessageGetters = new TreeMap<String, Method>(); + private Map<String, Object> backingMap; - private final Map<String, Method> mimeMessageGetters = new TreeMap<String, Method>(); public MimeAttributesMap(final Part part) { @@ -61,7 +61,8 @@ public class MimeAttributesMap implement private void addMimeMessageMethod(final Method[] methods) { - for (final Method method : methods) { + for (final Method method : methods) + { if (!Modifier.isPublic(method.getModifiers())) { continue; Modified: commons/proper/vfs/trunk/sandbox/src/main/java/org/apache/commons/vfs2/provider/mime/MimeFileContentInfoFactory.java URL: http://svn.apache.org/viewvc/commons/proper/vfs/trunk/sandbox/src/main/java/org/apache/commons/vfs2/provider/mime/MimeFileContentInfoFactory.java?rev=1650937&r1=1650936&r2=1650937&view=diff ============================================================================== --- commons/proper/vfs/trunk/sandbox/src/main/java/org/apache/commons/vfs2/provider/mime/MimeFileContentInfoFactory.java (original) +++ commons/proper/vfs/trunk/sandbox/src/main/java/org/apache/commons/vfs2/provider/mime/MimeFileContentInfoFactory.java Sun Jan 11 18:09:19 2015 @@ -27,7 +27,7 @@ import org.apache.commons.vfs2.FileSyste import org.apache.commons.vfs2.impl.DefaultFileContentInfo; /** - * get access to the content info stuff for mime objects + * Get access to the content info stuff for mime objects. */ public class MimeFileContentInfoFactory implements FileContentInfoFactory { Modified: commons/proper/vfs/trunk/sandbox/src/main/java/org/apache/commons/vfs2/provider/mime/MimeFileObject.java URL: http://svn.apache.org/viewvc/commons/proper/vfs/trunk/sandbox/src/main/java/org/apache/commons/vfs2/provider/mime/MimeFileObject.java?rev=1650937&r1=1650936&r2=1650937&view=diff ============================================================================== --- commons/proper/vfs/trunk/sandbox/src/main/java/org/apache/commons/vfs2/provider/mime/MimeFileObject.java (original) +++ commons/proper/vfs/trunk/sandbox/src/main/java/org/apache/commons/vfs2/provider/mime/MimeFileObject.java Sun Jan 11 18:09:19 2015 @@ -91,7 +91,7 @@ public class MimeFileObject if (partName.startsWith(MimeFileSystem.NULL_BP_NAME)) { final int partNumber = Integer.parseInt(partName.substring(MimeFileSystem.NULL_BP_NAME.length()), 10); - if (partNumber < 0 || partNumber+1 > multipart.getCount()) + if (partNumber < 0 || partNumber + 1 > multipart.getCount()) { // non existent return null; @@ -100,7 +100,7 @@ public class MimeFileObject return multipart.getBodyPart(partNumber); } - for (int i = 0; i<multipart.getCount(); i++) + for (int i = 0; i < multipart.getCount(); i++) { final Part childPart = multipart.getBodyPart(i); if (partName.equals(childPart.getFileName())) @@ -165,7 +165,7 @@ public class MimeFileObject { final Multipart multipart = (Multipart) container; - for (int i = 0; i<multipart.getCount(); i++) + for (int i = 0; i < multipart.getCount(); i++) { final Part part = multipart.getBodyPart(i); @@ -175,9 +175,9 @@ public class MimeFileObject filename = MimeFileSystem.NULL_BP_NAME + i; } - final MimeFileObject fo = (MimeFileObject) FileObjectUtils.getAbstractFileObject(getFileSystem().resolveFile( - getFileSystem().getFileSystemManager().resolveName( - getName(), + final MimeFileObject fo = (MimeFileObject) FileObjectUtils.getAbstractFileObject( + getFileSystem().resolveFile( + getFileSystem().getFileSystemManager().resolveName(getName(), filename, NameScope.CHILD))); fo.setPart(part); Modified: commons/proper/vfs/trunk/sandbox/src/main/java/org/apache/commons/vfs2/provider/mime/MimeFileProvider.java URL: http://svn.apache.org/viewvc/commons/proper/vfs/trunk/sandbox/src/main/java/org/apache/commons/vfs2/provider/mime/MimeFileProvider.java?rev=1650937&r1=1650936&r2=1650937&view=diff ============================================================================== --- commons/proper/vfs/trunk/sandbox/src/main/java/org/apache/commons/vfs2/provider/mime/MimeFileProvider.java (original) +++ commons/proper/vfs/trunk/sandbox/src/main/java/org/apache/commons/vfs2/provider/mime/MimeFileProvider.java Sun Jan 11 18:09:19 2015 @@ -38,15 +38,16 @@ public class MimeFileProvider extends AbstractLayeredFileProvider implements FileProvider { - protected final static Collection<Capability> capabilities = Collections.unmodifiableCollection(Arrays.asList(new Capability[] - { - Capability.GET_TYPE, - Capability.GET_LAST_MODIFIED, - Capability.LIST_CHILDREN, - Capability.READ_CONTENT, - Capability.URI, - Capability.ATTRIBUTES - })); + static final Collection<Capability> capabilities = + Collections.unmodifiableCollection(Arrays.asList(new Capability[] + { + Capability.GET_TYPE, + Capability.GET_LAST_MODIFIED, + Capability.LIST_CHILDREN, + Capability.READ_CONTENT, + Capability.URI, + Capability.ATTRIBUTES + })); public MimeFileProvider() { @@ -57,7 +58,8 @@ public class MimeFileProvider * Creates the filesystem. */ @Override - protected FileSystem doCreateFileSystem(final String scheme, final FileObject file, final FileSystemOptions fileSystemOptions) + protected FileSystem doCreateFileSystem(final String scheme, final FileObject file, + final FileSystemOptions fileSystemOptions) throws FileSystemException { final FileName name = Modified: commons/proper/vfs/trunk/sandbox/src/main/java/org/apache/commons/vfs2/provider/mime/MimeFileSystem.java URL: http://svn.apache.org/viewvc/commons/proper/vfs/trunk/sandbox/src/main/java/org/apache/commons/vfs2/provider/mime/MimeFileSystem.java?rev=1650937&r1=1650936&r2=1650937&view=diff ============================================================================== --- commons/proper/vfs/trunk/sandbox/src/main/java/org/apache/commons/vfs2/provider/mime/MimeFileSystem.java (original) +++ commons/proper/vfs/trunk/sandbox/src/main/java/org/apache/commons/vfs2/provider/mime/MimeFileSystem.java Sun Jan 11 18:09:19 2015 @@ -41,15 +41,16 @@ import org.apache.commons.vfs2.util.Shar public class MimeFileSystem extends AbstractFileSystem { - private final Log log = LogFactory.getLog(MimeFileSystem.class); + static final String NULL_BP_NAME = "_body_part_"; + static final String CONTENT_NAME = "_content"; + static final String PREAMBLE_CHARSET = "UTF-8"; - public final static String NULL_BP_NAME = "_body_part_"; - public final static String CONTENT_NAME = "_content"; - public final static String PREAMBLE_CHARSET = "UTF-8"; + private final Log log = LogFactory.getLog(MimeFileSystem.class); private InputStream mimeStream = null; - protected MimeFileSystem(final FileName rootName, final FileObject parentLayer, final FileSystemOptions fileSystemOptions) + protected MimeFileSystem(final FileName rootName, final FileObject parentLayer, + final FileSystemOptions fileSystemOptions) { super(rootName, parentLayer, fileSystemOptions); } Added: commons/proper/vfs/trunk/sandbox/src/main/java/org/apache/commons/vfs2/provider/mime/package.html URL: http://svn.apache.org/viewvc/commons/proper/vfs/trunk/sandbox/src/main/java/org/apache/commons/vfs2/provider/mime/package.html?rev=1650937&view=auto ============================================================================== --- commons/proper/vfs/trunk/sandbox/src/main/java/org/apache/commons/vfs2/provider/mime/package.html (added) +++ commons/proper/vfs/trunk/sandbox/src/main/java/org/apache/commons/vfs2/provider/mime/package.html Sun Jan 11 18:09:19 2015 @@ -0,0 +1,19 @@ +<!-- + Licensed to the Apache Software Foundation (ASF) under one or more + contributor license agreements. See the NOTICE file distributed with + this work for additional information regarding copyright ownership. + The ASF licenses this file to You under the Apache License, Version 2.0 + (the "License"); you may not use this file except in compliance with + the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + --> +<body> +<p>The Mime File Provider.</p> +</body>