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 [3/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/FileSystem.java
URL: http://svn.apache.org/viewvc/synapse/branches/commons-vfs-2-synapse-2.0/core/src/main/java/org/apache/commons/vfs/FileSystem.java?rev=1000332&view=auto
==============================================================================
--- synapse/branches/commons-vfs-2-synapse-2.0/core/src/main/java/org/apache/commons/vfs/FileSystem.java (added)
+++ synapse/branches/commons-vfs-2-synapse-2.0/core/src/main/java/org/apache/commons/vfs/FileSystem.java Thu Sep 23 06:04:21 2010
@@ -0,0 +1,191 @@
+/*
+ * 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.io.File;
+
+/**
+ * A file system, made up of a hierarchy of files.
+ *
+ * @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 interface FileSystem
+{
+ /**
+ * Returns the root file of this file system.
+ * @return The root FileObject.
+ * @throws FileSystemException if an error occurs.
+ */
+ FileObject getRoot() throws FileSystemException;
+
+ /**
+ * Returns the name of the root file of this file system. The root name always
+ * contains a path String of "/".
+ * @return the root FileName.
+ */
+ FileName getRootName();
+
+ /**
+ * The root URI passed as a file system option or obtained from the rootName.
+ * @return The root URI.
+ */
+ String getRootURI();
+
+ /**
+ * Determines if this file system has a particular capability.
+ *
+ * @param capability The capability to check for.
+ * @return true if this filesystem has the requested capability.
+ * Note that not all files in the file system may have the
+ * capability.
+ * @todo Move this to another interface, so that set of capabilities can be queried.
+ */
+ boolean hasCapability(Capability capability);
+
+ /**
+ * Returns the parent layer if this is a layered file system.
+ *
+ * @return The parent layer, or null if this is not a layered file system.
+ * @throws FileSystemException if an error occurs.
+ */
+ FileObject getParentLayer() throws FileSystemException;
+
+ /**
+ * Gets the value of an attribute of the file system.
+ * <p/>
+ * <p>TODO - change to <code>Map getAttributes()</code> instead?
+ * <p/>
+ * <p>TODO - define the standard attribute names, and define which attrs
+ * are guaranteed to be present.
+ *
+ * @param attrName The name of the attribute.
+ * @return The value of the attribute.
+ * @throws org.apache.commons.vfs.FileSystemException
+ * If the file does not exist, or is being written, or if the
+ * attribute is unknown.
+ * @see org.apache.commons.vfs.FileContent#getAttribute
+ */
+ Object getAttribute(String attrName) throws FileSystemException;
+
+ /**
+ * Sets the value of an attribute of the file's content. Creates the
+ * file if it does not exist.
+ *
+ * @param attrName The name of the attribute.
+ * @param value The value of the attribute.
+ * @throws FileSystemException If the file is read-only, or is being read, or if the attribute
+ * is not supported, or on error setting the attribute.
+ * @see FileContent#setAttribute
+ */
+ void setAttribute(String attrName, Object value)
+ throws FileSystemException;
+
+ /**
+ * Finds a file in this file system.
+ *
+ * @param name The name of the file.
+ * @return The file. Never returns null.
+ * @throws FileSystemException if an error occurs.
+ */
+ FileObject resolveFile(FileName name) throws FileSystemException;
+
+ /**
+ * Finds a file in this file system.
+ *
+ * @param name The name of the file. This must be an absolute path.
+ * @return The file. Never returns null.
+ * @throws FileSystemException if an error occurs.
+ */
+ FileObject resolveFile(String name) throws FileSystemException;
+
+ /**
+ * Adds a listener on a file in this file system.
+ *
+ * @param file The file to attach the listener to.
+ * @param listener The listener to add.
+ */
+ void addListener(FileObject file, FileListener listener);
+
+ /**
+ * Removes a listener from a file in this file system.
+ *
+ * @param file The file to remove the listener from.
+ * @param listener The listener to remove.
+ */
+ void removeListener(FileObject file, FileListener listener);
+
+ /**
+ * Adds a junction to this file system. A junction is a link that attaches
+ * the supplied file to a point in this file system, making it look like
+ * part of the file system.
+ *
+ * @param junctionPoint The point in this file system to add the junction.
+ * @param targetFile The file to link to.
+ * @throws FileSystemException If this file system does not support junctions, or the junction
+ * point or target file is invalid (the file system may not support
+ * nested junctions, for example).
+ */
+ void addJunction(String junctionPoint, FileObject targetFile)
+ throws FileSystemException;
+
+ /**
+ * Removes a junction from this file system.
+ *
+ * @param junctionPoint The junction to remove.
+ * @throws FileSystemException On error removing the junction.
+ */
+ void removeJunction(String junctionPoint) throws FileSystemException;
+
+ /**
+ * Creates a temporary local copy of a file and its descendents. If
+ * this file is already a local file, a copy is not made.
+ * <p/>
+ * <p>Note that the local copy may include additonal files, that were
+ * not selected by the given selector.
+ *
+ * @param file The file to replicate.
+ * @param selector The selector to use to select the files to replicate.
+ * @return The local copy of this file.
+ * @throws FileSystemException If this file does not exist, or on error replicating the file.
+ * @todo Add options to indicate whether the caller is happy to deal with
+ * extra files being present locally (eg if the file has been
+ * replicated previously), or whether the caller expects only
+ * the selected files to be present.
+ */
+ File replicateFile(FileObject file, FileSelector selector)
+ throws FileSystemException;
+
+ /**
+ * Returns the FileSystemOptions used to instantiate this filesystem.
+ * @return The FileSystemOptions.
+ */
+ FileSystemOptions getFileSystemOptions();
+
+ /**
+ * Returns a reference to the FileSytemManager.
+ * @return The FileSystemManager.
+ */
+ FileSystemManager getFileSystemManager();
+
+ /**
+ * Returns the accuracy of the last modification time.
+ *
+ * @return ms 0 perfectly accurate, >0 might be off by this value e.g. sftp 1000ms.
+ */
+ double getLastModTimeAccuracy();
+}
Added: synapse/branches/commons-vfs-2-synapse-2.0/core/src/main/java/org/apache/commons/vfs/FileSystemConfigBuilder.java
URL: http://svn.apache.org/viewvc/synapse/branches/commons-vfs-2-synapse-2.0/core/src/main/java/org/apache/commons/vfs/FileSystemConfigBuilder.java?rev=1000332&view=auto
==============================================================================
--- synapse/branches/commons-vfs-2-synapse-2.0/core/src/main/java/org/apache/commons/vfs/FileSystemConfigBuilder.java (added)
+++ synapse/branches/commons-vfs-2-synapse-2.0/core/src/main/java/org/apache/commons/vfs/FileSystemConfigBuilder.java Thu Sep 23 06:04:21 2010
@@ -0,0 +1,311 @@
+/*
+ * 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;
+
+/**
+ * Abstract class which has the right to fill FileSystemOptions.
+ *
+ * @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 FileSystemConfigBuilder
+{
+ /** Default prefix to use when resolving system properties */
+ private static final String PREFIX = "vfs.";
+
+ /** The root uri of the file system */
+ private static final String ROOTURI = "rootURI";
+
+ /** The prefix to use when resolving system properties */
+ private final String prefix;
+
+ protected FileSystemConfigBuilder()
+ {
+ this.prefix = PREFIX;
+ }
+ protected FileSystemConfigBuilder(String component)
+ {
+ this.prefix = PREFIX + component;
+ }
+
+ /**
+ * The root URI of the file system.
+ * @param opts The FileSystem options
+ * @param rootURI The creator name to be associated with the file.
+ */
+ public void setRootURI(FileSystemOptions opts, String rootURI)
+ {
+ setParam(opts, ROOTURI, rootURI);
+ }
+
+ /**
+ * Return the root URI of the file system.
+ * @param opts The FileSystem options
+ * @return The root URI.
+ */
+ public String getRootURI(FileSystemOptions opts)
+ {
+ return getString(opts, ROOTURI);
+ }
+
+
+ protected void setParam(FileSystemOptions opts, String name, Object value)
+ {
+ opts.setOption(getConfigClass(), name, value);
+ }
+
+ protected Object getParam(FileSystemOptions opts, String name)
+ {
+ if (opts == null)
+ {
+ return null;
+ }
+
+ return opts.getOption(getConfigClass(), name);
+ }
+
+ protected boolean hasParam(FileSystemOptions opts, String name)
+ {
+ return opts != null && opts.hasOption(getConfigClass(), name);
+ }
+
+ protected boolean hasObject(FileSystemOptions opts, String name)
+ {
+ return hasParam(opts, name) || System.getProperties().containsKey(PREFIX + name);
+ }
+
+ protected Boolean getBoolean(FileSystemOptions opts, String name)
+ {
+ return getBoolean(opts, name, null);
+ }
+
+ protected boolean getBoolean(FileSystemOptions opts, String name, boolean defaultValue)
+ {
+ return getBoolean(opts, name, new Boolean(defaultValue)).booleanValue();
+ }
+
+ protected Boolean getBoolean(FileSystemOptions opts, String name, Boolean defaultValue)
+ {
+ Boolean value = (Boolean) getParam(opts, name);
+ if (value == null)
+ {
+ String str = System.getProperty(PREFIX + name);
+ if (str == null)
+ {
+ return defaultValue;
+ }
+ value = Boolean.valueOf(str);
+ }
+ return value;
+ }
+
+ protected Byte getByte(FileSystemOptions opts, String name)
+ {
+ return getByte(opts, name, null);
+ }
+
+ protected byte getByte(FileSystemOptions opts, String name, byte defaultValue)
+ {
+ return getByte(opts, name, new Byte(defaultValue)).byteValue();
+ }
+
+ protected Byte getByte(FileSystemOptions opts, String name, Byte defaultValue)
+ {
+ Byte value = (Byte) getParam(opts, name);
+ if (value == null)
+ {
+ String str = System.getProperty(this.prefix + name);
+ if (str == null)
+ {
+ return defaultValue;
+ }
+ value = Byte.valueOf(str);
+ }
+ return value;
+ }
+
+ protected Character getCharacter(FileSystemOptions opts, String name)
+ {
+ return getCharacter(opts, name, null);
+ }
+
+ protected char getCharacter(FileSystemOptions opts, String name, char defaultValue)
+ {
+ return getCharacter(opts, name, new Character(defaultValue)).charValue();
+ }
+
+ protected Character getCharacter(FileSystemOptions opts, String name, Character defaultValue)
+ {
+ Character value = (Character) getParam(opts, name);
+ if (value == null)
+ {
+ String str = System.getProperty(this.prefix + name);
+ if (str == null || str.length() <= 0)
+ {
+ return defaultValue;
+ }
+ value = new Character(str.charAt(0));
+ }
+ return value;
+ }
+
+ protected Double getDouble(FileSystemOptions opts, String name)
+ {
+ return getDouble(opts, name, null);
+ }
+
+ protected double getDouble(FileSystemOptions opts, String name, double defaultValue)
+ {
+ return getDouble(opts, name, new Double(defaultValue)).doubleValue();
+ }
+
+ protected Double getDouble(FileSystemOptions opts, String name, Double defaultValue)
+ {
+ Double value = (Double) getParam(opts, name);
+ if (value == null)
+ {
+ String str = System.getProperty(this.prefix + name);
+ if (str == null || str.length() <= 0)
+ {
+ return defaultValue;
+ }
+ value = Double.valueOf(str);
+ }
+ return value;
+ }
+
+ protected Float getFloat(FileSystemOptions opts, String name)
+ {
+ return getFloat(opts, name, null);
+ }
+
+ protected float getFloat(FileSystemOptions opts, String name, float defaultValue)
+ {
+ return getFloat(opts, name, new Float(defaultValue)).floatValue();
+ }
+
+ protected Float getFloat(FileSystemOptions opts, String name, Float defaultValue)
+ {
+ Float value = (Float) getParam(opts, name);
+ if (value == null)
+ {
+ String str = System.getProperty(this.prefix + name);
+ if (str == null || str.length() <= 0)
+ {
+ return defaultValue;
+ }
+ value = Float.valueOf(str);
+ }
+ return value;
+ }
+
+ protected Integer getInteger(FileSystemOptions opts, String name)
+ {
+ return getInteger(opts, name, null);
+ }
+
+ protected int getInteger(FileSystemOptions opts, String name, int defaultValue)
+ {
+ return getInteger(opts, name, new Integer(defaultValue)).intValue();
+ }
+
+ protected Integer getInteger(FileSystemOptions opts, String name, Integer defaultValue)
+ {
+ Integer value = (Integer) getParam(opts, name);
+ if (value == null)
+ {
+ String str = System.getProperty(this.prefix + name);
+ if (str == null)
+ {
+ return defaultValue;
+ }
+ value = Integer.valueOf(str);
+ }
+ return value;
+ }
+
+ protected Long getLong(FileSystemOptions opts, String name)
+ {
+ return getLong(opts, name, null);
+ }
+
+ protected long getLong(FileSystemOptions opts, String name, long defaultValue)
+ {
+ return getLong(opts, name, new Long(defaultValue)).longValue();
+ }
+
+ protected Long getLong(FileSystemOptions opts, String name, Long defaultValue)
+ {
+ Long value = (Long) getParam(opts, name);
+ if (value == null)
+ {
+ String str = System.getProperty(this.prefix + name);
+ if (str == null)
+ {
+ return defaultValue;
+ }
+ value = Long.valueOf(str);
+ }
+ return value;
+ }
+
+ protected Short getShort(FileSystemOptions opts, String name)
+ {
+ return getShort(opts, name, null);
+ }
+
+ protected short getShort(FileSystemOptions opts, String name, short defaultValue)
+ {
+ return getShort(opts, name, new Short(defaultValue)).shortValue();
+ }
+
+ protected Short getShort(FileSystemOptions opts, String name, Short defaultValue)
+ {
+ Short value = (Short) getParam(opts, name);
+ if (value == null)
+ {
+ String str = System.getProperty(this.prefix + name);
+ if (str == null)
+ {
+ return defaultValue;
+ }
+ value = Short.valueOf(str);
+ }
+ return value;
+ }
+
+ protected String getString(FileSystemOptions opts, String name)
+ {
+ return getString(opts, name, null);
+ }
+
+ protected String getString(FileSystemOptions opts, String name, String defaultValue)
+ {
+ String value = (String) getParam(opts, name);
+ if (value == null)
+ {
+ value = System.getProperty(this.prefix + name);
+ if (value == null)
+ {
+ return defaultValue;
+ }
+ }
+ return value;
+ }
+
+ protected abstract Class getConfigClass();
+}
Added: synapse/branches/commons-vfs-2-synapse-2.0/core/src/main/java/org/apache/commons/vfs/FileSystemException.java
URL: http://svn.apache.org/viewvc/synapse/branches/commons-vfs-2-synapse-2.0/core/src/main/java/org/apache/commons/vfs/FileSystemException.java?rev=1000332&view=auto
==============================================================================
--- synapse/branches/commons-vfs-2-synapse-2.0/core/src/main/java/org/apache/commons/vfs/FileSystemException.java (added)
+++ synapse/branches/commons-vfs-2-synapse-2.0/core/src/main/java/org/apache/commons/vfs/FileSystemException.java Thu Sep 23 06:04:21 2010
@@ -0,0 +1,199 @@
+/*
+ * 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.vfs.util.Messages;
+
+import java.io.IOException;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+/**
+ * Thrown for file system errors.
+ *
+ * @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 class FileSystemException
+ extends IOException
+{
+ /** URL pattern */
+ private static final Pattern URL_PATTERN = Pattern.compile("[a-z]+://.*");
+
+ /** Password pattern */
+ private static final Pattern PASSWORD_PATTERN = Pattern.compile(":(?:[^/]+)@");
+
+ /**
+ * The Throwable that caused this exception to be thrown.
+ */
+ private final Throwable throwable;
+
+ /**
+ * The message code.
+ */
+ private final String code;
+
+ /**
+ * array of complementary info (context).
+ */
+ private final String[] info;
+
+ /**
+ * Constructs exception with the specified detail message.
+ *
+ * @param code the error code of the message.
+ */
+ public FileSystemException(final String code)
+ {
+ this(code, null, null);
+ }
+
+ /**
+ * Constructs exception with the specified detail message.
+ *
+ * @param code the error code of the message.
+ * @param info0 one context information.
+ */
+ public FileSystemException(final String code, final Object info0)
+ {
+ this(code, new Object[]{info0}, null);
+ }
+
+ /**
+ * Constructs exception with the specified detail message.
+ *
+ * @param code the error code of the message.
+ * @param info0 one context information.
+ * @param throwable the cause.
+ */
+ public FileSystemException(final String code,
+ final Object info0,
+ final Throwable throwable)
+ {
+ this(code, new Object[]{info0}, throwable);
+ }
+
+ /**
+ * Constructs exception with the specified detail message.
+ *
+ * @param code the error code of the message.
+ * @param info array of complementary info (context).
+ */
+ public FileSystemException(final String code, final Object[] info)
+ {
+ this(code, info, null);
+ }
+
+ /**
+ * Constructs exception with the specified detail message.
+ *
+ * @param code the error code of the message.
+ * @param throwable the original cause
+ */
+ public FileSystemException(final String code, final Throwable throwable)
+ {
+ this(code, null, throwable);
+ }
+
+ /**
+ * Constructs exception with the specified detail message.
+ *
+ * @param code the error code of the message.
+ * @param info array of complementary info (context).
+ * @param throwable the cause.
+ */
+ public FileSystemException(final String code,
+ final Object[] info,
+ final Throwable throwable)
+ {
+ super(code);
+
+ if (info == null)
+ {
+ this.info = new String[0];
+ }
+ else
+ {
+ this.info = new String[info.length];
+ for (int i = 0; i < info.length; i++)
+ {
+ String value = String.valueOf(info[i]);
+ // mask passwords (VFS-169)
+ final Matcher urlMatcher = URL_PATTERN.matcher(value);
+ if (urlMatcher.find())
+ {
+ final Matcher pwdMatcher = PASSWORD_PATTERN.matcher(value);
+ value = pwdMatcher.replaceFirst(":***@");
+ }
+ this.info[i] = value;
+ }
+ }
+ this.code = code;
+ this.throwable = throwable;
+ }
+
+ /**
+ * Constructs wrapper exception.
+ *
+ * @param throwable the root cause to wrap.
+ */
+ public FileSystemException(final Throwable throwable)
+ {
+ this(throwable.getMessage(), null, throwable);
+ }
+
+ /**
+ * retrieve message from bundle.
+ * @return The exception message.
+ */
+ public String getMessage()
+ {
+ return Messages.getString(super.getMessage(), getInfo());
+ }
+
+ /**
+ * Retrieve root cause of the exception.
+ *
+ * @return the root cause
+ */
+ public final Throwable getCause()
+ {
+ return throwable;
+ }
+
+ /**
+ * Retrieve error code of the exception.
+ * Could be used as key for internationalization.
+ *
+ * @return the code.
+ */
+ public String getCode()
+ {
+ return code;
+ }
+
+ /**
+ * Retrieve array of complementary info (context).
+ * Could be used as parameter for internationalization.
+ *
+ * @return the context info.
+ */
+ public String[] getInfo()
+ {
+ return info;
+ }
+}
Added: synapse/branches/commons-vfs-2-synapse-2.0/core/src/main/java/org/apache/commons/vfs/FileSystemManager.java
URL: http://svn.apache.org/viewvc/synapse/branches/commons-vfs-2-synapse-2.0/core/src/main/java/org/apache/commons/vfs/FileSystemManager.java?rev=1000332&view=auto
==============================================================================
--- synapse/branches/commons-vfs-2-synapse-2.0/core/src/main/java/org/apache/commons/vfs/FileSystemManager.java (added)
+++ synapse/branches/commons-vfs-2-synapse-2.0/core/src/main/java/org/apache/commons/vfs/FileSystemManager.java Thu Sep 23 06:04:21 2010
@@ -0,0 +1,342 @@
+/*
+ * 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;
+
+import java.io.File;
+import java.net.URLStreamHandlerFactory;
+import java.util.Collection;
+import java.lang.reflect.Constructor;
+
+import org.apache.commons.vfs.operations.FileOperationProvider;
+
+/**
+ * A FileSystemManager manages a set of file systems. This interface is
+ * used to locate a {@link FileObject} by name from one of those file systems.
+ * <p/>
+ * <p>To locate a {@link FileObject}, use one of the <code>resolveFile()</code>
+ * methods.</p>
+ * <p/>
+ * <h4><a name="naming">File Naming</a></h4>
+ * <p/>
+ * <p>A file system manager can recognise several types of file names:
+ * <p/>
+ * <ul>
+ * <p/>
+ * <li><p>Absolute URI. These must start with a scheme, such as
+ * <code>file:</code> or <code>ftp:</code>, followed by a scheme dependent
+ * file name. Some examples:</p>
+ * <pre>
+ * file:/c:/somefile
+ * ftp://somewhere.org/somefile
+ * </pre>
+ * <p/>
+ * <li><p>Absolute local file name. For example,
+ * <code>/home/someuser/a-file</code> or <code>c:\dir\somefile.html</code>.
+ * Elements in the name can be separated using any of the following
+ * characters: <code>/</code>, <code>\</code>, or the native file separator
+ * character. For example, the following file names are the same:</p>
+ * <pre>
+ * c:\somedir\somefile.xml
+ * c:/somedir/somefile.xml
+ * </pre>
+ * <p/>
+ * <li><p>Relative path. For example: <code>../somefile</code> or
+ * <code>somedir/file.txt</code>. The file system manager resolves relative
+ * paths against its <i>base file</i>. Elements in the relative path can be
+ * separated using <code>/</code>, <code>\</code>, or file system specific
+ * separator characters. Relative paths may also contain <code>..</code> and
+ * <code>.</code> elements. See {@link FileObject#resolveFile} for more
+ * details.</p>
+ * <p/>
+ * </ul>
+ *
+ * @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 interface FileSystemManager
+{
+ /**
+ * Returns the base file used to resolve relative paths.
+ * @return The base FileObject.
+ * @throws FileSystemException if an error occurs.
+ */
+ FileObject getBaseFile() throws FileSystemException;
+
+ /**
+ * Locates a file by name. Equivalent to calling
+ * <code>resolveFile(uri, getBaseName())</code>.
+ *
+ * @param name The name of the file.
+ * @return The file. Never returns null.
+ * @throws FileSystemException On error parsing the file name.
+ */
+ FileObject resolveFile(String name) throws FileSystemException;
+
+ /**
+ * Locates a file by name. Equivalent to calling
+ * <code>resolveFile(uri, getBaseName())</code>.
+ *
+ * @param name The name of the file.
+ * @param fileSystemOptions The FileSystemOptions used for FileSystem creation
+ * @return The file. Never returns null.
+ * @throws FileSystemException On error parsing the file name.
+ */
+ FileObject resolveFile(String name, FileSystemOptions fileSystemOptions)
+ throws FileSystemException;
+
+ /** ยง
+ * Locates a file by name. The name is resolved as described
+ * <a href="#naming">above</a>. That is, the name can be either
+ * an absolute URI, an absolute file name, or a relative path to
+ * be resolved against <code>baseFile</code>.
+ * <p/>
+ * <p>Note that the file does not have to exist when this method is called.
+ *
+ * @param name The name of the file.
+ * @param baseFile The base file to use to resolve relative paths.
+ * May be null.
+ * @return The file. Never returns null.
+ * @throws FileSystemException On error parsing the file name.
+ */
+ FileObject resolveFile(FileObject baseFile, String name) throws FileSystemException;
+
+ /**
+ * Locates a file by name. See {@link #resolveFile(FileObject, String)}
+ * for details.
+ *
+ * @param baseFile The base file to use to resolve relative paths.
+ * May be null.
+ * @param name The name of the file.
+ * @return The file. Never returns null.
+ * @throws FileSystemException On error parsing the file name.
+ */
+ FileObject resolveFile(File baseFile, String name) throws FileSystemException;
+
+ /**
+ * Resolves a name, relative to this file name. Equivalent to calling
+ * <code>resolveName( path, NameScope.FILE_SYSTEM )</code>.
+ *
+ * @param root the base filename
+ * @param name The name to resolve.
+ * @return A {@link FileName} object representing the resolved file name.
+ * @throws FileSystemException If the name is invalid.
+ */
+ FileName resolveName(final FileName root, final String name) throws FileSystemException;
+
+ /**
+ * Resolves a name, relative to the "root" file name. Refer to {@link NameScope}
+ * for a description of how names are resolved.
+ *
+ * @param root the base filename
+ * @param name The name to resolve.
+ * @param scope The {@link NameScope} to use when resolving the name.
+ * @return A {@link FileName} object representing the resolved file name.
+ * @throws FileSystemException If the name is invalid.
+ */
+ FileName resolveName(final FileName root, String name, NameScope scope)
+ throws FileSystemException;
+
+ /**
+ * Converts a local file into a {@link FileObject}.
+ *
+ * @param file The file to convert.
+ * @return The {@link FileObject} that represents the local file. Never
+ * returns null.
+ * @throws FileSystemException On error converting the file.
+ */
+ FileObject toFileObject(File file) throws FileSystemException;
+
+ /**
+ * Creates a layered file system. A layered file system is a file system
+ * that is created from the contents of a file, such as a zip or tar file.
+ *
+ * @param provider The name of the file system provider to use. This name
+ * is the same as the scheme used in URI to identify the provider.
+ * @param file The file to use to create the file system.
+ * @return The root file of the new file system.
+ * @throws FileSystemException On error creating the file system.
+ */
+ FileObject createFileSystem(String provider, FileObject file)
+ throws FileSystemException;
+
+ /**
+ * Closes the given filesystem.<br />
+ * If you use VFS as singleton it is VERY dangerous to call this method.
+ * @param filesystem The FileSystem to close.
+ */
+ void closeFileSystem(FileSystem filesystem);
+
+ /**
+ * Creates a layered file system. A layered file system is a file system
+ * that is created from the contents of a file, such as a zip or tar file.
+ *
+ * @param file The file to use to create the file system.
+ * @return The root file of the new file system.
+ * @throws FileSystemException On error creating the file system.
+ */
+ FileObject createFileSystem(FileObject file) throws FileSystemException;
+
+ /**
+ * Creates an empty virtual file system. Can be populated by adding
+ * junctions to it.
+ *
+ * @param rootUri The root URI to use for the new file system. Can be null.
+ * @return The root file of the new file system.
+ * @throws FileSystemException if an error occurs creating the VirtualFileSystem.
+ */
+ FileObject createVirtualFileSystem(String rootUri) throws FileSystemException;
+
+ /**
+ * Creates a virtual file system. The file system will contain a junction
+ * at the fs root to the supplied root file.
+ *
+ * @param rootFile The root file to backs the file system.
+ * @return The root of the new file system.
+ * @throws FileSystemException if an error occurs creating the VirtualFileSystem.
+ */
+ FileObject createVirtualFileSystem(FileObject rootFile) throws FileSystemException;
+
+ /**
+ * Returns a streamhandler factory to enable URL lookup using this
+ * FileSystemManager.
+ * @return the URLStreamHandlerFactory.
+ */
+ URLStreamHandlerFactory getURLStreamHandlerFactory();
+
+ /**
+ * Determines if a layered file system can be created for a given file.
+ *
+ * @param file The file to check for.
+ * @return true if the FileSystem can be created.
+ * @throws FileSystemException if an error occurs.
+ */
+ boolean canCreateFileSystem(FileObject file) throws FileSystemException;
+
+ /**
+ * Get the cache used to cache fileobjects.
+ * @return The FilesCache.
+ */
+ FilesCache getFilesCache();
+
+ /**
+ * Get the cache strategy used.
+ * @return the CacheStrategy.
+ */
+ CacheStrategy getCacheStrategy();
+
+ /**
+ * Get the file object decorator used.
+ * @return the file object decorator Class.
+ */
+ Class getFileObjectDecorator();
+
+ /**
+ * The constructor associated to the fileObjectDecorator.
+ * We cache it here for performance reasons.
+ * @return the Constructor associated with the FileObjectDecorator.
+ */
+ Constructor getFileObjectDecoratorConst();
+
+ /**
+ * The class to use to determine the content-type (mime-type).
+ * @return the FileContentInfoFactory.
+ */
+ FileContentInfoFactory getFileContentInfoFactory();
+
+ /**
+ * Returns true if this manager has a provider for a particular scheme.
+ * @param scheme The scheme for which a provider should be checked.
+ * @return true if a provider for the scheme is available.
+ */
+ boolean hasProvider(final String scheme);
+
+ /**
+ * Get the schemes currently available.
+ * @return An array of available scheme names that are supported.
+ */
+ String[] getSchemes();
+
+ /**
+ * Get the capabilities for a given scheme.
+ *
+ * @param scheme The scheme to use to locate the provider's capabilities.
+ * @return A Collection of the various capabilities.
+ * @throws FileSystemException if the given scheme is not konwn.
+ */
+ Collection getProviderCapabilities(final String scheme) throws FileSystemException;
+
+ /**
+ * Sets the logger to use.
+ * @param log The logger to use.
+ */
+ void setLogger(final Log log);
+
+ /**
+ * Get the configuration builder for the given scheme.
+ *
+ * @param scheme The schem to use to obtain the FileSystemConfigBuidler.
+ * @return A FileSystemConfigBuilder appropriate for the given scheme.
+ * @throws FileSystemException if the given scheme is not konwn.
+ */
+ FileSystemConfigBuilder getFileSystemConfigBuilder(final String scheme) throws FileSystemException;
+
+ /**
+ * Resolve the uri to a filename.
+ *
+ * @param uri The uri to resolve.
+ * @return A FileName that matches the uri.
+ * @throws FileSystemException if this is not possible.
+ */
+ FileName resolveURI(String uri) throws FileSystemException;
+
+ // -- OPERATIONS --
+ /**
+ * Adds the specified FileOperationProvider for the specified scheme.
+ * Several FileOperationProvider's might be registered for the same scheme.
+ * For example, for "file" scheme we can register SvnWsOperationProvider and
+ * CvsOperationProvider.
+ *
+ * @param scheme The scheme assoicated with this provider.
+ * @param operationProvider The FileOperationProvider to add.
+ * @throws FileSystemException if an error occurs.
+ */
+ void addOperationProvider(final String scheme, final FileOperationProvider operationProvider)
+ throws FileSystemException;
+
+ /**
+ * @see FileSystemManager#addOperationProvider(String, org.apache.commons.vfs.operations.FileOperationProvider).
+ *
+ * @param schemes The schemes that will be associated with the provider.
+ * @param operationProvider The FileOperationProvider to add.
+ * @throws FileSystemException if an error occurs.
+ */
+ void addOperationProvider(final String[] schemes, final FileOperationProvider operationProvider)
+ throws FileSystemException;
+
+
+ /**
+ * @param scheme the scheme for wich we want to get the list af registered providers.
+ *
+ * @return the registered FileOperationProviders for the specified scheme.
+ * If there were no providers registered for the scheme, it returns null.
+ *
+ * @throws FileSystemException if an error occurs.
+ */
+ FileOperationProvider[] getOperationProviders(final String scheme) throws FileSystemException;
+}
Added: synapse/branches/commons-vfs-2-synapse-2.0/core/src/main/java/org/apache/commons/vfs/FileSystemOptions.java
URL: http://svn.apache.org/viewvc/synapse/branches/commons-vfs-2-synapse-2.0/core/src/main/java/org/apache/commons/vfs/FileSystemOptions.java?rev=1000332&view=auto
==============================================================================
--- synapse/branches/commons-vfs-2-synapse-2.0/core/src/main/java/org/apache/commons/vfs/FileSystemOptions.java (added)
+++ synapse/branches/commons-vfs-2-synapse-2.0/core/src/main/java/org/apache/commons/vfs/FileSystemOptions.java Thu Sep 23 06:04:21 2010
@@ -0,0 +1,174 @@
+/*
+ * 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;
+
+/**
+ * Container for FileSystemOptions.<br>
+ * You have to use *FileSystemConfigBuilder.getInstance() to fill this container<br>
+ * * = the filesystem provider short name
+ *
+ * @author <a href="mailto:imario@apache.org">Mario Ivankovits</a>
+ * @version $Revision: 833480 $ $Date: 2009-11-06 23:07:05 +0530 (Fri, 06 Nov 2009) $
+ * @see org.apache.commons.vfs.provider.sftp.SftpFileSystemConfigBuilder
+ * @see org.apache.commons.vfs.provider.ftp.FtpFileSystemConfigBuilder
+ */
+public final class FileSystemOptions implements Cloneable
+{
+ /** The options */
+ private Map options = new TreeMap();
+
+ /**
+ * Keys in the options Map.
+ */
+ private static final class FileSystemOptionKey implements Comparable
+ {
+ /** Constant used to create hashcode */
+ private static final int HASH = 29;
+
+ /** The FileSystem class */
+ private final Class fileSystemClass;
+
+ /** The option name */
+ private final String name;
+
+ private FileSystemOptionKey(Class fileSystemClass, String name)
+ {
+ this.fileSystemClass = fileSystemClass;
+ this.name = name;
+ }
+
+ public int compareTo(Object o)
+ {
+ FileSystemOptionKey k = (FileSystemOptionKey) o;
+
+ int ret = fileSystemClass.getName().compareTo(k.fileSystemClass.getName());
+ if (ret != 0)
+ {
+ return ret;
+ }
+
+ return name.compareTo(k.name);
+ }
+
+ public boolean equals(Object o)
+ {
+ if (this == o)
+ {
+ return true;
+ }
+ if (o == null || getClass() != o.getClass())
+ {
+ return false;
+ }
+
+ final FileSystemOptionKey that = (FileSystemOptionKey) o;
+
+ if (!fileSystemClass.equals(that.fileSystemClass))
+ {
+ return false;
+ }
+ if (!name.equals(that.name))
+ {
+ return false;
+ }
+
+ return true;
+ }
+
+ public int hashCode()
+ {
+ int result;
+ result = fileSystemClass.hashCode();
+ result = HASH * result + name.hashCode();
+ return result;
+ }
+ }
+
+ public FileSystemOptions()
+ {
+ }
+
+ void setOption(Class fileSystemClass, String name, Object value)
+ {
+ options.put(new FileSystemOptionKey(fileSystemClass, name), value);
+ }
+
+ Object getOption(Class fileSystemClass, String name)
+ {
+ FileSystemOptionKey key = new FileSystemOptionKey(fileSystemClass, name);
+ return options.get(key);
+ }
+
+ boolean hasOption(Class fileSystemClass, String name)
+ {
+ FileSystemOptionKey key = new FileSystemOptionKey(fileSystemClass, name);
+ return options.containsKey(key);
+ }
+
+ public int compareTo(FileSystemOptions other)
+ {
+ if (this == other)
+ {
+ // the same instance
+ return 0;
+ }
+
+ int propsSz = options == null ? 0 : options.size();
+ int propsFkSz = other.options == null ? 0 : other.options.size();
+ if (propsSz < propsFkSz)
+ {
+ return -1;
+ }
+ if (propsSz > propsFkSz)
+ {
+ return 1;
+ }
+ if (propsSz == 0)
+ {
+ // props empty
+ return 0;
+ }
+
+ int hash = options.hashCode();
+ int hashFk = other.options.hashCode();
+ if (hash < hashFk)
+ {
+ return -1;
+ }
+ if (hash > hashFk)
+ {
+ return 1;
+ }
+
+ // bad props not the same instance, but looks like the same
+ // TODO: compare Entry by Entry
+ return 0;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public Object clone()
+ {
+ FileSystemOptions clone = new FileSystemOptions();
+ clone.options = new TreeMap(options);
+ return clone;
+ }
+}
Added: synapse/branches/commons-vfs-2-synapse-2.0/core/src/main/java/org/apache/commons/vfs/FileType.java
URL: http://svn.apache.org/viewvc/synapse/branches/commons-vfs-2-synapse-2.0/core/src/main/java/org/apache/commons/vfs/FileType.java?rev=1000332&view=auto
==============================================================================
--- synapse/branches/commons-vfs-2-synapse-2.0/core/src/main/java/org/apache/commons/vfs/FileType.java (added)
+++ synapse/branches/commons-vfs-2-synapse-2.0/core/src/main/java/org/apache/commons/vfs/FileType.java Thu Sep 23 06:04:21 2010
@@ -0,0 +1,118 @@
+/*
+ * 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;
+
+/**
+ * An enumerated type that represents a file's type.
+ *
+ * @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 FileType
+{
+ /**
+ * A folder. May contain other files, and have attributes, but does not
+ * have any data content.
+ */
+ public static final FileType FOLDER = new FileType("folder", true, false, true);
+
+ /**
+ * A regular file. May have data content and attributes, but cannot
+ * contain other files.
+ */
+ public static final FileType FILE = new FileType("file", false, true, true);
+
+ /**
+ * A file or folder. May have data content and attributes, and can
+ * contain other files.
+ */
+ public static final FileType FILE_OR_FOLDER = new FileType("fileOrFolder", true, true, true);
+
+ /**
+ * A file that does not exist. May not have data content, attributes,
+ * or contain other files.
+ */
+ public static final FileType IMAGINARY = new FileType("imaginary", false, false, false);
+
+ /** The name of the FileType */
+ private final String name;
+
+ /** true if the FileType can have children */
+ private final boolean hasChildren;
+
+ /** true if the FileType can have content */
+ private final boolean hasContent;
+
+ /** true if the FileType has attributes */
+ private final boolean hasAttrs;
+
+ private FileType(final String name,
+ final boolean hasChildren,
+ final boolean hasContent,
+ final boolean hasAttrs)
+ {
+ this.name = name;
+ this.hasChildren = hasChildren;
+ this.hasContent = hasContent;
+ this.hasAttrs = hasAttrs;
+ }
+
+ /**
+ * Returns the name of this type.
+ * @return The name of this type.
+ */
+ public String toString()
+ {
+ return name;
+ }
+
+ /**
+ * Returns the name of this type.
+ * @return The name of the type.
+ */
+ public String getName()
+ {
+ return name;
+ }
+
+ /**
+ * Returns true if files of this type may contain other files.
+ * @return tru if files can contain other files.
+ */
+ public boolean hasChildren()
+ {
+ return hasChildren;
+ }
+
+ /**
+ * Returns true if files of this type may have data content.
+ * @return true if files can have content.
+ */
+ public boolean hasContent()
+ {
+ return hasContent;
+ }
+
+ /**
+ * Returns true if files of this type may have attributes.
+ * @return true if files can have attributes
+ */
+ public boolean hasAttributes()
+ {
+ return hasAttrs;
+ }
+}
Added: synapse/branches/commons-vfs-2-synapse-2.0/core/src/main/java/org/apache/commons/vfs/FileTypeHasNoContentException.java
URL: http://svn.apache.org/viewvc/synapse/branches/commons-vfs-2-synapse-2.0/core/src/main/java/org/apache/commons/vfs/FileTypeHasNoContentException.java?rev=1000332&view=auto
==============================================================================
--- synapse/branches/commons-vfs-2-synapse-2.0/core/src/main/java/org/apache/commons/vfs/FileTypeHasNoContentException.java (added)
+++ synapse/branches/commons-vfs-2-synapse-2.0/core/src/main/java/org/apache/commons/vfs/FileTypeHasNoContentException.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;
+
+/**
+ * delivers a file-not-folder exception which happens when trying to issue
+ * {@link org.apache.commons.vfs.FileObject#getChildren()} on a file.
+ * @author <a href="http://commons.apache.org/vfs/team-list.html">Commons VFS team</a>
+ */
+public class FileTypeHasNoContentException extends FileSystemException
+{
+ public FileTypeHasNoContentException(final Object info0)
+ {
+ super("vfs.provider/read-not-file.error", info0);
+ }
+
+ public FileTypeHasNoContentException(Object info0, Throwable throwable)
+ {
+ super("vfs.provider/read-not-file.error", info0, throwable);
+ }
+}
Added: synapse/branches/commons-vfs-2-synapse-2.0/core/src/main/java/org/apache/commons/vfs/FileTypeSelector.java
URL: http://svn.apache.org/viewvc/synapse/branches/commons-vfs-2-synapse-2.0/core/src/main/java/org/apache/commons/vfs/FileTypeSelector.java?rev=1000332&view=auto
==============================================================================
--- synapse/branches/commons-vfs-2-synapse-2.0/core/src/main/java/org/apache/commons/vfs/FileTypeSelector.java (added)
+++ synapse/branches/commons-vfs-2-synapse-2.0/core/src/main/java/org/apache/commons/vfs/FileTypeSelector.java Thu Sep 23 06:04:21 2010
@@ -0,0 +1,57 @@
+/*
+ * 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;
+
+/**
+ * A {@link FileSelector} that selects files of a particular type.
+ *
+ * @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 class FileTypeSelector
+ implements FileSelector
+{
+ /** The FileType */
+ private final FileType type;
+
+ public FileTypeSelector(final FileType type)
+ {
+ this.type = type;
+ }
+
+ /**
+ * Determines if a file or folder should be selected.
+ * @param fileInfo The file selection information.
+ * @return true if the file or folder should be selected.
+ * @throws FileSystemException if an error occurs
+ */
+ public boolean includeFile(final FileSelectInfo fileInfo)
+ throws FileSystemException
+ {
+ return fileInfo.getFile().getType() == type;
+ }
+
+ /**
+ * Determines whether a folder should be traversed.
+ * @param fileInfo The file selection information.
+ * @return true if the file or folder should be traversed.
+ */
+ public boolean traverseDescendents(final FileSelectInfo fileInfo)
+ {
+ return true;
+ }
+}
Added: synapse/branches/commons-vfs-2-synapse-2.0/core/src/main/java/org/apache/commons/vfs/FileUtil.java
URL: http://svn.apache.org/viewvc/synapse/branches/commons-vfs-2-synapse-2.0/core/src/main/java/org/apache/commons/vfs/FileUtil.java?rev=1000332&view=auto
==============================================================================
--- synapse/branches/commons-vfs-2-synapse-2.0/core/src/main/java/org/apache/commons/vfs/FileUtil.java (added)
+++ synapse/branches/commons-vfs-2-synapse-2.0/core/src/main/java/org/apache/commons/vfs/FileUtil.java Thu Sep 23 06:04:21 2010
@@ -0,0 +1,123 @@
+/*
+ * 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.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+
+/**
+ * Utility methods for dealng with FileObjects.
+ *
+ * @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 FileUtil
+{
+
+ /** The buffer size */
+ private static final int BUFFER_SIZE = 1024;
+
+ private FileUtil()
+ {
+ }
+
+ /**
+ * Returns the content of a file, as a byte array.
+ *
+ * @param file The file to get the content of.
+ * @return The content as a byte array.
+ * @throws IOException if the file content cannot be accessed.
+ */
+ public static byte[] getContent(final FileObject file)
+ throws IOException
+ {
+ final FileContent content = file.getContent();
+ final int size = (int) content.getSize();
+ final byte[] buf = new byte[size];
+
+ final InputStream in = content.getInputStream();
+ try
+ {
+ int read = 0;
+ for (int pos = 0; pos < size && read >= 0; pos += read)
+ {
+ read = in.read(buf, pos, size - pos);
+ }
+ }
+ finally
+ {
+ in.close();
+ }
+
+ return buf;
+ }
+
+ /**
+ * Writes the content of a file to an OutputStream.
+ * @param file The FileObject to write.
+ * @param outstr The OutputStream to write to.
+ * @throws IOException if an error occurs writing the file.
+ */
+ public static void writeContent(final FileObject file,
+ final OutputStream outstr)
+ throws IOException
+ {
+ final InputStream instr = file.getContent().getInputStream();
+ try
+ {
+ final byte[] buffer = new byte[BUFFER_SIZE];
+ while (true)
+ {
+ final int nread = instr.read(buffer);
+ if (nread < 0)
+ {
+ break;
+ }
+ outstr.write(buffer, 0, nread);
+ }
+ }
+ finally
+ {
+ instr.close();
+ }
+ }
+
+ /**
+ * Copies the content from a source file to a destination file.
+ * @param srcFile The source FileObject.
+ * @param destFile The target FileObject
+ * @throws IOException If an error occurs copying the file.
+ */
+ public static void copyContent(final FileObject srcFile,
+ final FileObject destFile)
+ throws IOException
+ {
+ // Create the output stream via getContent(), to pick up the
+ // validation it does
+ final OutputStream outstr = destFile.getContent().getOutputStream();
+ try
+ {
+ writeContent(srcFile, outstr);
+ }
+ finally
+ {
+ outstr.close();
+ }
+ }
+
+}
Added: synapse/branches/commons-vfs-2-synapse-2.0/core/src/main/java/org/apache/commons/vfs/FilesCache.java
URL: http://svn.apache.org/viewvc/synapse/branches/commons-vfs-2-synapse-2.0/core/src/main/java/org/apache/commons/vfs/FilesCache.java?rev=1000332&view=auto
==============================================================================
--- synapse/branches/commons-vfs-2-synapse-2.0/core/src/main/java/org/apache/commons/vfs/FilesCache.java (added)
+++ synapse/branches/commons-vfs-2-synapse-2.0/core/src/main/java/org/apache/commons/vfs/FilesCache.java Thu Sep 23 06:04:21 2010
@@ -0,0 +1,70 @@
+/*
+ * 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 fileCache interface.
+ *
+ * @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 interface FilesCache
+{
+ /**
+ * add a fileobject to the cache.
+ *
+ * @param file the file
+ */
+ void putFile(final FileObject file);
+
+ /**
+ * retrieve a file from the cache by its name.
+ *
+ * @param filesystem The FileSystem.
+ * @param name the name
+ * @return the fileobject or null if file is not cached
+ */
+ FileObject getFile(final FileSystem filesystem, final FileName name);
+
+ /**
+ * purge the entries corresponding to the filesystem.
+ * @param filesystem The FileSystem.
+ */
+ void clear(final FileSystem filesystem);
+
+ /**
+ * purge the whole cache.
+ */
+ void close();
+
+ /**
+ * removes a file from cache.
+ *
+ * @param filesystem filesystem
+ * @param name filename
+ */
+ void removeFile(final FileSystem filesystem, final FileName name);
+
+ /**
+ * if the cache uses timestamps it could use this method to handle
+ * updates of them.
+ *
+ * @param file filename
+ */
+ // public void touchFile(final FileObject file);
+}
Added: synapse/branches/commons-vfs-2-synapse-2.0/core/src/main/java/org/apache/commons/vfs/NameScope.java
URL: http://svn.apache.org/viewvc/synapse/branches/commons-vfs-2-synapse-2.0/core/src/main/java/org/apache/commons/vfs/NameScope.java?rev=1000332&view=auto
==============================================================================
--- synapse/branches/commons-vfs-2-synapse-2.0/core/src/main/java/org/apache/commons/vfs/NameScope.java (added)
+++ synapse/branches/commons-vfs-2-synapse-2.0/core/src/main/java/org/apache/commons/vfs/NameScope.java Thu Sep 23 06:04:21 2010
@@ -0,0 +1,93 @@
+/*
+ * 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;
+
+/**
+ * An enumerated type for file name scope, used when resolving a name relative
+ * to a file.
+ *
+ * @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 NameScope
+{
+ /**
+ * Resolve against the children of the base file. The name is resolved
+ * as described by {@link #FILE_SYSTEM}. However, an exception is
+ * thrown if the resolved file is not a direct child of the base file.
+ */
+ public static final NameScope CHILD = new NameScope("child");
+
+ /**
+ * Resolve against the descendents of the base file. The name is resolved
+ * as described by {@link #FILE_SYSTEM}. However, an exception is thrown
+ * if the resolved file is not a descendent of the base file.
+ */
+ public static final NameScope DESCENDENT = new NameScope("descendent");
+
+ /**
+ * Resolve against the descendents of the base file. The name is resolved
+ * as described by {@link #FILE_SYSTEM}. However, an exception is thrown
+ * if the resolved file is not a descendent of the base file, or the base
+ * files itself.
+ */
+ public static final NameScope DESCENDENT_OR_SELF =
+ new NameScope("descendent_or_self");
+
+ /**
+ * Resolve against files in the same file system as the base file.
+ * <p/>
+ * <p>If the supplied name is an absolute path, then it is resolved
+ * relative to the root of the file system that the base file belongs to.
+ * If a relative name is supplied, then it is resolved relative to the base
+ * file.
+ * <p/>
+ * <p>The path may use any mix of <code>/</code>, <code>\</code>, or file
+ * system specific separators to separate elements in the path. It may
+ * also contain <code>.</code> and <code>..</code> elements.
+ * <p/>
+ * <p>A path is considered absolute if it starts with a separator character,
+ * and relative if it does not.
+ */
+ public static final NameScope FILE_SYSTEM = new NameScope("filesystem");
+
+ /** The name */
+ private final String name;
+
+ private NameScope(final String name)
+ {
+ this.name = name;
+ }
+
+ /**
+ * Returns the name of the scope.
+ * @return The name of the scope.
+ */
+ public String toString()
+ {
+ return name;
+ }
+
+ /**
+ * Returns the name of the scope.
+ * @return The name of the scope.
+ */
+ public String getName()
+ {
+ return name;
+ }
+}
Added: synapse/branches/commons-vfs-2-synapse-2.0/core/src/main/java/org/apache/commons/vfs/RandomAccessContent.java
URL: http://svn.apache.org/viewvc/synapse/branches/commons-vfs-2-synapse-2.0/core/src/main/java/org/apache/commons/vfs/RandomAccessContent.java?rev=1000332&view=auto
==============================================================================
--- synapse/branches/commons-vfs-2-synapse-2.0/core/src/main/java/org/apache/commons/vfs/RandomAccessContent.java (added)
+++ synapse/branches/commons-vfs-2-synapse-2.0/core/src/main/java/org/apache/commons/vfs/RandomAccessContent.java Thu Sep 23 06:04:21 2010
@@ -0,0 +1,89 @@
+/*
+ * 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.io.DataInput;
+import java.io.DataOutput;
+import java.io.IOException;
+import java.io.InputStream;
+
+/**
+ * Random Access Content.
+ *
+ * @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 interface RandomAccessContent extends DataOutput, DataInput
+{
+ /**
+ * Returns the current offset in this file.
+ *
+ * @return the offset from the beginning of the file, in bytes,
+ * at which the next read or write occurs.
+ * @throws IOException if an I/O error occurs.
+ */
+ long getFilePointer() throws IOException;
+
+ /**
+ * Sets the file-pointer offset, measured from the beginning of this
+ * file, at which the next read or write occurs. The offset may be
+ * set beyond the end of the file. Setting the offset beyond the end
+ * of the file does not change the file length. The file length will
+ * change only by writing after the offset has been set beyond the end
+ * of the file.
+ * <br/>
+ * <b>Notice: If you use {@link #getInputStream()} you have to reget the InputStream after
+ * calling {@link #seek(long)}</b>
+ *
+ * @param pos the offset position, measured in bytes from the
+ * beginning of the file, at which to set the file
+ * pointer.
+ * @throws IOException if <code>pos</code> is less than
+ * <code>0</code> or if an I/O error occurs.
+ */
+ void seek(long pos) throws IOException;
+
+ /**
+ * Returns the length of this file.
+ *
+ * @return the length of this file, measured in bytes.
+ * @throws IOException if an I/O error occurs.
+ */
+ long length() throws IOException;
+
+ /**
+ * Closes this random access file stream and releases any system
+ * resources associated with the stream. A closed random access
+ * file cannot perform input or output operations and cannot be
+ * reopened.
+ * <p/>
+ * <p> If this file has an associated channel then the channel is closed
+ * as well.
+ *
+ * @throws IOException if an I/O error occurs.
+ */
+ void close() throws IOException;
+
+ /**
+ * Get the input stream.
+ * <br/>
+ * <b>Notice: If you use {@link #seek(long)} you have to reget the InputStream</b>
+ * @return the InputStream.
+ * @throws IOException if an I/O error occurs.
+ */
+ InputStream getInputStream() throws IOException;
+}
Added: synapse/branches/commons-vfs-2-synapse-2.0/core/src/main/java/org/apache/commons/vfs/Resources.properties
URL: http://svn.apache.org/viewvc/synapse/branches/commons-vfs-2-synapse-2.0/core/src/main/java/org/apache/commons/vfs/Resources.properties?rev=1000332&view=auto
==============================================================================
--- synapse/branches/commons-vfs-2-synapse-2.0/core/src/main/java/org/apache/commons/vfs/Resources.properties (added)
+++ synapse/branches/commons-vfs-2-synapse-2.0/core/src/main/java/org/apache/commons/vfs/Resources.properties Thu Sep 23 06:04:21 2010
@@ -0,0 +1,285 @@
+# 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.
+
+# $Id: Resources.properties 659785 2008-05-24 10:32:41Z imario $
+
+# Factory
+vfs/create-manager.error=Could not create a file system manager of class "{0}".
+
+# AbstractFileObject
+vfs.provider/delete-not-supported.error=This file type does not support delete.
+vfs.provider/rename-not-supported.error=This file type does not support rename.
+vfs.provider/write-append-not-supported.error=The file type does not support append mode.
+vfs.provider/random-access-not-supported.error=The file type does not support random access.
+vfs.provider/random-access-read-not-supported.error=The file type does not support read in random access mode.
+vfs.provider/random-access-write-not-supported.error=The file type does not support write in random access mode.
+vfs.provider/create-folder-not-supported.error=This file type does not support folder creation.
+vfs.provider/get-last-modified-not-supported.error=This file type does not support retriving last modified time.
+vfs.provider/set-last-modified-not-supported.error=This file type does not support setting last modified time.
+vfs.provider/set-attribute-not-supported.error=This file type does not support setting attributes.
+vfs.provider/remove-attribute-not-supported.error=This file type does not support removing attributes.
+vfs.provider/get-attribute-not-supported.error=This file type does not support getting attributes.
+vfs.provider/write-not-supported.error=This file type cannot be written to.
+vfs.provider/get-type.error=Could not determine the type of file "{0}".
+vfs.provider/list-children-not-folder.error=Could not list the contents of "{0}" because it is not a folder.
+vfs.provider/list-children.error=Could not list the contents of folder "{0}".
+vfs.provider/delete-read-only.error=Could not delete "{0}" because it is read-only.
+vfs.provider/rename-read-only.error=Could not rename "{0}" because it is read-only.
+vfs.provider/rename-parent-read-only.error=Could not rename "{0}" because "{1}" is read-only.
+vfs.provider/rename-dest-exists.error=Destination "{0}" already existent.
+vfs.provider/delete.error=Could not delete "{0}".
+vfs.provider/rename.error=Could not rename "{0}" to "{1}".
+vfs.provider/create-folder-mismatched-type.error=Could not create folder "{0}" because it already exists and is a file.
+vfs.provider/create-folder-read-only.error=Could not create folder "{0}" because its parent folder is read-only.
+vfs.provider/create-folder.error=Could not create folder "{0}".
+vfs.provider/create-file.error=Could not create file "{0}".
+vfs.provider/write-read-only.error=Could not write to "{0}" because it is read-only.
+vfs.provider/write-not-file.error=Could not write to "{0}" because it is not a file.
+vfs.provider/write.error=Could not write to "{0}".
+vfs.provider/copy-file.error=Could not copy "{0}" to "{1}".
+vfs.provider/rename-filename.error=You can only rename within the same folder. Invalid Filename: "{0}".
+vfs.provider/copy-read-only.error=Could not copy {0} "{1}" to "{2}" because the destination file is read-only.
+vfs.provider/copy-missing-file.error=Could not copy "{0}" because it does not exist.
+vfs.provider/find-files.error=Could not find files in "{0}".
+vfs.provider/check-is-hidden.error=Could not determine if file "{0}" is hidden.
+vfs.provider/check-is-writeable.error=Could not determine if file "{0}" is writeable.
+vfs.provider/check-is-readable.error=Could not determine if file "{0}" is readable.
+vfs.provider/get-url.error=Could not create URL for "{0}".
+vfs.provider/resync.error=Could not resync "{0}".
+vfs.provider/close.error=Could not close "{0}".
+vfs.provider/read.error=Could not read file "{0}".
+vfs.provider/random-access.error=Could not read/write file "{0}".
+vfs.provider/read-not-readable.error=File "{0}" is not readable.
+vfs.provider/read-not-file.error=Could not read from "{0}" because it is a not a file.
+vfs.provider/closed.error=File closed.
+
+# DefaultFileContent
+vfs.provider/get-size-not-file.error=Could not determine the size of "{0}" because it is not a file.
+vfs.provider/get-size-write.error=Could not determine the size of file "{0}" because it is being written to.
+vfs.provider/get-size.error=Could not determine the size of file "{0}".
+vfs.provider/read-in-use.error=Could not read file "{0}" because it is currently being written to.
+vfs.provider/write-in-use.error=Could not write to "{0}" because it is currently in use.
+vfs.provider/random-in-use.error=Could not read/write file "{0}" because it is currently in use.
+vfs.provider/get-last-modified-writing.error=Could not determine the last modified timestamp of "{0}" because it is being written to.
+vfs.provider/get-last-modified-no-exist.error=Could not determine the last modified timestamp of "{0}" because it does not exist.
+vfs.provider/get-last-modified.error=Could not determine the last modified timestamp of "{0}".
+vfs.provider/set-last-modified-writing.error=Could not set the last modified timestamp of "{0}" because it is being written to.
+vfs.provider/set-last-modified-no-exist.error=Could not set the last modified timestamp of "{0}" because it does not exist.
+vfs.provider/set-last-modified.error=Could not set the last modified timestamp of "{0}".
+vfs.provider/get-certificates-no-exist.error=Could not retrieve the certificates of "{0}" because it does not exist.
+vfs.provider/get-certificates-writing.error=Could not retrieve the certificates of "{0}" because it is being written to.
+vfs.provider/get-certificates.error=Could not retrieve the certificates of "{0}".
+vfs.provider/close-instr.error=Could not close the input stream for file "{0}".
+vfs.provider/close-outstr.error=Could not close the output stream for file "{0}".
+vfs.provider/exists-attribute-no-exist.error=Could not check if attribute "{0}" of "{1}" exists because attributes are not supported.
+vfs.provider/get-attributes-no-exist.error=Could not get attributes for file "{0}" because it does not exist.
+vfs.provider/get-attributes.error=Could not get attributes "{0}".
+vfs.provider/set-attribute-no-exist.error=Could not set attribute "{0}" of "{1}" because it does not exist.
+vfs.provider/set-attribute.error=Could not set attribute "{0}" of "{1}".
+vfs.provider/remove-attribute-no-exist.error=Could not check if attribute "{0}" of "{1}" exists because attributes are not supported.
+vfs.provider/remove-attribute.error=Could not remove attribute "{0}" of "{1}".
+
+# AbstractFileSystemProvider
+vfs.provider/invalid-absolute-uri.error=Invalid absolute URI "{0}".
+vfs.provider/not-layered-fs.error=File system for URL scheme "{0}" is not a layered file system.
+vfs.provider/no-config-builder.error=File provider for URL scheme "{0}" do not provide a configuration builder.
+vfs.provider/config-key-invalid.error=The configuration builder for scheme "{0}" has no option "{1}".
+vfs.provider/config-value-invalid.error=The delegating configuration builder cant convert value "{2}" for key "{1}" scheme "{0}".
+vfs.provider/config-too-many-values.error=Too many values for configuration builder for scheme "{0}" key "{1}".
+vfs.provider/config-unexpected-primitive.error=Unexpected primitive "{0}".
+vfs.provider/config-unexpected-value-class.error=Cant convert a "{0}" value for scheme "{1}" key "{2}".
+
+# AbstractFileSystem
+vfs.provider/files-cache-missing.error=No files-cache implementation set.
+vfs.provider/mismatched-fs-for-name.error=Incorrect file system URI "{2}" in name "{0}", was expecting "{1}".
+vfs.provider/junctions-not-supported.error=Junctions not supported for file system "{0}".
+vfs.provider/notify-listener.warn=Could not notify listener of change to "{0}".
+vfs.provider/replicate-missing-file.error=Could not replicate "{0}" as it does not exist.
+vfs.provider/replicate-file.error=Could not replicate "{0}".
+vfs.provider/resolve-file.error=Could not resolve file "{0}".
+
+# AbstractFileProvider
+vfs.provider/filename-parser-missing.error=No filename-parser implementation set.
+
+# AbstractFileName
+vfs.provider/filename-type.error=A filename can only be of type FileType.FOLDER or FileType.FILE
+
+# Operations
+vfs.operation/wrong-type.error=Can't lookup operation, wrong type: "{0}"
+vfs.operation/not-found.error=Operation not found, type: "{0}"
+vfs.operation/cant-register.error=Can't register operation, wrong type: "{0}"
+vfs.operation/operation-not-supported.error=Operation "{0}" not supported.
+vfs.operation/operation-provider-already-added.error=Operation provider already added to scheme "{0}"
+
+# RandomAccess
+vfs.provider/random-access-invalid-position.error=Invalid position: "{0}"
+vfs.provider/random-access-open-failed.error=Could not access file "{0}" because it does not exist.
+
+# UriParser
+vfs.provider/missing-double-slashes.error=Expecting // to follow the scheme in URI "{0}".
+vfs.provider/missing-hostname.error=Hostname missing from URI "{0}".
+vfs.provider/missing-port.error=Port number is missing from URI "{0}".
+vfs.provider/missing-hostname-path-sep.error=Expecting / to follow the hostname in URI "{0}".
+vfs.provider/invalid-descendent-name.error=Invalid descendent file name "{0}".
+vfs.provider/invalid-escape-sequence.error=Invalid URI escape sequence "{0}".
+vfs.provider/invalid-relative-path.error=Invalid relative file name.
+
+# DefaultFileSystemManager
+vfs.impl/unknown-scheme.error=Unknown scheme "{0}" in URI "{1}".
+vfs.impl/find-rel-file.error=Could not find file with URI "{0}" because it is a relative path, and no base URI was provided.
+vfs.impl/multiple-providers-for-scheme.error=Multiple providers registered for URL scheme "{0}".
+vfs.impl/configuration-already-set.error=FilesCache implementation already set.
+vfs.impl/configuration-already-in-use.error=The configuration is already attached to an filesystemmanager. You cant change it anymore.
+vfs.impl/unknown-provider.error=No file provider is registered with URI scheme "{0}" to handle file "{1}".
+vfs.impl/no-provider-for-file.error=Could not find a file provider that can handle file "{0}".
+vfs.impl/no-local-file-provider.error=Could not find a file provider which can handle local files.
+vfs.impl/no-replicator.error=No file replicator configured.
+vfs.impl/no-temp-file-store.error=No temporary file store configured.
+vfs.impl/replicate-file.error=Could not replicate "{0}".
+vfs.impl/delete-temp.warn=Could not clean up temporary file "{0}".
+vfs.impl/init-replicator.error=Could not initialise file replicator.
+vfs.impl/already-inited.error=Manager already inited, cant change the configuration now.
+vfs.impl/invalid-decorator.error="{0}" is not a valid decorator. It has to extend "DecoratedFileObject" and must provide a single argument constructor which takes a "FileObject"
+vfs.impl/temp-dir.info=Using "{0}" as temporary files store.
+
+# StandardFileSystemManager
+vfs.impl/find-config-file.error=Could not find VFS configuration resource "{0}".
+vfs.impl/load-config.error=Could not load VFS configuration from "{0}".
+vfs.impl/create-provider.error=Could not create file provider of class "{0}".
+vfs.impl/create-files-cache.error=Could not create files-cache implementation of class "{0}".
+vfs.impl/create-client-factory.error=Could not create client factory of class "{0}".
+vfs.impl/skipping-provider.debug=Skipping provider "{0}" because required class "{1}" is not available.
+vfs.impl/skipping-provider-scheme.debug=Skipping provider "{0}" because required scheme "{1}" is not available.
+
+# FileTypeMap
+vfs.impl/multiple-schemes.error=This file requires multiple schemes. Use getSchemes() instead.
+
+# VFSClassLoader
+vfs.impl/pkg-sealing-unsealed=Trying to seal package "{0}" that exists as unsealed.
+vfs.impl/pkg-sealed-other-url=Package "{0}" exists and is sealed with other URL.
+
+# VirtualFileSystem
+vfs.impl/nested-junction.error=Attempting to create a nested junction at "{0}". Nested junctions are not supported.
+vfs.impl/create-junction.error=Could not create a junction at "{0}".
+
+# SoftRefFilesCache
+vfs.impl/SoftRefReleaseThread-interrupt.info=SoftRefFilesCache - Release Thread interrupted.
+vfs.impl/SoftRefReleaseThread-already-running.warn=SoftRefFilesCache - Release Thread already running.
+
+# Local Provider
+vfs.provider.local/get-type.error=Could not determine the type of "{0}".
+vfs.provider.local/delete-file.error=Could not delete "{0}".
+vfs.provider.local/rename-file.error=Could not rename file "{0}" to "{1}".
+vfs.provider.local/create-folder.error=Could not create directory "{0}".
+vfs.provider.local/not-absolute-file-name.error=URI "{0}" is not an absolute file name.
+vfs.provider.local/missing-share-name.error=Share name missing from UNC file name "{0}".
+
+# Temp Provider
+vfs.provider.temp/get-type.error=Could not determine the type of "{0}".
+vfs.provider.temp/delete-file.error=Could not delete "{0}".
+vfs.provider.temp/rename-file.error=Could not rename file "{0}" to "{1}".
+vfs.provider.temp/create-folder.error=Could not create directory "{0}".
+vfs.provider.temp/not-absolute-file-name.error=URI "{0}" is not an absolute file name.
+vfs.provider.temp/missing-share-name.error=Share name missing from UNC file name "{0}".
+
+# SMB Provider
+vfs.provider.smb/missing-share-name.error=The share name is missing from URI "{0}".
+vfs.provider.smb/get-type.error=Could not detemine the type of "{0}".
+
+# Zip Provider
+vfs.provider.zip/open-zip-file.error=Could not open Zip file "{0}".
+vfs.provider.zip/close-zip-file.error=Could not close Zip file "{0}".
+
+# Bzip2 Provider
+vfs.provider.bzip2/not-a-bzip2-file.error=File "{0}" is not bzip2 compressed.
+
+# JarFileSystem
+vfs.provider.jar/open-jar-file.error=Could not open Jar file "{0}".
+
+# JarURLConnectionImpl
+vfs.provider.jar/jar-file-no-access.error=JarURLConnections in VFS does not give access to the JarFile.
+vfs.provider.jar/jar-entry-no-access.error=JarURLConnections in VFS does not give access to the JarEntry.
+
+# FTP Provider
+vfs.provider.ftp/get-type.error=Could not determine the file type of "{0}".
+vfs.provider.ftp/delete-file.error=Could not delete FTP file "{0}".
+vfs.provider.ftp/rename-file.error=Could not rename FTP file "{0}" to "{1}".
+vfs.provider.ftp/create-folder.error=Could not create FTP directory "{0}".
+vfs.provider.ftp/finish-get.error=Could not get FTP file "{0}".
+vfs.provider.ftp/finish-put.error=Could not put FTP file "{0}".
+vfs.provider.ftp/connect-rejected.error=Connection to FTP server on "{0}" rejected.
+vfs.provider.ftp/login.error=Could not login to FTP server on "{0}" as user "{1}".
+vfs.provider.ftp/set-binary.error=Could not switch to binary transfer mode.
+vfs.provider.ftp/connect.error=Could not connect to FTP server on "{0}".
+vfs.provider.ftp/close-connection.error=Could not close connection to FTP server.
+vfs.provider.ftp/change-work-directory.error=Could not change to work directory "{0}".
+vfs.provider.ftp/invalid-directory-entry.debug=Invalid directory entry at line "{0}" (directory "{1}").
+vfs.provider.ftp/output-error.debug=Cant open output connection for file "{0}". Reason: "{1}".
+vfs.provider.ftp/input-error.debug=Cant open input connection for file "{0}". Reason: "{1}".
+vfs.provider.ftp.wrapper/change-work-directory-back.error=Could not change back to work directory "{0}".
+
+# URL Provider
+vfs.provider.url/badly-formed-uri.error=Badly formed URI "{0}".
+
+# Http Provider
+vfs.provider.http/get.error=GET method failed for "{0}".
+vfs.provider.http/head.error=HEAD method failed for "{0}".
+vfs.provider.http/last-modified.error=No Last-Modified header in HTTP response.
+vfs.provider.http/get-range.error=GET method failed for "{0}" range "{1}-".
+vfs.provider.http/connect.error=Could not connect to HTTP server on "{0}".
+
+# WebDAV Provider
+vfs.provider.webdav/write-file.error=Write to file failed with message: "{0}".
+vfs.provider.webdav/list-children.error=List child resources failed with message: "{0}".
+vfs.provider.webdav/create-collection.error=Create collection failed with message: "{0}".
+vfs.provider.webdav/delete-file.error=Delete file failed with message: "{0}".
+vfs.provider.webdav/create-client.error=Could not create client for server "{0}".
+vfs.provider.webdav/rename-file.error=Rename file failed with message: "{0}".
+
+# SFTP Provider
+vfs.provider.sftp/connect.error=Could not connect to SFTP server at "{0}".
+vfs.provider.sftp/change-work-directory.error=Could not change to work directory "{0}".
+vfs.provider.sftp/unknown-permissions.error=File permissions not fetched.
+vfs.provider.sftp/unknown-size.error=File size not fetched.
+vfs.provider.sftp/create-folder.error=Folder creation failed with unknown error.
+vfs.provider.sftp/delete.error=Delete failed with unknown error.
+vfs.provider.sftp/list-children.error=List folder contents failed with unknown error.
+vfs.provider.sftp/put-file.error=Write file contents failed with unknown error.
+vfs.provider.sftp/get-file.error=Read file contents failed with unknown error.
+vfs.provider.sftp/load-private-key.error=Could not load private key from "{0}".
+vfs.provider.sftp/config-sshdir.error=SSH-Folder "{0}" non existent or not a folder.
+vfs.provider.sftp/unknown-modtime.error=Last modification time not fetched.
+vfs.provider.sftp/known-hosts.error=Error during processing known-hosts file "{0}".
+vfs.provider.sftp/StrictHostKeyChecking-arg.error=Illegal argument "{0}" hostKeyChecking can only be "ask", "yes" or "no"
+vfs.provider.sftp/change-work-directory-back.error=Could not change back to work directory "{0}".
+
+# Ant tasks
+vfs.tasks/sync.no-destination.error=No destination file or directory specified.
+vfs.tasks/sync.too-many-destinations.error=Cannot specify both a destination file and a destination directory.
+vfs.tasks/sync.no-source-files.warn=No source files specified.
+vfs.tasks/sync.no-source-file.error=No source file specified.
+vfs.tasks/sync.too-many-source-files.error=Too many source files specified.
+vfs.tasks/sync.source-not-file.error=Source file "{0}" is not a file, or does not exist.
+vfs.tasks/sync.src-file-no-exist.warn=Source file "{0}" does not exist.
+vfs.tasks/sync.duplicate-source-files.warn=Multiple source files for destination file "{0}".
+vfs.tasks/delete.no-source-files.error=No files to delete specified.
+vfs.tasks/mkdir.create-folder.info=Creating directory "{0}".
+
+# Selectors
+vfs.selectors/filefilter.missing.error=Configure a fileFilter or override accept();
+
+# Utils
+vfs.util/find-abstract-file-object.error=Object didnt extend from AbstractFileObject. Object "{0}"
+vfs.util/missing-capability.error=The Filesystem do not provide the required capability "{0}"
\ No newline at end of file