You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by rg...@apache.org on 2009/07/24 02:39:30 UTC
svn commit: r797282 - in
/commons/proper/configuration/trunk/src/java/org/apache/commons/configuration:
VFSFileSystem.java XMLConfiguration.java plist/PropertyListConfiguration.java
Author: rgoers
Date: Fri Jul 24 00:39:29 2009
New Revision: 797282
URL: http://svn.apache.org/viewvc?rev=797282&view=rev
Log:
Remove unneeded imports and variables. Fix checkstyle errors
Modified:
commons/proper/configuration/trunk/src/java/org/apache/commons/configuration/VFSFileSystem.java
commons/proper/configuration/trunk/src/java/org/apache/commons/configuration/XMLConfiguration.java
commons/proper/configuration/trunk/src/java/org/apache/commons/configuration/plist/PropertyListConfiguration.java
Modified: commons/proper/configuration/trunk/src/java/org/apache/commons/configuration/VFSFileSystem.java
URL: http://svn.apache.org/viewvc/commons/proper/configuration/trunk/src/java/org/apache/commons/configuration/VFSFileSystem.java?rev=797282&r1=797281&r2=797282&view=diff
==============================================================================
--- commons/proper/configuration/trunk/src/java/org/apache/commons/configuration/VFSFileSystem.java (original)
+++ commons/proper/configuration/trunk/src/java/org/apache/commons/configuration/VFSFileSystem.java Fri Jul 24 00:39:29 2009
@@ -24,13 +24,8 @@
import org.apache.commons.vfs.FileSystemException;
import org.apache.commons.vfs.FileType;
import org.apache.commons.vfs.FileSystemOptions;
-import org.apache.commons.vfs.UserAuthenticator;
import org.apache.commons.vfs.FileSystemConfigBuilder;
-import org.apache.commons.vfs.impl.DefaultFileSystemConfigBuilder;
import org.apache.commons.vfs.provider.UriParser;
-import org.apache.commons.vfs.provider.http.HttpFileSystemConfigBuilder;
-import org.apache.commons.vfs.provider.webdav.WebdavFileSystemConfigBuilder;
-import org.apache.commons.beanutils.BeanUtils;
import java.io.InputStream;
import java.io.OutputStream;
@@ -52,44 +47,8 @@
*/
public class VFSFileSystem extends DefaultFileSystem
{
- /** The builder for Webdav options */
- private final WebdavFileSystemConfigBuilder webdavBuilder;
-
- /** The builder for Http optiosn */
- private final HttpFileSystemConfigBuilder httpBuilder;
-
public VFSFileSystem()
{
- WebdavFileSystemConfigBuilder wb = null;
- try
- {
- FileSystemManager manager = VFS.getManager();
- if (manager.hasProvider("webdav"))
- {
- wb = (WebdavFileSystemConfigBuilder) manager.getFileSystemConfigBuilder("webdav");
- }
- }
- catch (FileSystemException e)
- {
- // Just ignore the error. Webdav won't have options.
- wb = null;
- }
- webdavBuilder = wb;
- HttpFileSystemConfigBuilder hb = null;
- try
- {
- FileSystemManager manager = VFS.getManager();
- if (manager.hasProvider("http"))
- {
- hb = (HttpFileSystemConfigBuilder) manager.getFileSystemConfigBuilder("http");
- }
- }
- catch (FileSystemException e)
- {
- // Just ignore the error http won't have options.
- hb = null;
- }
- httpBuilder = hb;
}
public InputStream getInputStream(String basePath, String fileName)
@@ -111,8 +70,8 @@
path = manager.resolveName(base, file.getBaseName());
}
FileSystemOptions opts = getOptions(path.getScheme());
- FileObject file = (opts == null) ? manager.resolveFile(path.getURI()) :
- manager.resolveFile(path.getURI(), opts);
+ FileObject file = (opts == null) ? manager.resolveFile(path.getURI())
+ : manager.resolveFile(path.getURI(), opts);
FileContent content = file.getContent();
if (content == null)
{
@@ -137,8 +96,8 @@
try
{
FileSystemOptions opts = getOptions(url.getProtocol());
- file = (opts == null) ? VFS.getManager().resolveFile(url.toString()) :
- VFS.getManager().resolveFile(url.toString(), opts);
+ file = (opts == null) ? VFS.getManager().resolveFile(url.toString())
+ : VFS.getManager().resolveFile(url.toString(), opts);
if (file.getType() != FileType.FILE)
{
throw new ConfigurationException("Cannot load a configuration from a directory");
@@ -164,8 +123,8 @@
{
FileSystemOptions opts = getOptions(url.getProtocol());
FileSystemManager fsManager = VFS.getManager();
- FileObject file = (opts == null) ? fsManager.resolveFile(url.toString()) :
- fsManager.resolveFile(url.toString(), opts);
+ FileObject file = (opts == null) ? fsManager.resolveFile(url.toString())
+ : fsManager.resolveFile(url.toString(), opts);
// throw an exception if the target URL is a directory
if (file == null || file.getType() == FileType.FOLDER)
{
@@ -315,8 +274,8 @@
{
String scheme = UriParser.extractScheme(basePath);
FileSystemOptions opts = (scheme != null) ? getOptions(scheme) : null;
- FileObject base = (opts == null) ? fsManager.resolveFile(basePath) :
- fsManager.resolveFile(basePath, opts);
+ FileObject base = (opts == null) ? fsManager.resolveFile(basePath)
+ : fsManager.resolveFile(basePath, opts);
if (base.getType() == FileType.FILE)
{
base = base.getParent();
@@ -327,8 +286,8 @@
else
{
FileSystemOptions opts = (fileScheme != null) ? getOptions(fileScheme) : null;
- file = (opts == null) ? fsManager.resolveFile(fileName) :
- fsManager.resolveFile(fileName, opts);
+ file = (opts == null) ? fsManager.resolveFile(fileName)
+ : fsManager.resolveFile(fileName, opts);
}
if (!file.exists())
@@ -387,6 +346,7 @@
catch (Exception ex)
{
// Ignore an incorrect property.
+ continue;
}
}
if (count > 0)
@@ -401,7 +361,7 @@
private void setProperty(FileSystemConfigBuilder builder, FileSystemOptions options,
String key, Object value)
{
- String methodName = "set" + key.substring(0,1).toUpperCase() + key.substring(1);
+ String methodName = "set" + key.substring(0, 1).toUpperCase() + key.substring(1);
Class[] paramTypes = new Class[2];
paramTypes[0] = FileSystemOptions.class;
paramTypes[1] = value.getClass();
Modified: commons/proper/configuration/trunk/src/java/org/apache/commons/configuration/XMLConfiguration.java
URL: http://svn.apache.org/viewvc/commons/proper/configuration/trunk/src/java/org/apache/commons/configuration/XMLConfiguration.java?rev=797282&r1=797281&r2=797282&view=diff
==============================================================================
--- commons/proper/configuration/trunk/src/java/org/apache/commons/configuration/XMLConfiguration.java (original)
+++ commons/proper/configuration/trunk/src/java/org/apache/commons/configuration/XMLConfiguration.java Fri Jul 24 00:39:29 2009
@@ -1310,8 +1310,8 @@
{
if (txtNode == null)
{
- String newValue = isDelimiterParsingDisabled() ? value.toString() :
- PropertyConverter.escapeDelimiters(value.toString(), getListDelimiter());
+ String newValue = isDelimiterParsingDisabled() ? value.toString()
+ : PropertyConverter.escapeDelimiters(value.toString(), getListDelimiter());
txtNode = document.createTextNode(newValue);
if (((Element) getReference()).getFirstChild() != null)
{
@@ -1325,8 +1325,8 @@
}
else
{
- String newValue = isDelimiterParsingDisabled() ? value.toString() :
- PropertyConverter.escapeDelimiters(value.toString(), getListDelimiter());
+ String newValue = isDelimiterParsingDisabled() ? value.toString()
+ : PropertyConverter.escapeDelimiters(value.toString(), getListDelimiter());
txtNode.setNodeValue(newValue);
}
}
@@ -1503,8 +1503,8 @@
{
buf.append(delimiter);
}
- String value = isAttributeSplittingDisabled ? attr.getValue().toString() :
- PropertyConverter.escapeDelimiters(attr.getValue().toString(),
+ String value = isAttributeSplittingDisabled ? attr.getValue().toString()
+ : PropertyConverter.escapeDelimiters(attr.getValue().toString(),
delimiter);
buf.append(value);
}
Modified: commons/proper/configuration/trunk/src/java/org/apache/commons/configuration/plist/PropertyListConfiguration.java
URL: http://svn.apache.org/viewvc/commons/proper/configuration/trunk/src/java/org/apache/commons/configuration/plist/PropertyListConfiguration.java?rev=797282&r1=797281&r2=797282&view=diff
==============================================================================
--- commons/proper/configuration/trunk/src/java/org/apache/commons/configuration/plist/PropertyListConfiguration.java (original)
+++ commons/proper/configuration/trunk/src/java/org/apache/commons/configuration/plist/PropertyListConfiguration.java Fri Jul 24 00:39:29 2009
@@ -297,7 +297,7 @@
{
out.println();
out.print(padding + "{ };");
-
+
// line feed if the dictionary is not in an array
if (node.getParentNode() != null)
{