You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@synapse.apache.org by ra...@apache.org on 2010/09/23 08:04:34 UTC

svn commit: r1000332 [4/27] - in /synapse/branches/commons-vfs-2-synapse-2.0: ./ core/ core/src/ core/src/main/ core/src/main/java/ core/src/main/java/org/ core/src/main/java/org/apache/ core/src/main/java/org/apache/commons/ core/src/main/java/org/apa...

Added: synapse/branches/commons-vfs-2-synapse-2.0/core/src/main/java/org/apache/commons/vfs/Selectors.java
URL: http://svn.apache.org/viewvc/synapse/branches/commons-vfs-2-synapse-2.0/core/src/main/java/org/apache/commons/vfs/Selectors.java?rev=1000332&view=auto
==============================================================================
--- synapse/branches/commons-vfs-2-synapse-2.0/core/src/main/java/org/apache/commons/vfs/Selectors.java (added)
+++ synapse/branches/commons-vfs-2-synapse-2.0/core/src/main/java/org/apache/commons/vfs/Selectors.java Thu Sep 23 06:04:21 2010
@@ -0,0 +1,72 @@
+/*
+ * 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.
+ */
+package org.apache.commons.vfs;
+
+/**
+ * Several standard file selectors.
+ *
+ * @author <a href="mailto:adammurdoch@apache.org">Adam Murdoch</a>
+ * @version $Revision: 764356 $ $Date: 2009-04-13 09:36:01 +0530 (Mon, 13 Apr 2009) $
+ */
+public final class Selectors
+{
+    /**
+     * A {@link FileSelector} that selects only the base file/folder.
+     */
+    public static final FileSelector SELECT_SELF = new FileDepthSelector(0, 0);
+
+    /**
+     * A {@link FileSelector} that selects the base file/folder and its
+     * direct children.
+     */
+    public static final FileSelector SELECT_SELF_AND_CHILDREN = new FileDepthSelector(0, 1);
+
+    /**
+     * A {@link FileSelector} that selects only the direct children
+     * of the base folder.
+     */
+    public static final FileSelector SELECT_CHILDREN = new FileDepthSelector(1, 1);
+
+    /**
+     * A {@link FileSelector} that selects all the descendents of the
+     * base folder, but does not select the base folder itself.
+     */
+    public static final FileSelector EXCLUDE_SELF = new FileDepthSelector(1, Integer.MAX_VALUE);
+
+    /**
+     * A {@link FileSelector} that only files (not folders).
+     */
+    public static final FileSelector SELECT_FILES = new FileTypeSelector(FileType.FILE);
+
+    /**
+     * A {@link FileSelector} that only folders (not files).
+     */
+    public static final FileSelector SELECT_FOLDERS = new FileTypeSelector(FileType.FOLDER);
+
+    /**
+     * A {@link FileSelector} that selects the base file/folder, plus all
+     * its descendents.
+     */
+    public static final FileSelector SELECT_ALL = new AllFileSelector();
+
+    /**
+     * Prevent the class from being instantiated.
+     */
+    private Selectors()
+    {
+    }
+}

Added: synapse/branches/commons-vfs-2-synapse-2.0/core/src/main/java/org/apache/commons/vfs/UserAuthenticationData.java
URL: http://svn.apache.org/viewvc/synapse/branches/commons-vfs-2-synapse-2.0/core/src/main/java/org/apache/commons/vfs/UserAuthenticationData.java?rev=1000332&view=auto
==============================================================================
--- synapse/branches/commons-vfs-2-synapse-2.0/core/src/main/java/org/apache/commons/vfs/UserAuthenticationData.java (added)
+++ synapse/branches/commons-vfs-2-synapse-2.0/core/src/main/java/org/apache/commons/vfs/UserAuthenticationData.java Thu Sep 23 06:04:21 2010
@@ -0,0 +1,140 @@
+/*
+ * 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.
+ */
+package org.apache.commons.vfs;
+
+import java.util.Map;
+import java.util.TreeMap;
+import java.util.Iterator;
+
+/**
+ * Container for various authentication data.
+ * @author <a href="http://commons.apache.org/vfs/team-list.html">Commons VFS team</a>
+ */
+public class UserAuthenticationData
+{
+    /**
+     * Inner class to represent portions of the user authentication data.
+     */
+    public static class Type implements Comparable
+    {
+        /** The type name */
+        private final String type;
+
+        public Type(String type)
+        {
+            this.type = type;
+        }
+
+        public boolean equals(Object o)
+        {
+            if (this == o)
+            {
+                return true;
+            }
+            if (o == null || getClass() != o.getClass())
+            {
+                return false;
+            }
+
+            Type type1 = (Type) o;
+
+            if (type != null ? !type.equals(type1.type) : type1.type != null)
+            {
+                return false;
+            }
+
+            return true;
+        }
+
+        public int compareTo(Object o)
+        {
+            Type t = (Type) o;
+
+            return type.compareTo(t.type);
+        }
+
+        public int hashCode()
+        {
+            return type != null ? type.hashCode() : 0;
+        }
+
+        public String toString()
+        {
+            return type;
+        }
+    }
+
+    /** The user name. */
+    public static final Type USERNAME = new Type("username");
+
+    /** The password. */
+    public static final Type PASSWORD = new Type("password");
+
+    /** The user's domain. */
+    public static final Type DOMAIN = new Type("domain");
+
+    /** The authentication data. */
+    private Map authenticationData = new TreeMap();
+
+    public UserAuthenticationData()
+    {
+    }
+
+    /**
+     * set a data to this collection.
+     * @param type The Type to add
+     * @param data The data associated with the Type
+     */
+    public void setData(Type type, char[] data)
+    {
+        authenticationData.put(type, data);
+    }
+
+    /**
+     * get a data from the collection.
+     * @param type The Type to retrieve.
+     * @return a character array containing the data associated with the type.
+     */
+    public char[] getData(Type type)
+    {
+        return (char[]) authenticationData.get(type);
+    }
+
+    /**
+     * deleted all data stored within this authenticator.
+     */
+    public void cleanup()
+    {
+        // step 1: nullify character buffers
+        Iterator iterAuthenticationData = authenticationData.values().iterator();
+        while (iterAuthenticationData.hasNext())
+        {
+            char[] data = (char[]) iterAuthenticationData.next();
+            if (data == null || data.length < 0)
+            {
+                continue;
+            }
+
+            for (int i = 0; i < data.length; i++)
+            {
+                data[i] = 0;
+            }
+        }
+        // step 2: allow data itself to gc
+        authenticationData.clear();
+    }
+}

Added: synapse/branches/commons-vfs-2-synapse-2.0/core/src/main/java/org/apache/commons/vfs/UserAuthenticator.java
URL: http://svn.apache.org/viewvc/synapse/branches/commons-vfs-2-synapse-2.0/core/src/main/java/org/apache/commons/vfs/UserAuthenticator.java?rev=1000332&view=auto
==============================================================================
--- synapse/branches/commons-vfs-2-synapse-2.0/core/src/main/java/org/apache/commons/vfs/UserAuthenticator.java (added)
+++ synapse/branches/commons-vfs-2-synapse-2.0/core/src/main/java/org/apache/commons/vfs/UserAuthenticator.java Thu Sep 23 06:04:21 2010
@@ -0,0 +1,33 @@
+/*
+ * 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.
+ */
+package org.apache.commons.vfs;
+
+/**
+ * The user authenticator is used to query credentials from the user. Since a UserAuthenticator
+ * is provided with the {@link FileSystemOptions} to a {@link FileSystem} it should also implement
+ * reasonable equals and hashCode functions if the FileSystem should be shared.
+ * @author <a href="http://commons.apache.org/vfs/team-list.html">Commons VFS team</a>
+ */
+public interface UserAuthenticator
+{
+    /**
+     * Queries the given type from the user.
+     * @param types An array containing the user's credentials
+     * @return The UserAuthenticationData.
+     */
+    UserAuthenticationData requestAuthentication(UserAuthenticationData.Type[] types);
+}

Added: synapse/branches/commons-vfs-2-synapse-2.0/core/src/main/java/org/apache/commons/vfs/VFS.java
URL: http://svn.apache.org/viewvc/synapse/branches/commons-vfs-2-synapse-2.0/core/src/main/java/org/apache/commons/vfs/VFS.java?rev=1000332&view=auto
==============================================================================
--- synapse/branches/commons-vfs-2-synapse-2.0/core/src/main/java/org/apache/commons/vfs/VFS.java (added)
+++ synapse/branches/commons-vfs-2-synapse-2.0/core/src/main/java/org/apache/commons/vfs/VFS.java Thu Sep 23 06:04:21 2010
@@ -0,0 +1,129 @@
+/*
+ * 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.
+ */
+package org.apache.commons.vfs;
+
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+
+/**
+ * The main entry point for the VFS.  Used to create {@link FileSystemManager}
+ * instances.
+ *
+ * @author <a href="mailto:adammurdoch@apache.org">Adam Murdoch</a>
+ * @version $Revision: 804548 $ $Date: 2009-08-16 07:42:32 +0530 (Sun, 16 Aug 2009) $
+ */
+public final class VFS
+{
+    /** The URI style */
+    private static Boolean uriStyle;
+
+    /** The FileSystemManager */
+    private static FileSystemManager instance;
+
+    private VFS()
+    {
+    }
+
+    /**
+     * Returns the default {@link FileSystemManager} instance.
+     * @return The FileSystemManager.
+     * @throws FileSystemException if an error occurs creating the manager.
+     */
+    public static synchronized FileSystemManager getManager()
+        throws FileSystemException
+    {
+        if (instance == null)
+        {
+            instance = createManager("org.apache.commons.vfs.impl.StandardFileSystemManager");
+        }
+        return instance;
+    }
+
+    /**
+     * Creates a file system manager instance.
+     * @param managerClassName The specific manager impelmentation class name.
+     * @return The FileSystemManager.
+     * @throws FileSystemException if an error occurs creating the manager.
+     */
+    private static FileSystemManager createManager(final String managerClassName)
+        throws FileSystemException
+    {
+        try
+        {
+            // Create instance
+            final Class mgrClass = Class.forName(managerClassName);
+            final FileSystemManager mgr = (FileSystemManager) mgrClass.newInstance();
+
+            /*
+            try
+            {
+                // Set the logger
+                final Method setLogMethod = mgrClass.getMethod("setLogger", new Class[]{Log.class});
+                final Log logger = LogFactory.getLog(VFS.class);
+                setLogMethod.invoke(mgr, new Object[]{logger});
+            }
+            catch (final NoSuchMethodException e)
+            {
+                // Ignore; don't set the logger
+            }
+            */
+
+            try
+            {
+                // Initialise
+                final Method initMethod = mgrClass.getMethod("init", (Class[]) null);
+                initMethod.invoke(mgr, (Object[]) null);
+            }
+            catch (final NoSuchMethodException e)
+            {
+                // Ignore; don't initialize
+            }
+
+            return mgr;
+        }
+        catch (final InvocationTargetException e)
+        {
+            throw new FileSystemException("vfs/create-manager.error",
+                managerClassName,
+                e.getTargetException());
+        }
+        catch (final Exception e)
+        {
+            throw new FileSystemException("vfs/create-manager.error",
+                managerClassName,
+                e);
+        }
+    }
+
+    public static boolean isUriStyle()
+    {
+        if (uriStyle == null)
+        {
+            uriStyle = Boolean.FALSE;
+        }
+        return uriStyle.booleanValue();
+    }
+
+    public static void setUriStyle(boolean uriStyle)
+    {
+        if (VFS.uriStyle != null && VFS.uriStyle.booleanValue() != uriStyle)
+        {
+            throw new IllegalStateException("URI STYLE ALREADY SET TO");
+        }
+        VFS.uriStyle = uriStyle ? Boolean.TRUE : Boolean.FALSE;
+    }
+}

Added: synapse/branches/commons-vfs-2-synapse-2.0/core/src/main/java/org/apache/commons/vfs/VfsLog.java
URL: http://svn.apache.org/viewvc/synapse/branches/commons-vfs-2-synapse-2.0/core/src/main/java/org/apache/commons/vfs/VfsLog.java?rev=1000332&view=auto
==============================================================================
--- synapse/branches/commons-vfs-2-synapse-2.0/core/src/main/java/org/apache/commons/vfs/VfsLog.java (added)
+++ synapse/branches/commons-vfs-2-synapse-2.0/core/src/main/java/org/apache/commons/vfs/VfsLog.java Thu Sep 23 06:04:21 2010
@@ -0,0 +1,220 @@
+/*
+ * 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.
+ */
+package org.apache.commons.vfs;
+
+import org.apache.commons.logging.Log;
+
+/**
+ * This class is to keep the old logging behaviour (for ant-task) and to be able to
+ * correctly use commons-logging.<br>
+ * I hope i could remove it sometimes.
+ *
+ * @author <a href="mailto:imario@apache.org">Mario Ivankovits</a>
+ * @version $Revision: 804548 $ $Date: 2009-08-16 07:42:32 +0530 (Sun, 16 Aug 2009) $
+ */
+public final class VfsLog
+{
+    // static utility class
+    private VfsLog()
+    {
+    }
+
+    /**
+     * warning.
+     * @param vfslog The base component Logger to use.
+     * @param commonslog The class specific Logger
+     * @param message The message to log.
+     * @param t The exception, if any.
+     */
+    public static void warn(Log vfslog, Log commonslog, String message, Throwable t)
+    {
+        if (vfslog != null)
+        {
+            vfslog.warn(message, t);
+        }
+        else if (commonslog != null)
+        {
+            commonslog.warn(message, t);
+        }
+    }
+
+    /**
+     * warning.
+     * @param vfslog The base component Logger to use.
+     * @param commonslog The class specific Logger
+     * @param message The message to log.
+     */
+    public static void warn(Log vfslog, Log commonslog, String message)
+    {
+        if (vfslog != null)
+        {
+            vfslog.warn(message);
+        }
+        else if (commonslog != null)
+        {
+            commonslog.warn(message);
+        }
+    }
+
+    /**
+     * debug.
+     * @param vfslog The base component Logger to use.
+     * @param commonslog The class specific Logger
+     * @param message The message to log.
+     */
+    public static void debug(Log vfslog, Log commonslog, String message)
+    {
+        if (vfslog != null)
+        {
+            vfslog.debug(message);
+        }
+        else if (commonslog != null)
+        {
+            commonslog.debug(message);
+        }
+    }
+
+    /**
+     * debug.
+     * @param vfslog The base component Logger to use.
+     * @param commonslog The class specific Logger
+     * @param message The message to log.
+     * @param t The exception, if any.
+     */
+    public static void debug(Log vfslog, Log commonslog, String message, Throwable t)
+    {
+        if (vfslog != null)
+        {
+            vfslog.debug(message, t);
+        }
+        else if (commonslog != null)
+        {
+            commonslog.debug(message, t);
+        }
+    }
+
+    /**
+     * info.
+     * @param vfslog The base component Logger to use.
+     * @param commonslog The class specific Logger
+     * @param message The message to log.
+     * @param t The exception, if any.
+     */
+    public static void info(Log vfslog, Log commonslog, String message, Throwable t)
+    {
+        if (vfslog != null)
+        {
+            vfslog.info(message, t);
+        }
+        else if (commonslog != null)
+        {
+            commonslog.info(message, t);
+        }
+    }
+
+    /**
+     * info.
+     * @param vfslog The base component Logger to use.
+     * @param commonslog The class specific Logger
+     * @param message The message to log.
+     */
+    public static void info(Log vfslog, Log commonslog, String message)
+    {
+        if (vfslog != null)
+        {
+            vfslog.info(message);
+        }
+        else if (commonslog != null)
+        {
+            commonslog.info(message);
+        }
+    }
+
+    /**
+     * error.
+     * @param vfslog The base component Logger to use.
+     * @param commonslog The class specific Logger
+     * @param message The message to log.
+     * @param t The exception, if any.
+     */
+    public static void error(Log vfslog, Log commonslog, String message, Throwable t)
+    {
+        if (vfslog != null)
+        {
+            vfslog.error(message, t);
+        }
+        else if (commonslog != null)
+        {
+            commonslog.error(message, t);
+        }
+    }
+
+    /**
+     * error.
+     * @param vfslog The base component Logger to use.
+     * @param commonslog The class specific Logger
+     * @param message The message to log.
+     */
+    public static void error(Log vfslog, Log commonslog, String message)
+    {
+        if (vfslog != null)
+        {
+            vfslog.error(message);
+        }
+        else if (commonslog != null)
+        {
+            commonslog.error(message);
+        }
+    }
+
+    /**
+     * fatal.
+     * @param vfslog The base component Logger to use.
+     * @param commonslog The class specific Logger
+     * @param message The message to log.
+     * @param t The exception, if any.
+     */
+    public static void fatal(Log vfslog, Log commonslog, String message, Throwable t)
+    {
+        if (vfslog != null)
+        {
+            vfslog.fatal(message, t);
+        }
+        else if (commonslog != null)
+        {
+            commonslog.fatal(message, t);
+        }
+    }
+
+    /**
+     * fatal.
+     * @param vfslog The base component Logger to use.
+     * @param commonslog The class specific Logger
+     * @param message The message to log.
+     */
+    public static void fatal(Log vfslog, Log commonslog, String message)
+    {
+        if (vfslog != null)
+        {
+            vfslog.fatal(message);
+        }
+        else if (commonslog != null)
+        {
+            commonslog.fatal(message);
+        }
+    }
+}

Added: synapse/branches/commons-vfs-2-synapse-2.0/core/src/main/java/org/apache/commons/vfs/auth/StaticUserAuthenticator.java
URL: http://svn.apache.org/viewvc/synapse/branches/commons-vfs-2-synapse-2.0/core/src/main/java/org/apache/commons/vfs/auth/StaticUserAuthenticator.java?rev=1000332&view=auto
==============================================================================
--- synapse/branches/commons-vfs-2-synapse-2.0/core/src/main/java/org/apache/commons/vfs/auth/StaticUserAuthenticator.java (added)
+++ synapse/branches/commons-vfs-2-synapse-2.0/core/src/main/java/org/apache/commons/vfs/auth/StaticUserAuthenticator.java Thu Sep 23 06:04:21 2010
@@ -0,0 +1,173 @@
+/*
+ * 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.
+ */
+package org.apache.commons.vfs.auth;
+
+import org.apache.commons.vfs.UserAuthenticationData;
+import org.apache.commons.vfs.UserAuthenticator;
+import org.apache.commons.vfs.util.UserAuthenticatorUtils;
+
+/**
+ * Provides always the same credentials data passed in with the constructor.
+ * @author <a href="http://commons.apache.org/vfs/team-list.html">Commons VFS team</a>
+ */
+public class StaticUserAuthenticator implements UserAuthenticator, Comparable
+{
+    /** The user name */
+    private final String username;
+
+    /** The password */
+    private final String password;
+
+    /** The user's domain */
+    private final String domain;
+
+    public StaticUserAuthenticator(String domain, String username, String password)
+    {
+        this.username = username;
+        this.password = password;
+        this.domain = domain;
+    }
+
+    public UserAuthenticationData requestAuthentication(UserAuthenticationData.Type[] types)
+    {
+        UserAuthenticationData data = new UserAuthenticationData();
+        data.setData(UserAuthenticationData.DOMAIN, UserAuthenticatorUtils.toChar(domain));
+        data.setData(UserAuthenticationData.USERNAME, UserAuthenticatorUtils.toChar(username));
+        data.setData(UserAuthenticationData.PASSWORD, UserAuthenticatorUtils.toChar(password));
+        return data;
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    public int hashCode()
+    {
+        final int prime = 37;
+        int result = 1;
+        result = prime * result + ((domain == null) ? 0 : domain.hashCode());
+        result = prime * result + ((password == null) ? 0 : password.hashCode());
+        result = prime * result + ((username == null) ? 0 : username.hashCode());
+
+        return result;
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    public boolean equals(Object obj)
+    {
+        if (this == obj)
+        {
+            return true;
+        }
+
+        if (obj == null)
+        {
+            return false;
+        }
+
+        if (getClass() != obj.getClass())
+        {
+            return false;
+        }
+
+        StaticUserAuthenticator other = (StaticUserAuthenticator) obj;
+        return equalsNullsafe(domain, other.domain)
+                && equalsNullsafe(username, other.username)
+                && equalsNullsafe(password, other.password);
+    }
+
+    private boolean equalsNullsafe(final String thisString, final String otherString)
+    {
+        if (thisString == null)
+        {
+            if (otherString != null)
+            {
+                return false;
+            }
+        }
+        else if (!thisString.equals(otherString))
+        {
+            return false;
+        }
+        return true;
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    public int compareTo(final Object o)
+    {
+        StaticUserAuthenticator other = (StaticUserAuthenticator) o;
+        int result = compareStringOrNull(domain, other.domain);
+        result = result == 0 ? compareStringOrNull(username, other.username) : result;
+        result = result == 0 ? compareStringOrNull(password, other.password) : result;
+
+        return result;
+    }
+
+    private int compareStringOrNull(final String thisString, final String otherString)
+    {
+        if (thisString == null)
+        {
+            if (otherString != null)
+            {
+                return -1;
+            }
+        }
+        else
+        {
+            if (otherString == null)
+            {
+                return 1;
+            }
+
+            final int result = thisString.compareTo(otherString);
+            if (result != 0)
+            {
+                return result;
+            }
+        }
+
+        return 0;
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    public String toString()
+    {
+        StringBuffer buffer = new StringBuffer();
+        if (domain != null)
+        {
+            buffer.append(domain).append('\\');
+        }
+        if (username != null)
+        {
+            buffer.append(username);
+        }
+        else
+        {
+            buffer.append("(null)");
+        }
+        if (password != null)
+        {
+            buffer.append(":***");
+        }
+        return buffer.toString();
+    }
+}

Added: synapse/branches/commons-vfs-2-synapse-2.0/core/src/main/java/org/apache/commons/vfs/auth/package.html
URL: http://svn.apache.org/viewvc/synapse/branches/commons-vfs-2-synapse-2.0/core/src/main/java/org/apache/commons/vfs/auth/package.html?rev=1000332&view=auto
==============================================================================
--- synapse/branches/commons-vfs-2-synapse-2.0/core/src/main/java/org/apache/commons/vfs/auth/package.html (added)
+++ synapse/branches/commons-vfs-2-synapse-2.0/core/src/main/java/org/apache/commons/vfs/auth/package.html Thu Sep 23 06:04:21 2010
@@ -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>VFS Authentication implementation</p>
+</body>

Added: synapse/branches/commons-vfs-2-synapse-2.0/core/src/main/java/org/apache/commons/vfs/cache/AbstractFilesCache.java
URL: http://svn.apache.org/viewvc/synapse/branches/commons-vfs-2-synapse-2.0/core/src/main/java/org/apache/commons/vfs/cache/AbstractFilesCache.java?rev=1000332&view=auto
==============================================================================
--- synapse/branches/commons-vfs-2-synapse-2.0/core/src/main/java/org/apache/commons/vfs/cache/AbstractFilesCache.java (added)
+++ synapse/branches/commons-vfs-2-synapse-2.0/core/src/main/java/org/apache/commons/vfs/cache/AbstractFilesCache.java Thu Sep 23 06:04:21 2010
@@ -0,0 +1,30 @@
+/*
+ * 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.
+ */
+package org.apache.commons.vfs.cache;
+
+import org.apache.commons.vfs.FilesCache;
+import org.apache.commons.vfs.provider.AbstractVfsComponent;
+
+/**
+ * Description.
+ *
+ * @author <a href="mailto:imario@apache.org">Mario Ivankovits</a>
+ * @version $Revision: 804548 $ $Date: 2009-08-16 07:42:32 +0530 (Sun, 16 Aug 2009) $
+ */
+public abstract class AbstractFilesCache extends AbstractVfsComponent implements FilesCache
+{
+}

Added: synapse/branches/commons-vfs-2-synapse-2.0/core/src/main/java/org/apache/commons/vfs/cache/DefaultFilesCache.java
URL: http://svn.apache.org/viewvc/synapse/branches/commons-vfs-2-synapse-2.0/core/src/main/java/org/apache/commons/vfs/cache/DefaultFilesCache.java?rev=1000332&view=auto
==============================================================================
--- synapse/branches/commons-vfs-2-synapse-2.0/core/src/main/java/org/apache/commons/vfs/cache/DefaultFilesCache.java (added)
+++ synapse/branches/commons-vfs-2-synapse-2.0/core/src/main/java/org/apache/commons/vfs/cache/DefaultFilesCache.java Thu Sep 23 06:04:21 2010
@@ -0,0 +1,86 @@
+/*
+ * 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.
+ */
+package org.apache.commons.vfs.cache;
+
+import org.apache.commons.vfs.FileName;
+import org.apache.commons.vfs.FileObject;
+import org.apache.commons.vfs.FileSystem;
+
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * A {@link org.apache.commons.vfs.FilesCache} implementation.<br>
+ * This implementation caches every file for the complete lifetime of the used
+ * {@link org.apache.commons.vfs.FileSystemManager}.
+ *
+ * @author <a href="mailto:imario@apache.org">Mario Ivankovits</a>
+ * @version $Revision: 764356 $ $Date: 2009-04-13 09:36:01 +0530 (Mon, 13 Apr 2009) $
+ */
+public class DefaultFilesCache extends AbstractFilesCache
+{
+
+    /** The FileSystem cache */
+    private final Map filesystemCache = new HashMap(10);
+
+    public void putFile(final FileObject file)
+    {
+        Map files = getOrCreateFilesystemCache(file.getFileSystem());
+        files.put(file.getName(), file);
+    }
+
+    public FileObject getFile(final FileSystem filesystem, final FileName name)
+    {
+        Map files = getOrCreateFilesystemCache(filesystem);
+        return (FileObject) files.get(name);
+    }
+
+    public void clear(FileSystem filesystem)
+    {
+        Map files = getOrCreateFilesystemCache(filesystem);
+        files.clear();
+    }
+
+    protected Map getOrCreateFilesystemCache(FileSystem filesystem)
+    {
+        Map files = (Map) filesystemCache.get(filesystem);
+        if (files == null)
+        {
+            files = new HashMap();
+            filesystemCache.put(filesystem, files);
+        }
+
+        return files;
+    }
+
+    public void close()
+    {
+        super.close();
+
+        filesystemCache.clear();
+    }
+
+    public void removeFile(FileSystem filesystem, FileName name)
+    {
+        Map files = getOrCreateFilesystemCache(filesystem);
+        files.remove(name);
+    }
+
+    public void touchFile(FileObject file)
+    {
+    }
+}

Added: synapse/branches/commons-vfs-2-synapse-2.0/core/src/main/java/org/apache/commons/vfs/cache/FileSystemAndNameKey.java
URL: http://svn.apache.org/viewvc/synapse/branches/commons-vfs-2-synapse-2.0/core/src/main/java/org/apache/commons/vfs/cache/FileSystemAndNameKey.java?rev=1000332&view=auto
==============================================================================
--- synapse/branches/commons-vfs-2-synapse-2.0/core/src/main/java/org/apache/commons/vfs/cache/FileSystemAndNameKey.java (added)
+++ synapse/branches/commons-vfs-2-synapse-2.0/core/src/main/java/org/apache/commons/vfs/cache/FileSystemAndNameKey.java Thu Sep 23 06:04:21 2010
@@ -0,0 +1,73 @@
+/*
+ * 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.
+ */
+package org.apache.commons.vfs.cache;
+
+import org.apache.commons.vfs.FileName;
+import org.apache.commons.vfs.FileSystem;
+
+/**
+ * Key for various cache implementations.<br>
+ * It compares the fileSystem (by hashCode) and the filename.
+ *
+ * @author <a href="mailto:imario@apache.org">Mario Ivankovits</a>
+ * @version $Revision: 764356 $ $Date: 2009-04-13 09:36:01 +0530 (Mon, 13 Apr 2009) $
+ */
+class FileSystemAndNameKey implements Comparable
+{
+    /** The FileSystem */
+    private final FileSystem fileSystem;
+
+    /** The FileName */
+    private final FileName fileName;
+
+    /** hashcode to identify this object */
+    private final int fileSystemId;
+
+    FileSystemAndNameKey(final FileSystem fileSystem, final FileName fileName)
+    {
+        this.fileSystem = fileSystem;
+        this.fileSystemId = System.identityHashCode(fileSystem);
+
+        this.fileName = fileName;
+    }
+
+    public int compareTo(Object o)
+    {
+        FileSystemAndNameKey other = (FileSystemAndNameKey) o;
+
+        if (fileSystemId < other.fileSystemId)
+        {
+            return -1;
+        }
+        if (fileSystemId > other.fileSystemId)
+        {
+            return 1;
+        }
+
+        return fileName.compareTo(other.fileName);
+    }
+
+    FileSystem getFileSystem()
+    {
+        return fileSystem;
+    }
+
+    FileName getFileName()
+    {
+        return fileName;
+    }
+}

Added: synapse/branches/commons-vfs-2-synapse-2.0/core/src/main/java/org/apache/commons/vfs/cache/LRUFilesCache.java
URL: http://svn.apache.org/viewvc/synapse/branches/commons-vfs-2-synapse-2.0/core/src/main/java/org/apache/commons/vfs/cache/LRUFilesCache.java?rev=1000332&view=auto
==============================================================================
--- synapse/branches/commons-vfs-2-synapse-2.0/core/src/main/java/org/apache/commons/vfs/cache/LRUFilesCache.java (added)
+++ synapse/branches/commons-vfs-2-synapse-2.0/core/src/main/java/org/apache/commons/vfs/cache/LRUFilesCache.java Thu Sep 23 06:04:21 2010
@@ -0,0 +1,217 @@
+/*
+ * 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.
+ */
+package org.apache.commons.vfs.cache;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import org.apache.commons.collections.map.AbstractLinkedMap;
+import org.apache.commons.collections.map.LRUMap;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.commons.vfs.FileName;
+import org.apache.commons.vfs.FileObject;
+import org.apache.commons.vfs.FileSystem;
+import org.apache.commons.vfs.FileSystemException;
+import org.apache.commons.vfs.VfsLog;
+import org.apache.commons.vfs.util.Messages;
+
+/**
+ * This implementation caches every file using {@link LRUMap}.<br>
+ * The default constructor uses a LRU size of 100 per filesystem.
+ *
+ * @author <a href="mailto:imario@apache.org">Mario Ivankovits</a>
+ * @version $Revision: 764356 $ $Date: 2009-04-13 09:36:01 +0530 (Mon, 13 Apr 2009) $
+ */
+public class LRUFilesCache extends AbstractFilesCache
+{
+    /** The default LRU size */
+    private static final int DEFAULT_LRU_SIZE = 100;
+    /**
+     * The logger to use.
+     */
+    private Log log = LogFactory.getLog(LRUFilesCache.class);
+
+    /** The FileSystem cache */
+    private final Map filesystemCache = new HashMap(10);
+
+    /** The size of the cache */
+    private final int lruSize;
+
+    /**
+     * The file cache
+     */
+    private class MyLRUMap extends LRUMap
+    {
+        /** The FileSystem */
+        private final FileSystem filesystem;
+
+        public MyLRUMap(final FileSystem filesystem, int size)
+        {
+            super(size, true);
+            this.filesystem = filesystem;
+        }
+
+        protected boolean removeLRU(final AbstractLinkedMap.LinkEntry linkEntry)
+        {
+            synchronized (LRUFilesCache.this)
+            {
+                FileObject file = (FileObject) linkEntry.getValue();
+
+                // System.err.println(">>> " + size() + " check removeLRU:" + linkEntry.getKey().toString());
+
+                if (file.isAttached() || file.isContentOpen())
+                {
+                    // do not allow open or attached files to be removed
+                    // System.err.println(">>> " + size() + " VETO removeLRU:" +
+                    //    linkEntry.getKey().toString() + " (" + file.isAttached() + "/" +
+                    //    file.isContentOpen() + ")");
+                    return false;
+                }
+
+                // System.err.println(">>> " + size() + " removeLRU:" + linkEntry.getKey().toString());
+                if (super.removeLRU(linkEntry))
+                {
+                    try
+                    {
+                        // force detach
+                        file.close();
+                    }
+                    catch (FileSystemException e)
+                    {
+                        VfsLog.warn(getLogger(), log, Messages.getString("vfs.impl/LRUFilesCache-remove-ex.warn"), e);
+                    }
+
+                    Map files = (Map) filesystemCache.get(filesystem);
+                    if (files.size() < 1)
+                    {
+                        filesystemCache.remove(filesystem);
+                    }
+
+                    return true;
+                }
+
+                return false;
+            }
+        }
+    }
+
+    /**
+     * Default constructor. Uses a LRU size of 100 per filesystem.
+     */
+    public LRUFilesCache()
+    {
+        this(DEFAULT_LRU_SIZE);
+    }
+
+    /**
+     * Set the desired LRU size.
+     *
+     * @param lruSize the LRU size
+     */
+    public LRUFilesCache(int lruSize)
+    {
+        this.lruSize = lruSize;
+    }
+
+    public void putFile(final FileObject file)
+    {
+        synchronized (this)
+        {
+            Map files = getOrCreateFilesystemCache(file.getFileSystem());
+
+            // System.err.println(">>> " + files.size() + " put:" + file.toString());
+
+            files.put(file.getName(), file);
+        }
+    }
+
+    public FileObject getFile(final FileSystem filesystem, final FileName name)
+    {
+        synchronized (this)
+        {
+            Map files = getOrCreateFilesystemCache(filesystem);
+
+            // FileObject fo = (FileObject) files.get(name);
+            // System.err.println(">>> " + files.size() + " get:" + name.toString() + " " + fo);
+
+            return (FileObject) files.get(name);
+        }
+    }
+
+    public void clear(final FileSystem filesystem)
+    {
+        synchronized (this)
+        {
+            // System.err.println(">>> clear fs " + filesystem);
+
+            Map files = getOrCreateFilesystemCache(filesystem);
+            files.clear();
+
+            filesystemCache.remove(filesystem);
+        }
+    }
+
+    protected Map getOrCreateFilesystemCache(final FileSystem filesystem)
+    {
+        Map files = (Map) filesystemCache.get(filesystem);
+        if (files == null)
+        {
+            // System.err.println(">>> create fs " + filesystem);
+
+            files = new MyLRUMap(filesystem, lruSize);
+            filesystemCache.put(filesystem, files);
+        }
+
+        return files;
+    }
+
+    public void close()
+    {
+        super.close();
+
+        synchronized (this)
+        {
+            // System.err.println(">>> clear all");
+
+            filesystemCache.clear();
+        }
+    }
+
+    public void removeFile(final FileSystem filesystem, final FileName name)
+    {
+        synchronized (this)
+        {
+            Map files = getOrCreateFilesystemCache(filesystem);
+
+            // System.err.println(">>> " + files.size() + " remove:" + name.toString());
+
+            files.remove(name);
+
+            if (files.size() < 1)
+            {
+                filesystemCache.remove(filesystem);
+            }
+        }
+    }
+
+    public void touchFile(final FileObject file)
+    {
+        // this moves the file back on top
+        getFile(file.getFileSystem(), file.getName());
+    }
+}

Added: synapse/branches/commons-vfs-2-synapse-2.0/core/src/main/java/org/apache/commons/vfs/cache/NullFilesCache.java
URL: http://svn.apache.org/viewvc/synapse/branches/commons-vfs-2-synapse-2.0/core/src/main/java/org/apache/commons/vfs/cache/NullFilesCache.java?rev=1000332&view=auto
==============================================================================
--- synapse/branches/commons-vfs-2-synapse-2.0/core/src/main/java/org/apache/commons/vfs/cache/NullFilesCache.java (added)
+++ synapse/branches/commons-vfs-2-synapse-2.0/core/src/main/java/org/apache/commons/vfs/cache/NullFilesCache.java Thu Sep 23 06:04:21 2010
@@ -0,0 +1,64 @@
+/*
+ * 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.
+ */
+package org.apache.commons.vfs.cache;
+
+import org.apache.commons.vfs.FileName;
+import org.apache.commons.vfs.FileObject;
+import org.apache.commons.vfs.FileSystem;
+
+/**
+ * <p>
+ * A {@link org.apache.commons.vfs.FilesCache} implementation.<br>
+ * This implementation never ever caches a single file.
+ * </p>
+ * <p>
+ * <b>Notice: if you use resolveFile(uri) multiple times with the same path, the system will always
+ * create a new instance.
+ * Changes on one instance of this file are not seen by the others.</b>
+ * </p>
+ *
+ * @author <a href="mailto:imario@apache.org">Mario Ivankovits</a>
+ * @version $Revision: 804548 $ $Date: 2009-08-16 07:42:32 +0530 (Sun, 16 Aug 2009) $
+ */
+public class NullFilesCache extends AbstractFilesCache
+{
+    public void putFile(final FileObject file)
+    {
+    }
+
+    public FileObject getFile(final FileSystem filesystem, final FileName name)
+    {
+        return null;
+    }
+
+    public void clear(FileSystem filesystem)
+    {
+    }
+
+    public void close()
+    {
+        super.close();
+    }
+
+    public void removeFile(FileSystem filesystem, FileName name)
+    {
+    }
+
+    public void touchFile(FileObject file)
+    {
+    }
+}

Added: synapse/branches/commons-vfs-2-synapse-2.0/core/src/main/java/org/apache/commons/vfs/cache/OnCallRefreshFileObject.java
URL: http://svn.apache.org/viewvc/synapse/branches/commons-vfs-2-synapse-2.0/core/src/main/java/org/apache/commons/vfs/cache/OnCallRefreshFileObject.java?rev=1000332&view=auto
==============================================================================
--- synapse/branches/commons-vfs-2-synapse-2.0/core/src/main/java/org/apache/commons/vfs/cache/OnCallRefreshFileObject.java (added)
+++ synapse/branches/commons-vfs-2-synapse-2.0/core/src/main/java/org/apache/commons/vfs/cache/OnCallRefreshFileObject.java Thu Sep 23 06:04:21 2010
@@ -0,0 +1,155 @@
+/*
+ * 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.
+ */
+package org.apache.commons.vfs.cache;
+
+import java.util.List;
+
+import org.apache.commons.vfs.FileContent;
+import org.apache.commons.vfs.FileObject;
+import org.apache.commons.vfs.FileSelector;
+import org.apache.commons.vfs.FileSystemException;
+import org.apache.commons.vfs.FileType;
+import org.apache.commons.vfs.NameScope;
+import org.apache.commons.vfs.impl.DecoratedFileObject;
+
+/**
+ * This decorator refreshes the fileObject data on every call.
+ *
+ * @author <a href="mailto:imario@apache.org">Mario Ivankovits</a>
+ * @version $Revision: 804548 $ $Date: 2009-08-16 07:42:32 +0530 (Sun, 16 Aug 2009) $
+ */
+public class OnCallRefreshFileObject extends DecoratedFileObject
+{
+    public OnCallRefreshFileObject(FileObject fileObject)
+    {
+        super(fileObject);
+    }
+
+    public void close() throws FileSystemException
+    {
+        refresh();
+        super.close();
+    }
+
+    public void copyFrom(FileObject srcFile, FileSelector selector) throws FileSystemException
+    {
+        refresh();
+        super.copyFrom(srcFile, selector);
+    }
+
+    public void createFile() throws FileSystemException
+    {
+        refresh();
+        super.createFile();
+    }
+
+    public void createFolder() throws FileSystemException
+    {
+        refresh();
+        super.createFolder();
+    }
+
+    public boolean delete() throws FileSystemException
+    {
+        refresh();
+        return super.delete();
+    }
+
+    public int delete(FileSelector selector) throws FileSystemException
+    {
+        refresh();
+        return super.delete(selector);
+    }
+
+    public boolean exists() throws FileSystemException
+    {
+        refresh();
+        return super.exists();
+    }
+
+    public void findFiles(FileSelector selector, boolean depthwise, List selected) throws FileSystemException
+    {
+        refresh();
+        super.findFiles(selector, depthwise, selected);
+    }
+
+    public FileObject[] findFiles(FileSelector selector) throws FileSystemException
+    {
+        refresh();
+        return super.findFiles(selector);
+    }
+
+    public FileObject getChild(String name) throws FileSystemException
+    {
+        refresh();
+        return super.getChild(name);
+    }
+
+    public FileObject[] getChildren() throws FileSystemException
+    {
+        refresh();
+        return super.getChildren();
+    }
+
+    public FileContent getContent() throws FileSystemException
+    {
+        refresh();
+        return super.getContent();
+    }
+
+    public FileType getType() throws FileSystemException
+    {
+        refresh();
+        return super.getType();
+    }
+
+    public boolean isHidden() throws FileSystemException
+    {
+        refresh();
+        return super.isHidden();
+    }
+
+    public boolean isReadable() throws FileSystemException
+    {
+        refresh();
+        return super.isReadable();
+    }
+
+    public boolean isWriteable() throws FileSystemException
+    {
+        refresh();
+        return super.isWriteable();
+    }
+
+    public void moveTo(FileObject destFile) throws FileSystemException
+    {
+        refresh();
+        super.moveTo(destFile);
+    }
+
+    public FileObject resolveFile(String name, NameScope scope) throws FileSystemException
+    {
+        refresh();
+        return super.resolveFile(name, scope);
+    }
+
+    public FileObject resolveFile(String path) throws FileSystemException
+    {
+        refresh();
+        return super.resolveFile(path);
+    }
+}

Added: synapse/branches/commons-vfs-2-synapse-2.0/core/src/main/java/org/apache/commons/vfs/cache/SoftRefFilesCache.java
URL: http://svn.apache.org/viewvc/synapse/branches/commons-vfs-2-synapse-2.0/core/src/main/java/org/apache/commons/vfs/cache/SoftRefFilesCache.java?rev=1000332&view=auto
==============================================================================
--- synapse/branches/commons-vfs-2-synapse-2.0/core/src/main/java/org/apache/commons/vfs/cache/SoftRefFilesCache.java (added)
+++ synapse/branches/commons-vfs-2-synapse-2.0/core/src/main/java/org/apache/commons/vfs/cache/SoftRefFilesCache.java Thu Sep 23 06:04:21 2010
@@ -0,0 +1,315 @@
+/*
+ * 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.
+ */
+package org.apache.commons.vfs.cache;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.commons.vfs.FileName;
+import org.apache.commons.vfs.FileObject;
+import org.apache.commons.vfs.FileSystem;
+import org.apache.commons.vfs.VfsLog;
+import org.apache.commons.vfs.impl.DefaultFileSystemManager;
+import org.apache.commons.vfs.util.Messages;
+
+import java.lang.ref.Reference;
+import java.lang.ref.ReferenceQueue;
+import java.lang.ref.SoftReference;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.Map;
+
+/**
+ * This implementation caches every file as long as it is strongly reachable by
+ * the java vm. As soon as the vm needs memory - every softly reachable file
+ * will be discarded.
+ *
+ * @author <a href="mailto:imario@apache.org">Mario Ivankovits</a>
+ * @version $Revision: 764356 $ $Date: 2005-09-30 09:02:41 +0200 (Fr, 30 Sep
+ *          2005) $
+ * @see SoftReference
+ */
+public class SoftRefFilesCache extends AbstractFilesCache
+{
+    private static final int TIMEOUT = 1000;
+    /**
+     * The logger to use.
+     */
+    private Log log = LogFactory.getLog(SoftRefFilesCache.class);
+
+    private final Map filesystemCache = new HashMap();
+    private final Map refReverseMap = new HashMap(100);
+    private final ReferenceQueue refqueue = new ReferenceQueue();
+
+    private SoftRefReleaseThread softRefReleaseThread;
+
+    /**
+     * This thread will listen on the ReferenceQueue and remove the entry in the
+     * filescache as soon as the vm removes the reference
+     */
+    private final class SoftRefReleaseThread extends Thread
+    {
+        private boolean requestEnd;
+
+        private SoftRefReleaseThread()
+        {
+            setName(SoftRefReleaseThread.class.getName());
+            setDaemon(true);
+        }
+
+        public void run()
+        {
+            loop: while (!requestEnd && !Thread.currentThread().isInterrupted())
+            {
+                try
+                {
+                    Reference ref = refqueue.remove(TIMEOUT);
+                    if (ref == null)
+                    {
+                        continue;
+                    }
+
+                    FileSystemAndNameKey key;
+                    synchronized (refReverseMap)
+                    {
+                        key = (FileSystemAndNameKey) refReverseMap.get(ref);
+                    }
+
+                    if (key != null)
+                    {
+                        if (removeFile(key))
+                        {
+                            /* This is not thread safe
+                            filesystemClose(key.getFileSystem());
+                            */
+                        }
+                    }
+                }
+                catch (InterruptedException e)
+                {
+                    if (!requestEnd)
+                    {
+                        VfsLog.warn(getLogger(), log,
+                                    Messages.getString("vfs.impl/SoftRefReleaseThread-interrupt.info"));
+                    }
+                    break loop;
+                }
+            }
+        }
+    }
+
+    public SoftRefFilesCache()
+    {
+    }
+
+    private void startThread()
+    {
+        if (softRefReleaseThread != null)
+        {
+            throw new IllegalStateException(
+                    Messages.getString("vfs.impl/SoftRefReleaseThread-already-running.warn"));
+        }
+
+        softRefReleaseThread = new SoftRefReleaseThread();
+        softRefReleaseThread.start();
+    }
+
+    private void endThread()
+    {
+        if (softRefReleaseThread != null)
+        {
+            softRefReleaseThread.requestEnd = true;
+            softRefReleaseThread.interrupt();
+            softRefReleaseThread = null;
+        }
+    }
+
+    public void putFile(final FileObject file)
+    {
+        if (log.isDebugEnabled())
+        {
+            log.debug("putFile: " + file.getName());
+        }
+
+        Map files = getOrCreateFilesystemCache(file.getFileSystem());
+
+        Reference ref = createReference(file, refqueue);
+        FileSystemAndNameKey key = new FileSystemAndNameKey(file
+                .getFileSystem(), file.getName());
+
+        synchronized (files)
+        {
+            Reference old = (Reference) files.put(file.getName(), ref);
+            synchronized (refReverseMap)
+            {
+                if (old != null)
+                {
+                    refReverseMap.remove(old);
+                }
+                refReverseMap.put(ref, key);
+            }
+        }
+    }
+
+    protected Reference createReference(FileObject file, ReferenceQueue refqueue)
+    {
+        return new SoftReference(file, refqueue);
+    }
+
+    public FileObject getFile(final FileSystem filesystem, final FileName name)
+    {
+        Map files = getOrCreateFilesystemCache(filesystem);
+
+        synchronized (files)
+        {
+            Reference ref = (Reference) files.get(name);
+            if (ref == null)
+            {
+                return null;
+            }
+
+            FileObject fo = (FileObject) ref.get();
+            if (fo == null)
+            {
+                removeFile(filesystem, name);
+            }
+            return fo;
+        }
+    }
+
+    public void clear(FileSystem filesystem)
+    {
+        Map files = getOrCreateFilesystemCache(filesystem);
+
+        boolean closeFilesystem;
+
+        synchronized (files)
+        {
+            synchronized (refReverseMap)
+            {
+                Iterator iterKeys = refReverseMap.values().iterator();
+                while (iterKeys.hasNext())
+                {
+                    FileSystemAndNameKey key = (FileSystemAndNameKey) iterKeys.next();
+                    if (key.getFileSystem() == filesystem)
+                    {
+                        iterKeys.remove();
+                        files.remove(key.getFileName());
+                    }
+                }
+
+                closeFilesystem = files.size() < 1;
+            }
+        }
+
+        if (closeFilesystem)
+        {
+            filesystemClose(filesystem);
+        }
+    }
+
+    private void filesystemClose(FileSystem filesystem)
+    {
+        if (log.isDebugEnabled())
+        {
+            log.debug("close fs: " + filesystem.getRootName());
+        }
+        synchronized (filesystemCache)
+        {
+            filesystemCache.remove(filesystem);
+            if (filesystemCache.size() < 1)
+            {
+                endThread();
+            }
+        }
+        ((DefaultFileSystemManager) getContext().getFileSystemManager())
+                ._closeFileSystem(filesystem);
+    }
+
+    public void close()
+    {
+        super.close();
+
+        endThread();
+
+        // files.clear();
+        synchronized (filesystemCache)
+        {
+            filesystemCache.clear();
+        }
+
+        synchronized (refReverseMap)
+        {
+            refReverseMap.clear();
+        }
+    }
+
+    public void removeFile(FileSystem filesystem, FileName name)
+    {
+        if (removeFile(new FileSystemAndNameKey(filesystem, name)))
+        {
+            filesystemClose(filesystem);
+        }
+    }
+
+    public void touchFile(FileObject file)
+    {
+    }
+
+    private boolean removeFile(final FileSystemAndNameKey key)
+    {
+        if (log.isDebugEnabled())
+        {
+            log.debug("removeFile: " + key.getFileName());
+        }
+
+        Map files = getOrCreateFilesystemCache(key.getFileSystem());
+
+        synchronized (files)
+        {
+            Object ref = files.remove(key.getFileName());
+            if (ref != null)
+            {
+                synchronized (refReverseMap)
+                {
+                    refReverseMap.remove(ref);
+                }
+            }
+
+            return files.size() < 1;
+        }
+    }
+
+    protected Map getOrCreateFilesystemCache(final FileSystem filesystem)
+    {
+        synchronized (filesystemCache)
+        {
+            if (filesystemCache.size() < 1)
+            {
+                startThread();
+            }
+
+            Map files = (Map) filesystemCache.get(filesystem);
+            if (files == null)
+            {
+                files = new HashMap();
+                filesystemCache.put(filesystem, files);
+            }
+
+            return files;
+        }
+    }
+}

Added: synapse/branches/commons-vfs-2-synapse-2.0/core/src/main/java/org/apache/commons/vfs/cache/WeakRefFilesCache.java
URL: http://svn.apache.org/viewvc/synapse/branches/commons-vfs-2-synapse-2.0/core/src/main/java/org/apache/commons/vfs/cache/WeakRefFilesCache.java?rev=1000332&view=auto
==============================================================================
--- synapse/branches/commons-vfs-2-synapse-2.0/core/src/main/java/org/apache/commons/vfs/cache/WeakRefFilesCache.java (added)
+++ synapse/branches/commons-vfs-2-synapse-2.0/core/src/main/java/org/apache/commons/vfs/cache/WeakRefFilesCache.java Thu Sep 23 06:04:21 2010
@@ -0,0 +1,42 @@
+/*
+ * 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.
+ */
+package org.apache.commons.vfs.cache;
+
+import org.apache.commons.vfs.FileObject;
+
+import java.lang.ref.Reference;
+import java.lang.ref.ReferenceQueue;
+import java.lang.ref.WeakReference;
+
+/**
+ * This implementation caches every file as long as it is strongly reachable by
+ * the java vm. As soon as the object is no longer reachable it will be discarded.
+ * In contrast to the SoftRefFilesCache this implementation might free resources faster
+ * as it don't wait until a memory limitation.
+ *
+ * @author <a href="mailto:imario@apache.org">Mario Ivankovits</a>
+ * @version $Revision: 764356 $ $Date: 2005-09-30 09:02:41 +0200 (Fr, 30 Sep
+ *          2005) $
+ * @see java.lang.ref.WeakReference
+ */
+public class WeakRefFilesCache extends SoftRefFilesCache
+{
+    protected Reference createReference(FileObject file, ReferenceQueue refqueue)
+    {
+        return new WeakReference(file, refqueue);
+    }
+}

Added: synapse/branches/commons-vfs-2-synapse-2.0/core/src/main/java/org/apache/commons/vfs/cache/package.html
URL: http://svn.apache.org/viewvc/synapse/branches/commons-vfs-2-synapse-2.0/core/src/main/java/org/apache/commons/vfs/cache/package.html?rev=1000332&view=auto
==============================================================================
--- synapse/branches/commons-vfs-2-synapse-2.0/core/src/main/java/org/apache/commons/vfs/cache/package.html (added)
+++ synapse/branches/commons-vfs-2-synapse-2.0/core/src/main/java/org/apache/commons/vfs/cache/package.html Thu Sep 23 06:04:21 2010
@@ -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>VFS File caching</p>
+</body>

Added: synapse/branches/commons-vfs-2-synapse-2.0/core/src/main/java/org/apache/commons/vfs/events/AbstractFileChangeEvent.java
URL: http://svn.apache.org/viewvc/synapse/branches/commons-vfs-2-synapse-2.0/core/src/main/java/org/apache/commons/vfs/events/AbstractFileChangeEvent.java?rev=1000332&view=auto
==============================================================================
--- synapse/branches/commons-vfs-2-synapse-2.0/core/src/main/java/org/apache/commons/vfs/events/AbstractFileChangeEvent.java (added)
+++ synapse/branches/commons-vfs-2-synapse-2.0/core/src/main/java/org/apache/commons/vfs/events/AbstractFileChangeEvent.java Thu Sep 23 06:04:21 2010
@@ -0,0 +1,35 @@
+/*
+ * 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.
+ */
+package org.apache.commons.vfs.events;
+
+import org.apache.commons.vfs.FileChangeEvent;
+import org.apache.commons.vfs.FileListener;
+import org.apache.commons.vfs.FileObject;
+
+/**
+ * A change event that knows how to notify a listener.
+ * @author <a href="http://commons.apache.org/vfs/team-list.html">Commons VFS team</a>
+ */
+public abstract class AbstractFileChangeEvent extends FileChangeEvent
+{
+    public AbstractFileChangeEvent(final FileObject file)
+    {
+        super(file);
+    }
+
+    public abstract void notify(final FileListener listener) throws Exception;
+}

Added: synapse/branches/commons-vfs-2-synapse-2.0/core/src/main/java/org/apache/commons/vfs/events/ChangedEvent.java
URL: http://svn.apache.org/viewvc/synapse/branches/commons-vfs-2-synapse-2.0/core/src/main/java/org/apache/commons/vfs/events/ChangedEvent.java?rev=1000332&view=auto
==============================================================================
--- synapse/branches/commons-vfs-2-synapse-2.0/core/src/main/java/org/apache/commons/vfs/events/ChangedEvent.java (added)
+++ synapse/branches/commons-vfs-2-synapse-2.0/core/src/main/java/org/apache/commons/vfs/events/ChangedEvent.java Thu Sep 23 06:04:21 2010
@@ -0,0 +1,37 @@
+/*
+ * 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.
+ */
+package org.apache.commons.vfs.events;
+
+import org.apache.commons.vfs.FileListener;
+import org.apache.commons.vfs.FileObject;
+
+/**
+ * File changed event.
+ * @author <a href="http://commons.apache.org/vfs/team-list.html">Commons VFS team</a>
+ */
+public class ChangedEvent extends AbstractFileChangeEvent
+{
+    public ChangedEvent(final FileObject file)
+    {
+        super(file);
+    }
+
+    public void notify(final FileListener listener) throws Exception
+    {
+        listener.fileChanged(this);
+    }
+}

Added: synapse/branches/commons-vfs-2-synapse-2.0/core/src/main/java/org/apache/commons/vfs/events/CreateEvent.java
URL: http://svn.apache.org/viewvc/synapse/branches/commons-vfs-2-synapse-2.0/core/src/main/java/org/apache/commons/vfs/events/CreateEvent.java?rev=1000332&view=auto
==============================================================================
--- synapse/branches/commons-vfs-2-synapse-2.0/core/src/main/java/org/apache/commons/vfs/events/CreateEvent.java (added)
+++ synapse/branches/commons-vfs-2-synapse-2.0/core/src/main/java/org/apache/commons/vfs/events/CreateEvent.java Thu Sep 23 06:04:21 2010
@@ -0,0 +1,37 @@
+/*
+ * 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.
+ */
+package org.apache.commons.vfs.events;
+
+import org.apache.commons.vfs.FileListener;
+import org.apache.commons.vfs.FileObject;
+
+/**
+ * File creation event.
+ * @author <a href="http://commons.apache.org/vfs/team-list.html">Commons VFS team</a>
+ */
+public class CreateEvent extends AbstractFileChangeEvent
+{
+    public CreateEvent(final FileObject file)
+    {
+        super(file);
+    }
+
+    public void notify(final FileListener listener) throws Exception
+    {
+        listener.fileCreated(this);
+    }
+}

Added: synapse/branches/commons-vfs-2-synapse-2.0/core/src/main/java/org/apache/commons/vfs/events/DeleteEvent.java
URL: http://svn.apache.org/viewvc/synapse/branches/commons-vfs-2-synapse-2.0/core/src/main/java/org/apache/commons/vfs/events/DeleteEvent.java?rev=1000332&view=auto
==============================================================================
--- synapse/branches/commons-vfs-2-synapse-2.0/core/src/main/java/org/apache/commons/vfs/events/DeleteEvent.java (added)
+++ synapse/branches/commons-vfs-2-synapse-2.0/core/src/main/java/org/apache/commons/vfs/events/DeleteEvent.java Thu Sep 23 06:04:21 2010
@@ -0,0 +1,37 @@
+/*
+ * 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.
+ */
+package org.apache.commons.vfs.events;
+
+import org.apache.commons.vfs.FileListener;
+import org.apache.commons.vfs.FileObject;
+
+/**
+ * File deletion event.
+ * @author <a href="http://commons.apache.org/vfs/team-list.html">Commons VFS team</a>
+ */
+public class DeleteEvent extends AbstractFileChangeEvent
+{
+    public DeleteEvent(final FileObject file)
+    {
+        super(file);
+    }
+
+    public void notify(final FileListener listener) throws Exception
+    {
+        listener.fileDeleted(this);
+    }
+}

Added: synapse/branches/commons-vfs-2-synapse-2.0/core/src/main/java/org/apache/commons/vfs/events/package.html
URL: http://svn.apache.org/viewvc/synapse/branches/commons-vfs-2-synapse-2.0/core/src/main/java/org/apache/commons/vfs/events/package.html?rev=1000332&view=auto
==============================================================================
--- synapse/branches/commons-vfs-2-synapse-2.0/core/src/main/java/org/apache/commons/vfs/events/package.html (added)
+++ synapse/branches/commons-vfs-2-synapse-2.0/core/src/main/java/org/apache/commons/vfs/events/package.html Thu Sep 23 06:04:21 2010
@@ -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>VFS Events</p>
+</body>

Added: synapse/branches/commons-vfs-2-synapse-2.0/core/src/main/java/org/apache/commons/vfs/impl/DecoratedFileObject.java
URL: http://svn.apache.org/viewvc/synapse/branches/commons-vfs-2-synapse-2.0/core/src/main/java/org/apache/commons/vfs/impl/DecoratedFileObject.java?rev=1000332&view=auto
==============================================================================
--- synapse/branches/commons-vfs-2-synapse-2.0/core/src/main/java/org/apache/commons/vfs/impl/DecoratedFileObject.java (added)
+++ synapse/branches/commons-vfs-2-synapse-2.0/core/src/main/java/org/apache/commons/vfs/impl/DecoratedFileObject.java Thu Sep 23 06:04:21 2010
@@ -0,0 +1,197 @@
+/*
+ * 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.
+ */
+package org.apache.commons.vfs.impl;
+
+import java.net.URL;
+import java.util.List;
+
+import org.apache.commons.vfs.FileContent;
+import org.apache.commons.vfs.FileName;
+import org.apache.commons.vfs.FileObject;
+import org.apache.commons.vfs.FileSelector;
+import org.apache.commons.vfs.FileSystem;
+import org.apache.commons.vfs.FileSystemException;
+import org.apache.commons.vfs.FileType;
+import org.apache.commons.vfs.NameScope;
+import org.apache.commons.vfs.operations.FileOperations;
+
+/**
+ * Base class to build a fileObject decoration.
+ *
+ * @author <a href="mailto:imario@apache.org">Mario Ivankovits</a>
+ * @version $Revision: 804548 $ $Date: 2009-08-16 07:42:32 +0530 (Sun, 16 Aug 2009) $
+ */
+public class DecoratedFileObject implements FileObject
+{
+    private final FileObject decoratedFileObject;
+
+    public DecoratedFileObject(FileObject decoratedFileObject)
+    {
+        super();
+        this.decoratedFileObject = decoratedFileObject;
+    }
+
+    public boolean canRenameTo(FileObject newfile)
+    {
+        return decoratedFileObject.canRenameTo(newfile);
+    }
+
+    public void close() throws FileSystemException
+    {
+        decoratedFileObject.close();
+    }
+
+    public void copyFrom(FileObject srcFile, FileSelector selector) throws FileSystemException
+    {
+        decoratedFileObject.copyFrom(srcFile, selector);
+    }
+
+    public void createFile() throws FileSystemException
+    {
+        decoratedFileObject.createFile();
+    }
+
+    public void createFolder() throws FileSystemException
+    {
+        decoratedFileObject.createFolder();
+    }
+
+    public boolean delete() throws FileSystemException
+    {
+        return decoratedFileObject.delete();
+    }
+
+    public int delete(FileSelector selector) throws FileSystemException
+    {
+        return decoratedFileObject.delete(selector);
+    }
+
+    public boolean exists() throws FileSystemException
+    {
+        return decoratedFileObject.exists();
+    }
+
+    public void findFiles(FileSelector selector, boolean depthwise, List selected) throws FileSystemException
+    {
+        decoratedFileObject.findFiles(selector, depthwise, selected);
+    }
+
+    public FileObject[] findFiles(FileSelector selector) throws FileSystemException
+    {
+        return decoratedFileObject.findFiles(selector);
+    }
+
+    public FileObject getChild(String name) throws FileSystemException
+    {
+        return decoratedFileObject.getChild(name);
+    }
+
+    public FileObject[] getChildren() throws FileSystemException
+    {
+        return decoratedFileObject.getChildren();
+    }
+
+    public FileContent getContent() throws FileSystemException
+    {
+        return decoratedFileObject.getContent();
+    }
+
+    public FileSystem getFileSystem()
+    {
+        return decoratedFileObject.getFileSystem();
+    }
+
+    public FileName getName()
+    {
+        return decoratedFileObject.getName();
+    }
+
+    public FileObject getParent() throws FileSystemException
+    {
+        return decoratedFileObject.getParent();
+    }
+
+    public FileType getType() throws FileSystemException
+    {
+        return decoratedFileObject.getType();
+    }
+
+    public URL getURL() throws FileSystemException
+    {
+        return decoratedFileObject.getURL();
+    }
+
+    public boolean isHidden() throws FileSystemException
+    {
+        return decoratedFileObject.isHidden();
+    }
+
+    public boolean isReadable() throws FileSystemException
+    {
+        return decoratedFileObject.isReadable();
+    }
+
+    public boolean isWriteable() throws FileSystemException
+    {
+        return decoratedFileObject.isWriteable();
+    }
+
+    public void moveTo(FileObject destFile) throws FileSystemException
+    {
+        decoratedFileObject.moveTo(destFile);
+    }
+
+    public FileObject resolveFile(String name, NameScope scope) throws FileSystemException
+    {
+        return decoratedFileObject.resolveFile(name, scope);
+    }
+
+    public FileObject resolveFile(String path) throws FileSystemException
+    {
+        return decoratedFileObject.resolveFile(path);
+    }
+
+    public void refresh() throws FileSystemException
+    {
+        decoratedFileObject.refresh();
+    }
+
+    public FileObject getDecoratedFileObject()
+    {
+        return decoratedFileObject;
+    }
+
+    public boolean isAttached()
+    {
+        return decoratedFileObject.isAttached();
+    }
+
+    public boolean isContentOpen()
+    {
+        return decoratedFileObject.isContentOpen();
+    }
+
+    public String toString()
+    {
+        return decoratedFileObject.toString();
+    }
+
+    public FileOperations getFileOperations() throws FileSystemException
+    {
+        return decoratedFileObject.getFileOperations();
+    }
+}

Added: synapse/branches/commons-vfs-2-synapse-2.0/core/src/main/java/org/apache/commons/vfs/impl/DefaultFileContentInfo.java
URL: http://svn.apache.org/viewvc/synapse/branches/commons-vfs-2-synapse-2.0/core/src/main/java/org/apache/commons/vfs/impl/DefaultFileContentInfo.java?rev=1000332&view=auto
==============================================================================
--- synapse/branches/commons-vfs-2-synapse-2.0/core/src/main/java/org/apache/commons/vfs/impl/DefaultFileContentInfo.java (added)
+++ synapse/branches/commons-vfs-2-synapse-2.0/core/src/main/java/org/apache/commons/vfs/impl/DefaultFileContentInfo.java Thu Sep 23 06:04:21 2010
@@ -0,0 +1,45 @@
+/*
+ * 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.
+ */
+package org.apache.commons.vfs.impl;
+
+import org.apache.commons.vfs.FileContentInfo;
+
+/**
+ * The default file content information.
+ * @author <a href="http://commons.apache.org/vfs/team-list.html">Commons VFS team</a>
+ */
+public class DefaultFileContentInfo implements FileContentInfo
+{
+    private final String contentType;
+    private final String contentEncoding;
+
+    public DefaultFileContentInfo(final String contentType, final String contentEncoding)
+    {
+        this.contentType = contentType;
+        this.contentEncoding = contentEncoding;
+    }
+
+    public String getContentType()
+    {
+        return contentType;
+    }
+
+    public String getContentEncoding()
+    {
+        return contentEncoding;
+    }
+}