You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by rg...@apache.org on 2009/04/13 06:06:06 UTC
svn commit: r764356 [4/11] - in /commons/proper/vfs/trunk: ./
core/src/main/java/org/apache/commons/vfs/
core/src/main/java/org/apache/commons/vfs/auth/
core/src/main/java/org/apache/commons/vfs/cache/
core/src/main/java/org/apache/commons/vfs/events/ ...
Modified: commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs/impl/VirtualFileProvider.java
URL: http://svn.apache.org/viewvc/commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs/impl/VirtualFileProvider.java?rev=764356&r1=764355&r2=764356&view=diff
==============================================================================
--- commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs/impl/VirtualFileProvider.java (original)
+++ commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs/impl/VirtualFileProvider.java Mon Apr 13 04:06:01 2009
@@ -5,9 +5,9 @@
* 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.
@@ -34,6 +34,9 @@
{
/**
* Creates a virtual file system, with the supplied file as its root.
+ * @param rootFile The root of the file system.
+ * @return A FileObject in the FileSystem.
+ * @throws FileSystemException if an error occurs.
*/
public FileObject createFileSystem(final FileObject rootFile)
throws FileSystemException
@@ -50,6 +53,9 @@
/**
* Creates an empty virtual file system.
+ * @param rootUri The root of the file system.
+ * @return A FileObject in the FileSystem.
+ * @throws FileSystemException if an error occurs.
*/
public FileObject createFileSystem(final String rootUri) throws FileSystemException
{
Modified: commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs/impl/VirtualFileSystem.java
URL: http://svn.apache.org/viewvc/commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs/impl/VirtualFileSystem.java?rev=764356&r1=764355&r2=764356&view=diff
==============================================================================
--- commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs/impl/VirtualFileSystem.java (original)
+++ commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs/impl/VirtualFileSystem.java Mon Apr 13 04:06:01 2009
@@ -5,9 +5,9 @@
* 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.
@@ -98,6 +98,9 @@
/**
* Adds a junction to this file system.
+ * @param junctionPoint The location of the junction.
+ * @param targetFile The target file to base the junction on.
+ * @throws FileSystemException if an error occurs.
*/
public void addJunction(final String junctionPoint,
final FileObject targetFile)
@@ -140,8 +143,8 @@
{
done = file.exists();
}
-
- // As this is the parent of our junction it has to be a folder
+
+ // As this is the parent of our junction it has to be a folder
file.attachChild(childName, FileType.FOLDER);
}
@@ -155,6 +158,8 @@
/**
* Removes a junction from this file system.
+ * @param junctionPoint The junction to remove.
+ * @throws FileSystemException if an error occurs.
*/
public void removeJunction(final String junctionPoint)
throws FileSystemException
@@ -168,6 +173,8 @@
/**
* Locates the junction point for the junction containing the given file.
+ * @param name The FileName.
+ * @return the FileName where the junction occurs.
*/
private FileName getJunctionForFile(final FileName name)
{
Modified: commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs/operations/AbstractFileOperation.java
URL: http://svn.apache.org/viewvc/commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs/operations/AbstractFileOperation.java?rev=764356&r1=764355&r2=764356&view=diff
==============================================================================
--- commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs/operations/AbstractFileOperation.java (original)
+++ commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs/operations/AbstractFileOperation.java Mon Apr 13 04:06:01 2009
@@ -20,32 +20,30 @@
/**
* todo: add class description here
- *
+ *
* @author Siarhei Baidun
* @since 0.1
*/
public abstract class AbstractFileOperation implements FileOperation
{
- /**
- * FileObject which the FileOperation is operate on.
- */
- private FileObject fileObject;
+ /**
+ * FileObject which the FileOperation is operate on.
+ */
+ private FileObject fileObject;
- /**
- *
- * @param file
- */
- public AbstractFileOperation(final FileObject file)
- {
- fileObject = file;
- }
+ /**
+ * @param file The FileObject.
+ */
+ public AbstractFileOperation(final FileObject file)
+ {
+ fileObject = file;
+ }
- /**
- *
- * @return an instance of FileObject which this FileOperation is operate on.
- */
- protected FileObject getFileObject()
- {
- return fileObject;
- }
+ /**
+ * @return an instance of FileObject which this FileOperation is operate on.
+ */
+ protected FileObject getFileObject()
+ {
+ return fileObject;
+ }
}
Modified: commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs/operations/AbstractFileOperationProvider.java
URL: http://svn.apache.org/viewvc/commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs/operations/AbstractFileOperationProvider.java?rev=764356&r1=764355&r2=764356&view=diff
==============================================================================
--- commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs/operations/AbstractFileOperationProvider.java (original)
+++ commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs/operations/AbstractFileOperationProvider.java Mon Apr 13 04:06:01 2009
@@ -19,133 +19,136 @@
import org.apache.commons.vfs.FileSystemException;
import org.apache.commons.vfs.FileObject;
-import java.util.*;
+import java.util.Collection;
+import java.util.ArrayList;
+import java.util.Iterator;
+
/**
* todo: add class description here
- *
+ *
* @author Siarhei Baidun
* @since 0.1
*/
public abstract class AbstractFileOperationProvider implements
- FileOperationProvider
+ FileOperationProvider
{
- /**
- * Available operations. Operations could be registered for different schemes.
- * Some operations can work only for "file" scheme, other - for "svnhttp(s)",
- * "svn", "svnssh", but not for "file", etc. The Map has scheme as a key and
- * Colleaction of operations that are available for that scheme.
- */
- private Collection operations = new ArrayList();
-
- /**
- * Gather available operations for the specified FileObject and put them into
- * specified operationsList.
- *
- * @param operationsList
- * the list of available operations for the specivied FileObject.
- * The operationList contains classes of available operations, e.g.
- * Class objects.
- * @param file
- * the FileObject for which we want to get the list of available
- * operations.
- * @throws org.apache.commons.vfs.FileSystemException
- * if list of operations cannto be retrieved.
- */
- public final void collectOperations(final Collection operationsList,
- final FileObject file) throws FileSystemException
- {
-
- doCollectOperations(operations, operationsList, file);
- }
-
- /**
- *
- * @throws FileSystemException
- */
- protected abstract void doCollectOperations(
- final Collection availableOperations, final Collection resultList,
- final FileObject file) throws FileSystemException;
-
- /**
- * @param file
- * the FileObject for which we need a operation.
- * @param operationClass
- * the Class which instance we are needed.
- * @return the requried operation instance.
- * @throws org.apache.commons.vfs.FileSystemException
- * if operation cannot be retrieved.
- */
- public final FileOperation getOperation(FileObject file, Class operationClass)
- throws FileSystemException
- {
- Class implementation = lookupOperation(operationClass);
-
- FileOperation operationInstance = instantiateOperation(file, implementation);
-
- return operationInstance;
- }
-
- /**
- *
- * @param operationClass
- * @return
- * @throws FileSystemException
- */
- protected abstract FileOperation instantiateOperation(final FileObject file,
- final Class operationClass) throws FileSystemException;
-
- /**
- *
- * @param operationClass
- * @return never returns null
- */
- protected final Class lookupOperation(final Class operationClass)
- throws FileSystemException
- {
- // check validity of passed class
- if (!FileOperation.class.isAssignableFrom(operationClass))
- {
- throw new FileSystemException("vfs.operation/wrong-type.error", operationClass);
- }
-
- // find appropriate class
- Class foundClass = null;
- Iterator iterator = operations.iterator();
- while (iterator.hasNext())
- {
- Class operation = (Class) iterator.next();
- if (operationClass.isAssignableFrom(operation))
- {
- foundClass = operation;
- break;
- }
- }
-
- if (foundClass == null)
- {
- throw new FileSystemException("vfs.operation/not-found.error", operationClass);
- }
-
- return foundClass;
- }
-
- /**
- *
- * @param operationClass
- * @throws FileSystemException
- */
- protected final void addOperation(final Class operationClass)
- throws FileSystemException
- {
- // check validity of passed class
- if (!FileOperation.class.isAssignableFrom(operationClass))
- {
- throw new FileSystemException("vfs.operation/cant-register.error", operationClass);
- }
-
- // ok, lets add it to the list
- operations.add(operationClass);
- }
+ /**
+ * Available operations. Operations could be registered for different schemes.
+ * Some operations can work only for "file" scheme, other - for "svnhttp(s)",
+ * "svn", "svnssh", but not for "file", etc. The Map has scheme as a key and
+ * Colleaction of operations that are available for that scheme.
+ */
+ private Collection operations = new ArrayList();
+
+ /**
+ * Gather available operations for the specified FileObject and put them into
+ * specified operationsList.
+ *
+ * @param operationsList
+ * the list of available operations for the specivied FileObject.
+ * The operationList contains classes of available operations, e.g.
+ * Class objects.
+ * @param file
+ * the FileObject for which we want to get the list of available
+ * operations.
+ * @throws org.apache.commons.vfs.FileSystemException
+ * if list of operations cannto be retrieved.
+ */
+ public final void collectOperations(final Collection operationsList,
+ final FileObject file) throws FileSystemException
+ {
+
+ doCollectOperations(operations, operationsList, file);
+ }
+
+ /**
+ *
+ * @throws FileSystemException
+ */
+ protected abstract void doCollectOperations(
+ final Collection availableOperations, final Collection resultList,
+ final FileObject file) throws FileSystemException;
+
+ /**
+ * @param file
+ * the FileObject for which we need a operation.
+ * @param operationClass
+ * the Class which instance we are needed.
+ * @return the requried operation instance.
+ * @throws org.apache.commons.vfs.FileSystemException
+ * if operation cannot be retrieved.
+ */
+ public final FileOperation getOperation(FileObject file, Class operationClass)
+ throws FileSystemException
+ {
+ Class implementation = lookupOperation(operationClass);
+
+ FileOperation operationInstance = instantiateOperation(file, implementation);
+
+ return operationInstance;
+ }
+
+ /**
+ *
+ * @param operationClass
+ * @return
+ * @throws FileSystemException
+ */
+ protected abstract FileOperation instantiateOperation(final FileObject file,
+ final Class operationClass) throws FileSystemException;
+
+ /**
+ *
+ * @param operationClass
+ * @return never returns null
+ */
+ protected final Class lookupOperation(final Class operationClass)
+ throws FileSystemException
+ {
+ // check validity of passed class
+ if (!FileOperation.class.isAssignableFrom(operationClass))
+ {
+ throw new FileSystemException("vfs.operation/wrong-type.error", operationClass);
+ }
+
+ // find appropriate class
+ Class foundClass = null;
+ Iterator iterator = operations.iterator();
+ while (iterator.hasNext())
+ {
+ Class operation = (Class) iterator.next();
+ if (operationClass.isAssignableFrom(operation))
+ {
+ foundClass = operation;
+ break;
+ }
+ }
+
+ if (foundClass == null)
+ {
+ throw new FileSystemException("vfs.operation/not-found.error", operationClass);
+ }
+
+ return foundClass;
+ }
+
+ /**
+ *
+ * @param operationClass
+ * @throws FileSystemException
+ */
+ protected final void addOperation(final Class operationClass)
+ throws FileSystemException
+ {
+ // check validity of passed class
+ if (!FileOperation.class.isAssignableFrom(operationClass))
+ {
+ throw new FileSystemException("vfs.operation/cant-register.error", operationClass);
+ }
+
+ // ok, lets add it to the list
+ operations.add(operationClass);
+ }
}
Modified: commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs/operations/DefaultFileOperations.java
URL: http://svn.apache.org/viewvc/commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs/operations/DefaultFileOperations.java?rev=764356&r1=764355&r2=764356&view=diff
==============================================================================
--- commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs/operations/DefaultFileOperations.java (original)
+++ commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs/operations/DefaultFileOperations.java Mon Apr 13 04:06:01 2009
@@ -25,131 +25,131 @@
/**
* todo: add class description here
- *
+ *
* @author Siarhei Baidun
* @since 0.1
*/
public class DefaultFileOperations implements FileOperations
{
- /**
- *
- */
- private FileSystemManager fsmanager;
-
- /**
- *
- */
- private FileObject fileObject;
-
- /**
- *
- * @param file
- */
- public DefaultFileOperations(final FileObject file)
- {
- fileObject = file;
-
- fsmanager = file.getFileSystem().getFileSystemManager();
- }
-
- /**
- * @return
- * @throws org.apache.commons.vfs.FileSystemException
- *
- */
- public Class[] getOperations() throws FileSystemException
- {
-
- final String scheme = fileObject.getURL().getProtocol();
- final FileOperationProvider[] providers = fsmanager
- .getOperationProviders(scheme);
-
- if (providers == null)
- {
- return null;
- }
-
- final List operations = new ArrayList();
-
- for (int i = 0; i < providers.length; i++)
- {
- FileOperationProvider provider = providers[i];
-
- provider.collectOperations(operations, fileObject);
- }
-
- return (Class[]) operations.toArray(new Class[] {});
- }
-
- /**
- * @param operationClass
- * @return
- * @throws org.apache.commons.vfs.FileSystemException
- *
- */
- public FileOperation getOperation(Class operationClass)
- throws FileSystemException
- {
-
- final String scheme = fileObject.getURL().getProtocol();
- final FileOperationProvider[] providers = fsmanager
- .getOperationProviders(scheme);
-
- if (providers == null)
- {
- throw new FileSystemException(
- "vfs.provider/operation-not-supported.error", operationClass);
- }
-
- FileOperation resultOperation = null;
-
- for (int i = 0; i < providers.length; i++)
- {
- FileOperationProvider provider = providers[i];
-
- resultOperation = provider.getOperation(fileObject, operationClass);
-
- if (resultOperation != null)
- {
- break;
- }
- }
-
- if (resultOperation == null)
- {
- throw new FileSystemException(
- "vfs.provider/operation-not-supported.error", operationClass);
- }
-
- return resultOperation;
- }
-
- /**
- * @param operationClass
- * the operation's class.
- *
- * @return true if the operation of specified class is supported for current
- * FileObject and false otherwise.
- *
- * @throws org.apache.commons.vfs.FileSystemException
- *
- */
- public boolean hasOperation(Class operationClass) throws FileSystemException
- {
- Class[] operations = getOperations();
- if (operations == null)
- {
- return false;
- }
-
- for (int i = 0; i < operations.length; i++)
- {
- Class operation = operations[i];
- if (operationClass.isAssignableFrom(operation))
- {
- return true;
- }
- }
- return false;
- }
+ /**
+ *
+ */
+ private FileSystemManager fsmanager;
+
+ /**
+ *
+ */
+ private FileObject fileObject;
+
+ /**
+ *
+ * @param file
+ */
+ public DefaultFileOperations(final FileObject file)
+ {
+ fileObject = file;
+
+ fsmanager = file.getFileSystem().getFileSystemManager();
+ }
+
+ /**
+ * @return
+ * @throws org.apache.commons.vfs.FileSystemException
+ *
+ */
+ public Class[] getOperations() throws FileSystemException
+ {
+
+ final String scheme = fileObject.getURL().getProtocol();
+ final FileOperationProvider[] providers = fsmanager
+ .getOperationProviders(scheme);
+
+ if (providers == null)
+ {
+ return null;
+ }
+
+ final List operations = new ArrayList();
+
+ for (int i = 0; i < providers.length; i++)
+ {
+ FileOperationProvider provider = providers[i];
+
+ provider.collectOperations(operations, fileObject);
+ }
+
+ return (Class[]) operations.toArray(new Class[] {});
+ }
+
+ /**
+ * @param operationClass
+ * @return
+ * @throws org.apache.commons.vfs.FileSystemException
+ *
+ */
+ public FileOperation getOperation(Class operationClass)
+ throws FileSystemException
+ {
+
+ final String scheme = fileObject.getURL().getProtocol();
+ final FileOperationProvider[] providers = fsmanager
+ .getOperationProviders(scheme);
+
+ if (providers == null)
+ {
+ throw new FileSystemException(
+ "vfs.provider/operation-not-supported.error", operationClass);
+ }
+
+ FileOperation resultOperation = null;
+
+ for (int i = 0; i < providers.length; i++)
+ {
+ FileOperationProvider provider = providers[i];
+
+ resultOperation = provider.getOperation(fileObject, operationClass);
+
+ if (resultOperation != null)
+ {
+ break;
+ }
+ }
+
+ if (resultOperation == null)
+ {
+ throw new FileSystemException(
+ "vfs.provider/operation-not-supported.error", operationClass);
+ }
+
+ return resultOperation;
+ }
+
+ /**
+ * @param operationClass
+ * the operation's class.
+ *
+ * @return true if the operation of specified class is supported for current
+ * FileObject and false otherwise.
+ *
+ * @throws org.apache.commons.vfs.FileSystemException
+ *
+ */
+ public boolean hasOperation(Class operationClass) throws FileSystemException
+ {
+ Class[] operations = getOperations();
+ if (operations == null)
+ {
+ return false;
+ }
+
+ for (int i = 0; i < operations.length; i++)
+ {
+ Class operation = operations[i];
+ if (operationClass.isAssignableFrom(operation))
+ {
+ return true;
+ }
+ }
+ return false;
+ }
}
Modified: commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs/operations/FileOperation.java
URL: http://svn.apache.org/viewvc/commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs/operations/FileOperation.java?rev=764356&r1=764355&r2=764356&view=diff
==============================================================================
--- commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs/operations/FileOperation.java (original)
+++ commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs/operations/FileOperation.java Mon Apr 13 04:06:01 2009
@@ -35,22 +35,22 @@
* </p>
* <p>
* FileOperation is provided by
- *
+ *
* @see FileOperationProvider Especially the FileOperationProvider is responsible
* for looking up and instantiating any concrete FileOperation.
* </p>
- *
+ *
* @author Siarhei Baidun
* @since 0.1
*/
public interface FileOperation
{
- /**
- * Performs necessary actions that are related to the concrete
- * implementation of a FileOperation.
- *
- * @throws FileSystemException
- */
- void process() throws FileSystemException;
+ /**
+ * Performs necessary actions that are related to the concrete
+ * implementation of a FileOperation.
+ *
+ * @throws FileSystemException if an error occurs
+ */
+ void process() throws FileSystemException;
}
Modified: commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs/operations/FileOperationProvider.java
URL: http://svn.apache.org/viewvc/commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs/operations/FileOperationProvider.java?rev=764356&r1=764355&r2=764356&view=diff
==============================================================================
--- commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs/operations/FileOperationProvider.java (original)
+++ commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs/operations/FileOperationProvider.java Mon Apr 13 04:06:01 2009
@@ -23,41 +23,41 @@
/**
* FileOperationProvider is responsible for dealing with FileOperation's.
- *
+ *
* @author Siarhei Baidun
* @since 0.1
*/
public interface FileOperationProvider
{
- /**
- * Gather available operations for the specified FileObject and put them into
- * specified operationsList.
- *
- * @param operationsList
- * the list of available operations for the specivied FileObject.
- * The operationList contains classes of available operations, e.g.
- * Class objects.
- * @param file
- * the FileObject for which we want to get the list of available
- * operations.
- *
- * @throws FileSystemException
- * if list of operations cannto be retrieved.
- */
- void collectOperations(final Collection operationsList, final FileObject file)
- throws FileSystemException;
+ /**
+ * Gather available operations for the specified FileObject and put them into
+ * specified operationsList.
+ *
+ * @param operationsList
+ * the list of available operations for the specivied FileObject.
+ * The operationList contains classes of available operations, e.g.
+ * Class objects.
+ * @param file
+ * the FileObject for which we want to get the list of available
+ * operations.
+ *
+ * @throws FileSystemException
+ * if list of operations cannto be retrieved.
+ */
+ void collectOperations(final Collection operationsList, final FileObject file)
+ throws FileSystemException;
- /**
- *
- * @param file
- * the FileObject for which we need a operation.
- * @param operationClass
- * the Class which instance we are needed.
- * @return the requried operation instance. s
- * @throws FileSystemException
- * if operation cannot be retrieved.
- */
- FileOperation getOperation(final FileObject file, final Class operationClass)
- throws FileSystemException;
+ /**
+ *
+ * @param file
+ * the FileObject for which we need a operation.
+ * @param operationClass
+ * the Class which instance we are needed.
+ * @return the requried operation instance. s
+ * @throws FileSystemException
+ * if operation cannot be retrieved.
+ */
+ FileOperation getOperation(final FileObject file, final Class operationClass)
+ throws FileSystemException;
}
Modified: commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs/operations/FileOperations.java
URL: http://svn.apache.org/viewvc/commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs/operations/FileOperations.java?rev=764356&r1=764355&r2=764356&view=diff
==============================================================================
--- commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs/operations/FileOperations.java (original)
+++ commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs/operations/FileOperations.java Mon Apr 13 04:06:01 2009
@@ -20,29 +20,29 @@
/**
* FileOperations interface provides API to work with operations.
- *
+ *
* @see FileOperation on what a operation in the context of VFS is.
- *
+ *
* @author Siarhei Baidun
* @since 0.1
*/
public interface FileOperations
{
- /**
- * @return all operations associated with the fileObject
- * @throws FileSystemException
- */
- Class[] getOperations() throws FileSystemException;
+ /**
+ * @return all operations associated with the fileObject
+ * @throws FileSystemException
+ */
+ Class[] getOperations() throws FileSystemException;
- /**
- * @return a operation implementing the given <code>operationClass</code>
- * @throws FileSystemException
- */
- FileOperation getOperation(Class operationClass) throws FileSystemException;
+ /**
+ * @return a operation implementing the given <code>operationClass</code>
+ * @throws FileSystemException
+ */
+ FileOperation getOperation(Class operationClass) throws FileSystemException;
- /**
- * @return if a operation <code>operationClass</code> is available
- * @throws FileSystemException
- */
- boolean hasOperation(Class operationClass) throws FileSystemException;
+ /**
+ * @return if a operation <code>operationClass</code> is available
+ * @throws FileSystemException
+ */
+ boolean hasOperation(Class operationClass) throws FileSystemException;
}
Modified: commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs/operations/vcs/VcsAdd.java
URL: http://svn.apache.org/viewvc/commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs/operations/vcs/VcsAdd.java?rev=764356&r1=764355&r2=764356&view=diff
==============================================================================
--- commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs/operations/vcs/VcsAdd.java (original)
+++ commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs/operations/vcs/VcsAdd.java Mon Apr 13 04:06:01 2009
@@ -20,21 +20,21 @@
/**
* todo: add class description here
- *
+ *
* @author Siarhei Baidun
* @since 0.1
*/
public interface VcsAdd extends FileOperation
{
- /**
- *
- * @param makedir
- */
- void setMakedir(final boolean makedir);
+ /**
+ *
+ * @param makedir
+ */
+ void setMakedir(final boolean makedir);
- /**
- *
- * @param recirsive
- */
- void setRecursive(final boolean recirsive);
+ /**
+ *
+ * @param recirsive
+ */
+ void setRecursive(final boolean recirsive);
}
Modified: commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs/operations/vcs/VcsCheckout.java
URL: http://svn.apache.org/viewvc/commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs/operations/vcs/VcsCheckout.java?rev=764356&r1=764355&r2=764356&view=diff
==============================================================================
--- commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs/operations/vcs/VcsCheckout.java (original)
+++ commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs/operations/vcs/VcsCheckout.java Mon Apr 13 04:06:01 2009
@@ -21,36 +21,36 @@
/**
* todo: add class description here
- *
+ *
* @author Siarhei Baidun
* @since 0.1
*/
public interface VcsCheckout extends FileOperation
{
- /**
- *
- * @param revision
- */
- void setRevision(final long revision);
+ /**
+ *
+ * @param revision
+ */
+ void setRevision(final long revision);
- /**
- *
- * @param recursive
- */
- void setRecursive(final boolean recursive);
+ /**
+ *
+ * @param recursive
+ */
+ void setRecursive(final boolean recursive);
- /**
- *
- * @param targetDir
- * directory under which retrieved files should be placed.
- */
- void setTargetDirectory(final FileObject targetDir);
+ /**
+ *
+ * @param targetDir
+ * directory under which retrieved files should be placed.
+ */
+ void setTargetDirectory(final FileObject targetDir);
- /**
- * @param export
- * if true, administrative .svn directoies will not be created on
- * the retrieved tree. The checkout operation in this case is
- * equivalent to export function.
- */
- void setExport(final boolean export);
+ /**
+ * @param export
+ * if true, administrative .svn directoies will not be created on
+ * the retrieved tree. The checkout operation in this case is
+ * equivalent to export function.
+ */
+ void setExport(final boolean export);
}
Modified: commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs/operations/vcs/VcsCommit.java
URL: http://svn.apache.org/viewvc/commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs/operations/vcs/VcsCommit.java?rev=764356&r1=764355&r2=764356&view=diff
==============================================================================
--- commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs/operations/vcs/VcsCommit.java (original)
+++ commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs/operations/vcs/VcsCommit.java Mon Apr 13 04:06:01 2009
@@ -20,34 +20,34 @@
/**
* todo: add class description here
- *
+ *
* @author Siarhei Baidun
* @since 0.1
*/
public interface VcsCommit extends FileOperation
{
- /**
- *
- * @param isRecursive
- */
- void setRecursive(final boolean isRecursive);
+ /**
+ *
+ * @param isRecursive
+ */
+ void setRecursive(final boolean isRecursive);
- /**
- *
- * @param message
- */
- void setMessage(final String message);
+ /**
+ *
+ * @param message
+ */
+ void setMessage(final String message);
- /**
- *
- * @param listener
- */
- void addCommitListener(final VcsCommitListener listener);
+ /**
+ *
+ * @param listener
+ */
+ void addCommitListener(final VcsCommitListener listener);
- /**
- *
- * @param listener
- */
- void removeCommitListener(final VcsCommitListener listener);
+ /**
+ *
+ * @param listener
+ */
+ void removeCommitListener(final VcsCommitListener listener);
}
Modified: commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs/operations/vcs/VcsCommitListener.java
URL: http://svn.apache.org/viewvc/commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs/operations/vcs/VcsCommitListener.java?rev=764356&r1=764355&r2=764356&view=diff
==============================================================================
--- commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs/operations/vcs/VcsCommitListener.java (original)
+++ commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs/operations/vcs/VcsCommitListener.java Mon Apr 13 04:06:01 2009
@@ -18,18 +18,18 @@
/**
* todo: add class description here
- *
+ *
* @author Siarhei Baidun
* @since 0.1
*/
public interface VcsCommitListener
{
- /**
- *
- * @param path
- * @param contentStatus
- * takes one of the values as defined in the
- * @see VcsStatus constants.
- */
- void commited(final String path, final int contentStatus);
+ /**
+ *
+ * @param path
+ * @param contentStatus
+ * takes one of the values as defined in the
+ * @see VcsStatus constants.
+ */
+ void commited(final String path, final int contentStatus);
}
Modified: commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs/operations/vcs/VcsDelete.java
URL: http://svn.apache.org/viewvc/commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs/operations/vcs/VcsDelete.java?rev=764356&r1=764355&r2=764356&view=diff
==============================================================================
--- commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs/operations/vcs/VcsDelete.java (original)
+++ commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs/operations/vcs/VcsDelete.java Mon Apr 13 04:06:01 2009
@@ -20,15 +20,15 @@
/**
* todo: add class description here
- *
+ *
* @author Siarhei Baidun
* @since 0.1
*/
public interface VcsDelete extends FileOperation
{
- /**
- *
- * @param force
- */
- void setForce(final boolean force);
+ /**
+ *
+ * @param force
+ */
+ void setForce(final boolean force);
}
Modified: commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs/operations/vcs/VcsLog.java
URL: http://svn.apache.org/viewvc/commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs/operations/vcs/VcsLog.java?rev=764356&r1=764355&r2=764356&view=diff
==============================================================================
--- commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs/operations/vcs/VcsLog.java (original)
+++ commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs/operations/vcs/VcsLog.java Mon Apr 13 04:06:01 2009
@@ -20,27 +20,27 @@
/**
* todo: add class description here
- *
+ *
* @author Siarhei Baidun
* @since 0.1
*/
public interface VcsLog extends FileOperation
{
- /**
- *
- * @param startRev
- */
- void setStartRevision(final long startRev);
+ /**
+ *
+ * @param startRev
+ */
+ void setStartRevision(final long startRev);
- /**
- *
- * @param endRev
- */
- void setEndRevision(final long endRev);
+ /**
+ *
+ * @param endRev
+ */
+ void setEndRevision(final long endRev);
- /**
- *
- * @param handler
- */
- void setLogEntryHandler(final VcsLogEntryHandler handler);
+ /**
+ *
+ * @param handler
+ */
+ void setLogEntryHandler(final VcsLogEntryHandler handler);
}
Modified: commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs/operations/vcs/VcsLogEntry.java
URL: http://svn.apache.org/viewvc/commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs/operations/vcs/VcsLogEntry.java?rev=764356&r1=764355&r2=764356&view=diff
==============================================================================
--- commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs/operations/vcs/VcsLogEntry.java (original)
+++ commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs/operations/vcs/VcsLogEntry.java Mon Apr 13 04:06:01 2009
@@ -20,96 +20,96 @@
/**
* todo: add class description here
- *
+ *
* @author Siarhei Baidun
* @since 0.1
*/
public class VcsLogEntry
{
- /**
- *
- */
- private String author;
-
- /**
- * Revision.
- */
- private long revision;
-
- /**
- * Message.
- */
- private String message;
-
- /**
- * Date.
- */
- private Calendar date;
-
- /**
- * Path.
- */
- private String path;
-
- /**
- *
- * @param revision
- * @param message
- * @param date
- * @param path
- */
- public VcsLogEntry(final String author, final long revision,
- final String message, final Calendar date, final String path)
- {
- this.author = author;
- this.revision = revision;
- this.message = message;
- this.date = date;
- this.path = path;
- }
-
- /**
- *
- * @return
- */
- public String getAuthor()
- {
- return author;
- }
-
- /**
- *
- * @return
- */
- public long getRevision()
- {
- return revision;
- }
-
- /**
- *
- * @return
- */
- public String getMessage()
- {
- return message;
- }
-
- /**
- *
- * @return
- */
- public Calendar getDate()
- {
- return date;
- }
-
- /**
- *
- * @return
- */
- public String getPath()
- {
- return path;
- }
+ /**
+ *
+ */
+ private String author;
+
+ /**
+ * Revision.
+ */
+ private long revision;
+
+ /**
+ * Message.
+ */
+ private String message;
+
+ /**
+ * Date.
+ */
+ private Calendar date;
+
+ /**
+ * Path.
+ */
+ private String path;
+
+ /**
+ *
+ * @param revision
+ * @param message
+ * @param date
+ * @param path
+ */
+ public VcsLogEntry(final String author, final long revision,
+ final String message, final Calendar date, final String path)
+ {
+ this.author = author;
+ this.revision = revision;
+ this.message = message;
+ this.date = date;
+ this.path = path;
+ }
+
+ /**
+ *
+ * @return
+ */
+ public String getAuthor()
+ {
+ return author;
+ }
+
+ /**
+ *
+ * @return
+ */
+ public long getRevision()
+ {
+ return revision;
+ }
+
+ /**
+ *
+ * @return
+ */
+ public String getMessage()
+ {
+ return message;
+ }
+
+ /**
+ *
+ * @return
+ */
+ public Calendar getDate()
+ {
+ return date;
+ }
+
+ /**
+ *
+ * @return
+ */
+ public String getPath()
+ {
+ return path;
+ }
}
Modified: commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs/operations/vcs/VcsLogEntryHandler.java
URL: http://svn.apache.org/viewvc/commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs/operations/vcs/VcsLogEntryHandler.java?rev=764356&r1=764355&r2=764356&view=diff
==============================================================================
--- commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs/operations/vcs/VcsLogEntryHandler.java (original)
+++ commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs/operations/vcs/VcsLogEntryHandler.java Mon Apr 13 04:06:01 2009
@@ -20,16 +20,16 @@
/**
* todo: add class description here
- *
+ *
* @author Siarhei Baidun
* @since 0.1
*/
public interface VcsLogEntryHandler
{
- /**
- *
- * @param entry
- * @throws FileSystemException
- */
- void handleLogEntry(final VcsLogEntry entry) throws FileSystemException;
+ /**
+ *
+ * @param entry
+ * @throws FileSystemException
+ */
+ void handleLogEntry(final VcsLogEntry entry) throws FileSystemException;
}
Modified: commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs/operations/vcs/VcsModifyListener.java
URL: http://svn.apache.org/viewvc/commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs/operations/vcs/VcsModifyListener.java?rev=764356&r1=764355&r2=764356&view=diff
==============================================================================
--- commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs/operations/vcs/VcsModifyListener.java (original)
+++ commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs/operations/vcs/VcsModifyListener.java Mon Apr 13 04:06:01 2009
@@ -18,16 +18,16 @@
/**
* todo: add class description here
- *
+ *
* @author Siarhei Baidun
* @since 0.1
*/
public interface VcsModifyListener
{
- /**
- *
- * @param path
- * @param contentStatus
- */
- void modified(final String path, final int contentStatus);
+ /**
+ *
+ * @param path
+ * @param contentStatus
+ */
+ void modified(final String path, final int contentStatus);
}
Modified: commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs/operations/vcs/VcsRevert.java
URL: http://svn.apache.org/viewvc/commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs/operations/vcs/VcsRevert.java?rev=764356&r1=764355&r2=764356&view=diff
==============================================================================
--- commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs/operations/vcs/VcsRevert.java (original)
+++ commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs/operations/vcs/VcsRevert.java Mon Apr 13 04:06:01 2009
@@ -24,27 +24,27 @@
* other words, VcsRevert replaces working copy file with the latest version
* from the repository.
* </p>
- *
+ *
* @author Siarhei Baidun
* @since 0.1
*/
public interface VcsRevert extends FileOperation
{
- /**
- *
- * @param recursive
- */
- void setRecursive(final boolean recursive);
+ /**
+ *
+ * @param recursive
+ */
+ void setRecursive(final boolean recursive);
- /**
- *
- * @param listener
- */
- void addModifyListener(final VcsModifyListener listener);
+ /**
+ *
+ * @param listener
+ */
+ void addModifyListener(final VcsModifyListener listener);
- /**
- *
- * @param listener
- */
- void removeModifyListener(final VcsModifyListener listener);
+ /**
+ *
+ * @param listener
+ */
+ void removeModifyListener(final VcsModifyListener listener);
}
Modified: commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs/operations/vcs/VcsStatus.java
URL: http://svn.apache.org/viewvc/commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs/operations/vcs/VcsStatus.java?rev=764356&r1=764355&r2=764356&view=diff
==============================================================================
--- commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs/operations/vcs/VcsStatus.java (original)
+++ commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs/operations/vcs/VcsStatus.java Mon Apr 13 04:06:01 2009
@@ -20,37 +20,37 @@
/**
* todo: add class description here
- *
+ *
* @author Siarhei Baidun
* @since 0.1
*/
public interface VcsStatus extends FileOperation
{
- public final static int UNKNOWN = -1;
- public final static int NOT_MODIFIED = 0;
- public final static int ADDED = 1;
- public final static int CONFLICTED = 2;
- public final static int DELETED = 3;
- public final static int MERGED = 4;
- public final static int IGNORED = 5;
- public final static int MODIFIED = 6;
- public final static int REPLACED = 7;
- public final static int UNVERSIONED = 8;
- public final static int MISSING = 9;
- public final static int OBSTRUCTED = 10;
- public final static int REVERTED = 11;
- public final static int RESOLVED = 12;
- public final static int COPIED = 13;
- public final static int MOVED = 14;
- public final static int RESTORED = 15;
- public final static int UPDATED = 16;
- public final static int EXTERNAL = 18;
- public final static int CORRUPTED = 19;
- public final static int NOT_REVERTED = 20;
+ public final static int UNKNOWN = -1;
+ public final static int NOT_MODIFIED = 0;
+ public final static int ADDED = 1;
+ public final static int CONFLICTED = 2;
+ public final static int DELETED = 3;
+ public final static int MERGED = 4;
+ public final static int IGNORED = 5;
+ public final static int MODIFIED = 6;
+ public final static int REPLACED = 7;
+ public final static int UNVERSIONED = 8;
+ public final static int MISSING = 9;
+ public final static int OBSTRUCTED = 10;
+ public final static int REVERTED = 11;
+ public final static int RESOLVED = 12;
+ public final static int COPIED = 13;
+ public final static int MOVED = 14;
+ public final static int RESTORED = 15;
+ public final static int UPDATED = 16;
+ public final static int EXTERNAL = 18;
+ public final static int CORRUPTED = 19;
+ public final static int NOT_REVERTED = 20;
- /**
- *
- * @return the status of FileObject
- */
- int getStatus();
+ /**
+ *
+ * @return the status of FileObject
+ */
+ int getStatus();
}
Modified: commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs/operations/vcs/VcsUpdate.java
URL: http://svn.apache.org/viewvc/commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs/operations/vcs/VcsUpdate.java?rev=764356&r1=764355&r2=764356&view=diff
==============================================================================
--- commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs/operations/vcs/VcsUpdate.java (original)
+++ commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs/operations/vcs/VcsUpdate.java Mon Apr 13 04:06:01 2009
@@ -20,33 +20,33 @@
/**
* todo: add class description here
- *
+ *
* @author Siarhei Baidun
* @since 0.1
*/
public interface VcsUpdate extends FileOperation
{
- /**
- *
- * @param revision
- */
- void setRevision(final long revision);
+ /**
+ *
+ * @param revision
+ */
+ void setRevision(final long revision);
- /**
- *
- * @param isRecursive
- */
- void setRecursive(final boolean isRecursive);
+ /**
+ *
+ * @param isRecursive
+ */
+ void setRecursive(final boolean isRecursive);
- /**
- *
- * @param listener
- */
- void addUpdateListener(final VcsUpdateListener listener);
+ /**
+ *
+ * @param listener
+ */
+ void addUpdateListener(final VcsUpdateListener listener);
- /**
- *
- * @param listener
- */
- void removeUpdateListener(final VcsUpdateListener listener);
+ /**
+ *
+ * @param listener
+ */
+ void removeUpdateListener(final VcsUpdateListener listener);
}
Modified: commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs/operations/vcs/VcsUpdateListener.java
URL: http://svn.apache.org/viewvc/commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs/operations/vcs/VcsUpdateListener.java?rev=764356&r1=764355&r2=764356&view=diff
==============================================================================
--- commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs/operations/vcs/VcsUpdateListener.java (original)
+++ commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs/operations/vcs/VcsUpdateListener.java Mon Apr 13 04:06:01 2009
@@ -18,19 +18,19 @@
/**
* todo: add class description here
- *
+ *
* @author Siarhei Baidun
* @since 0.1
*/
public interface VcsUpdateListener
{
- /**
- *
- * @param path
- * @param revision
- * @param contentStatus
- * takes one of the values as defined in the
- * @see VcsStatus constants.
- */
- void updated(final String path, final long revision, final int contentStatus);
+ /**
+ *
+ * @param path
+ * @param revision
+ * @param contentStatus
+ * takes one of the values as defined in the
+ * @see VcsStatus constants.
+ */
+ void updated(final String path, final long revision, final int contentStatus);
}
Added: commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs/operations/vcs/package.html
URL: http://svn.apache.org/viewvc/commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs/operations/vcs/package.html?rev=764356&view=auto
==============================================================================
--- commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs/operations/vcs/package.html (added)
+++ commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs/operations/vcs/package.html Mon Apr 13 04:06:01 2009
@@ -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 version control operations.</p>
+</body>
Propchange: commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs/operations/vcs/package.html
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs/operations/vcs/package.html
------------------------------------------------------------------------------
svn:keywords = Date Author Id Revision HeadURL
Propchange: commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs/operations/vcs/package.html
------------------------------------------------------------------------------
svn:mime-type = text/html
Modified: commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs/provider/AbstractFileName.java
URL: http://svn.apache.org/viewvc/commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs/provider/AbstractFileName.java?rev=764356&r1=764355&r2=764356&view=diff
==============================================================================
--- commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs/provider/AbstractFileName.java (original)
+++ commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs/provider/AbstractFileName.java Mon Apr 13 04:06:01 2009
@@ -29,487 +29,487 @@
* @version $Revision$ $Date$
*/
public abstract class AbstractFileName
- implements FileName
+ implements FileName
{
- private final String scheme;
- private final String absPath;
- private FileType type;
-
- // Cached stuff
- private String uri;
- private String baseName;
- private String rootUri;
- private String extension;
- private String decodedAbsPath;
-
- private boolean calculateHashCode = true;
- private int calculatedHashCode;
-
- public AbstractFileName(final String scheme,
- final String absPath, FileType type)
- {
- this.rootUri = null;
- this.scheme = scheme;
- this.type = type;
- if (absPath != null && absPath.length() > 0)
- {
- if (absPath.length() > 1 && absPath.endsWith("/"))
- {
- this.absPath = absPath.substring(0, absPath.length() - 1);
- }
- else
- {
- this.absPath = absPath;
- }
- }
- else
- {
- this.absPath = ROOT_PATH;
- }
- }
-
- /**
- * Returns the hashcode for this name.
- */
- public int hashCode()
- {
- if (calculateHashCode)
- {
- calculatedHashCode = (getRootURI().hashCode() ^ getPath().hashCode());
- calculateHashCode = false;
- }
- return calculatedHashCode;
- }
-
- /**
- * Determines if this object is equal to another.
- */
- public boolean equals(final Object obj)
- {
- if (!(obj instanceof AbstractFileName))
- {
- return false;
- }
- final AbstractFileName name = (AbstractFileName) obj;
- return (getRootURI().equals(name.getRootURI()) && getPath().equals(name.getPath()));
- }
-
- /**
- * Implement Comparable
- *
- * @param obj another abstractfilename
- */
- public int compareTo(Object obj)
- {
- final AbstractFileName name = (AbstractFileName) obj;
- int ret = getRootURI().compareTo(name.getRootURI());
- if (ret != 0)
- {
- return ret;
- }
-
- // return absPath.compareTo(name.absPath);
- try
- {
- return getPathDecoded().compareTo(name.getPathDecoded());
- }
- catch (FileSystemException e)
- {
- throw new RuntimeException(e.getMessage());
- }
- }
-
- /**
- * Returns the URI of the file.
- */
- public String toString()
- {
- return getURI();
- }
-
- /**
- * Factory method for creating name instances.
- */
- public abstract FileName createName(String absPath, FileType type);
-
- /**
- * Builds the root URI for this file name. Note that the root URI must not
- * end with a separator character.
- */
- protected abstract void appendRootUri(StringBuffer buffer, boolean addPassword);
-
- /**
- * Returns the base name of the file.
- */
- public String getBaseName()
- {
- if (baseName == null)
- {
- final int idx = getPath().lastIndexOf(SEPARATOR_CHAR);
- if (idx == -1)
- {
- baseName = getPath();
- }
- else
- {
- baseName = getPath().substring(idx + 1);
- }
- }
-
- return baseName;
- }
-
- /**
- * Returns the absolute path of the file, relative to the root of the
- * file system that the file belongs to.
- */
- public String getPath()
- {
- if (VFS.isUriStyle())
- {
- return absPath + getUriTrailer();
- }
- return absPath;
- }
-
- protected String getUriTrailer()
- {
- return getType().hasChildren() ? "/" : "";
- }
-
- public String getPathDecoded() throws FileSystemException
- {
- if (decodedAbsPath == null)
- {
- decodedAbsPath = UriParser.decode(getPath());
- }
-
- return decodedAbsPath;
- }
-
- /**
- * Returns the name of the parent of the file.
- */
- public FileName getParent()
- {
- final String parentPath;
- final int idx = getPath().lastIndexOf(SEPARATOR_CHAR);
- if (idx == -1 || idx == getPath().length() - 1)
- {
- // No parent
- return null;
- }
- else if (idx == 0)
- {
- // Root is the parent
- parentPath = SEPARATOR;
- }
- else
- {
- parentPath = getPath().substring(0, idx);
- }
- return createName(parentPath, FileType.FOLDER);
- }
-
- /**
- * find the root of the filesystem
- */
- public FileName getRoot()
- {
- FileName root = this;
- while (root.getParent() != null)
- {
- root = root.getParent();
- }
-
- return root;
- }
-
- /**
- * Returns the URI scheme of this file.
- */
- public String getScheme()
- {
- return scheme;
- }
-
- /**
- * Returns the absolute URI of the file.
- */
- public String getURI()
- {
- if (uri == null)
- {
- uri = createURI();
- }
- return uri;
- }
-
- protected String createURI()
- {
- final StringBuffer buffer = new StringBuffer();
- appendRootUri(buffer, true);
- buffer.append(getPath());
- return buffer.toString();
- }
-
- /**
- * Converts a file name to a relative name, relative to this file name.
- */
- public String getRelativeName(final FileName name) throws FileSystemException
- {
- final String path = name.getPath();
-
- // Calculate the common prefix
- final int basePathLen = getPath().length();
- final int pathLen = path.length();
-
- // Deal with root
- if (basePathLen == 1 && pathLen == 1)
- {
- return ".";
- }
- else if (basePathLen == 1)
- {
- return path.substring(1);
- }
-
- final int maxlen = Math.min(basePathLen, pathLen);
- int pos = 0;
- for (; pos < maxlen && getPath().charAt(pos) == path.charAt(pos); pos++)
- {
- }
-
- if (pos == basePathLen && pos == pathLen)
- {
- // Same names
- return ".";
- }
- else if (pos == basePathLen && pos < pathLen && path.charAt(pos) == SEPARATOR_CHAR)
- {
- // A descendent of the base path
- return path.substring(pos + 1);
- }
-
- // Strip the common prefix off the path
- final StringBuffer buffer = new StringBuffer();
- if (pathLen > 1 && (pos < pathLen || getPath().charAt(pos) != SEPARATOR_CHAR))
- {
- // Not a direct ancestor, need to back up
- pos = getPath().lastIndexOf(SEPARATOR_CHAR, pos);
- buffer.append(path.substring(pos));
- }
-
- // Prepend a '../' for each element in the base path past the common
- // prefix
- buffer.insert(0, "..");
- pos = getPath().indexOf(SEPARATOR_CHAR, pos + 1);
- while (pos != -1)
- {
- buffer.insert(0, "../");
- pos = getPath().indexOf(SEPARATOR_CHAR, pos + 1);
- }
-
- return buffer.toString();
- }
-
- /**
- * Returns the root URI of the file system this file belongs to.
- */
- public String getRootURI()
- {
- if (rootUri == null)
- {
- final StringBuffer buffer = new StringBuffer();
- appendRootUri(buffer, true);
- buffer.append(SEPARATOR_CHAR);
- rootUri = buffer.toString().intern();
- }
- return rootUri;
- }
-
- /**
- * Returns the depth of this file name, within its file system.
- */
- public int getDepth()
- {
- final int len = getPath().length();
- if (len == 0 || (len == 1 && getPath().charAt(0) == SEPARATOR_CHAR))
- {
- return 0;
- }
- int depth = 1;
- for (int pos = 0; pos > -1 && pos < len; depth++)
- {
- pos = getPath().indexOf(SEPARATOR_CHAR, pos + 1);
- }
- return depth;
- }
-
- /**
- * Returns the extension of this file name.
- */
- public String getExtension()
- {
- if (extension == null)
- {
- getBaseName();
- final int pos = baseName.lastIndexOf('.');
- // if ((pos == -1) || (pos == baseName.length() - 1))
- // imario@ops.co.at: Review of patch from adagoubard@chello.nl
- // do not treat filenames like
- // .bashrc c:\windows\.java c:\windows\.javaws c:\windows\.jedit c:\windows\.appletviewer
- // as extension
- if ((pos < 1) || (pos == baseName.length() - 1))
- {
- // No extension
- extension = "";
- }
- else
- {
- extension = baseName.substring(pos + 1).intern();
- }
- }
- return extension;
- }
-
- /**
- * Determines if another file name is an ancestor of this file name.
- */
- public boolean isAncestor(final FileName ancestor)
- {
- if (!ancestor.getRootURI().equals(getRootURI()))
- {
- return false;
- }
- return checkName(ancestor.getPath(), getPath(), NameScope.DESCENDENT);
- }
-
- /**
- * Determines if another file name is a descendent of this file name.
- */
- public boolean isDescendent(final FileName descendent)
- {
- return isDescendent(descendent, NameScope.DESCENDENT);
- }
-
- /**
- * Determines if another file name is a descendent of this file name.
- */
- public boolean isDescendent(final FileName descendent,
- final NameScope scope)
- {
- if (!descendent.getRootURI().equals(getRootURI()))
- {
- return false;
- }
- return checkName(getPath(), descendent.getPath(), scope);
- }
-
- /**
- * Returns the requested or current type of this name. <br />
- * <p/>
- * The "requested" type is the one determined during resolving the name. <br/>
- * In this case the name is a {@link FileType#FOLDER} if it ends with an "/" else
- * it will be a {@link FileType#FILE}<br/>
- * </p>
- * <p/>
- * Once attached it will be changed to reflect the real type of this resource.
- * </p>
- *
- * @return {@link FileType#FOLDER} or {@link FileType#FILE}
- */
- public FileType getType()
- {
- return type;
- }
-
- /**
- * sets the type of this file e.g. when it will be attached.
- *
- * @param type {@link FileType#FOLDER} or {@link FileType#FILE}
- */
- void setType(FileType type) throws FileSystemException
- {
- if (type != FileType.FOLDER && type != FileType.FILE && type != FileType.FILE_OR_FOLDER)
- {
- throw new FileSystemException("vfs.provider/filename-type.error");
- }
-
- this.type = type;
- }
-
- /**
- * Checks whether a path fits in a particular scope of another path.
- *
- * @param basePath An absolute, normalised path.
- * @param path An absolute, normalised path.
- */
- public static boolean checkName(final String basePath,
- final String path,
- final NameScope scope)
- {
- if (scope == NameScope.FILE_SYSTEM)
- {
- // All good
- return true;
- }
-
- if (!path.startsWith(basePath))
- {
- return false;
- }
-
- int baseLen = basePath.length();
- if (VFS.isUriStyle())
- {
- // strip the trailing "/"
- baseLen--;
- }
-
- if (scope == NameScope.CHILD)
- {
- if (path.length() == baseLen
- || (baseLen > 1 && path.charAt(baseLen) != SEPARATOR_CHAR)
- || path.indexOf(SEPARATOR_CHAR, baseLen + 1) != -1)
- {
- return false;
- }
- }
- else if (scope == NameScope.DESCENDENT)
- {
- if (path.length() == baseLen
- || (baseLen > 1 && path.charAt(baseLen) != SEPARATOR_CHAR))
- {
- return false;
- }
- }
- else if (scope == NameScope.DESCENDENT_OR_SELF)
- {
- if (baseLen > 1
- && path.length() > baseLen
- && path.charAt(baseLen) != SEPARATOR_CHAR)
- {
- return false;
- }
- }
- else if (scope != NameScope.FILE_SYSTEM)
- {
- throw new IllegalArgumentException();
- }
-
- return true;
- }
-
- /**
- * returns a "friendly path", this is a path without a password.
- */
- public String getFriendlyURI()
- {
- final StringBuffer buffer = new StringBuffer();
- appendRootUri(buffer, false);
- buffer.append(getPath());
- return buffer.toString();
- }
+ private final String scheme;
+ private final String absPath;
+ private FileType type;
+
+ // Cached stuff
+ private String uri;
+ private String baseName;
+ private String rootUri;
+ private String extension;
+ private String decodedAbsPath;
+
+ private boolean calculateHashCode = true;
+ private int calculatedHashCode;
+
+ public AbstractFileName(final String scheme,
+ final String absPath, FileType type)
+ {
+ this.rootUri = null;
+ this.scheme = scheme;
+ this.type = type;
+ if (absPath != null && absPath.length() > 0)
+ {
+ if (absPath.length() > 1 && absPath.endsWith("/"))
+ {
+ this.absPath = absPath.substring(0, absPath.length() - 1);
+ }
+ else
+ {
+ this.absPath = absPath;
+ }
+ }
+ else
+ {
+ this.absPath = ROOT_PATH;
+ }
+ }
+
+ /**
+ * Returns the hashcode for this name.
+ */
+ public int hashCode()
+ {
+ if (calculateHashCode)
+ {
+ calculatedHashCode = (getRootURI().hashCode() ^ getPath().hashCode());
+ calculateHashCode = false;
+ }
+ return calculatedHashCode;
+ }
+
+ /**
+ * Determines if this object is equal to another.
+ */
+ public boolean equals(final Object obj)
+ {
+ if (!(obj instanceof AbstractFileName))
+ {
+ return false;
+ }
+ final AbstractFileName name = (AbstractFileName) obj;
+ return (getRootURI().equals(name.getRootURI()) && getPath().equals(name.getPath()));
+ }
+
+ /**
+ * Implement Comparable
+ *
+ * @param obj another abstractfilename
+ */
+ public int compareTo(Object obj)
+ {
+ final AbstractFileName name = (AbstractFileName) obj;
+ int ret = getRootURI().compareTo(name.getRootURI());
+ if (ret != 0)
+ {
+ return ret;
+ }
+
+ // return absPath.compareTo(name.absPath);
+ try
+ {
+ return getPathDecoded().compareTo(name.getPathDecoded());
+ }
+ catch (FileSystemException e)
+ {
+ throw new RuntimeException(e.getMessage());
+ }
+ }
+
+ /**
+ * Returns the URI of the file.
+ */
+ public String toString()
+ {
+ return getURI();
+ }
+
+ /**
+ * Factory method for creating name instances.
+ */
+ public abstract FileName createName(String absPath, FileType type);
+
+ /**
+ * Builds the root URI for this file name. Note that the root URI must not
+ * end with a separator character.
+ */
+ protected abstract void appendRootUri(StringBuffer buffer, boolean addPassword);
+
+ /**
+ * Returns the base name of the file.
+ */
+ public String getBaseName()
+ {
+ if (baseName == null)
+ {
+ final int idx = getPath().lastIndexOf(SEPARATOR_CHAR);
+ if (idx == -1)
+ {
+ baseName = getPath();
+ }
+ else
+ {
+ baseName = getPath().substring(idx + 1);
+ }
+ }
+
+ return baseName;
+ }
+
+ /**
+ * Returns the absolute path of the file, relative to the root of the
+ * file system that the file belongs to.
+ */
+ public String getPath()
+ {
+ if (VFS.isUriStyle())
+ {
+ return absPath + getUriTrailer();
+ }
+ return absPath;
+ }
+
+ protected String getUriTrailer()
+ {
+ return getType().hasChildren() ? "/" : "";
+ }
+
+ public String getPathDecoded() throws FileSystemException
+ {
+ if (decodedAbsPath == null)
+ {
+ decodedAbsPath = UriParser.decode(getPath());
+ }
+
+ return decodedAbsPath;
+ }
+
+ /**
+ * Returns the name of the parent of the file.
+ */
+ public FileName getParent()
+ {
+ final String parentPath;
+ final int idx = getPath().lastIndexOf(SEPARATOR_CHAR);
+ if (idx == -1 || idx == getPath().length() - 1)
+ {
+ // No parent
+ return null;
+ }
+ else if (idx == 0)
+ {
+ // Root is the parent
+ parentPath = SEPARATOR;
+ }
+ else
+ {
+ parentPath = getPath().substring(0, idx);
+ }
+ return createName(parentPath, FileType.FOLDER);
+ }
+
+ /**
+ * find the root of the filesystem
+ */
+ public FileName getRoot()
+ {
+ FileName root = this;
+ while (root.getParent() != null)
+ {
+ root = root.getParent();
+ }
+
+ return root;
+ }
+
+ /**
+ * Returns the URI scheme of this file.
+ */
+ public String getScheme()
+ {
+ return scheme;
+ }
+
+ /**
+ * Returns the absolute URI of the file.
+ */
+ public String getURI()
+ {
+ if (uri == null)
+ {
+ uri = createURI();
+ }
+ return uri;
+ }
+
+ protected String createURI()
+ {
+ final StringBuffer buffer = new StringBuffer();
+ appendRootUri(buffer, true);
+ buffer.append(getPath());
+ return buffer.toString();
+ }
+
+ /**
+ * Converts a file name to a relative name, relative to this file name.
+ */
+ public String getRelativeName(final FileName name) throws FileSystemException
+ {
+ final String path = name.getPath();
+
+ // Calculate the common prefix
+ final int basePathLen = getPath().length();
+ final int pathLen = path.length();
+
+ // Deal with root
+ if (basePathLen == 1 && pathLen == 1)
+ {
+ return ".";
+ }
+ else if (basePathLen == 1)
+ {
+ return path.substring(1);
+ }
+
+ final int maxlen = Math.min(basePathLen, pathLen);
+ int pos = 0;
+ for (; pos < maxlen && getPath().charAt(pos) == path.charAt(pos); pos++)
+ {
+ }
+
+ if (pos == basePathLen && pos == pathLen)
+ {
+ // Same names
+ return ".";
+ }
+ else if (pos == basePathLen && pos < pathLen && path.charAt(pos) == SEPARATOR_CHAR)
+ {
+ // A descendent of the base path
+ return path.substring(pos + 1);
+ }
+
+ // Strip the common prefix off the path
+ final StringBuffer buffer = new StringBuffer();
+ if (pathLen > 1 && (pos < pathLen || getPath().charAt(pos) != SEPARATOR_CHAR))
+ {
+ // Not a direct ancestor, need to back up
+ pos = getPath().lastIndexOf(SEPARATOR_CHAR, pos);
+ buffer.append(path.substring(pos));
+ }
+
+ // Prepend a '../' for each element in the base path past the common
+ // prefix
+ buffer.insert(0, "..");
+ pos = getPath().indexOf(SEPARATOR_CHAR, pos + 1);
+ while (pos != -1)
+ {
+ buffer.insert(0, "../");
+ pos = getPath().indexOf(SEPARATOR_CHAR, pos + 1);
+ }
+
+ return buffer.toString();
+ }
+
+ /**
+ * Returns the root URI of the file system this file belongs to.
+ */
+ public String getRootURI()
+ {
+ if (rootUri == null)
+ {
+ final StringBuffer buffer = new StringBuffer();
+ appendRootUri(buffer, true);
+ buffer.append(SEPARATOR_CHAR);
+ rootUri = buffer.toString().intern();
+ }
+ return rootUri;
+ }
+
+ /**
+ * Returns the depth of this file name, within its file system.
+ */
+ public int getDepth()
+ {
+ final int len = getPath().length();
+ if (len == 0 || (len == 1 && getPath().charAt(0) == SEPARATOR_CHAR))
+ {
+ return 0;
+ }
+ int depth = 1;
+ for (int pos = 0; pos > -1 && pos < len; depth++)
+ {
+ pos = getPath().indexOf(SEPARATOR_CHAR, pos + 1);
+ }
+ return depth;
+ }
+
+ /**
+ * Returns the extension of this file name.
+ */
+ public String getExtension()
+ {
+ if (extension == null)
+ {
+ getBaseName();
+ final int pos = baseName.lastIndexOf('.');
+ // if ((pos == -1) || (pos == baseName.length() - 1))
+ // imario@ops.co.at: Review of patch from adagoubard@chello.nl
+ // do not treat filenames like
+ // .bashrc c:\windows\.java c:\windows\.javaws c:\windows\.jedit c:\windows\.appletviewer
+ // as extension
+ if ((pos < 1) || (pos == baseName.length() - 1))
+ {
+ // No extension
+ extension = "";
+ }
+ else
+ {
+ extension = baseName.substring(pos + 1).intern();
+ }
+ }
+ return extension;
+ }
+
+ /**
+ * Determines if another file name is an ancestor of this file name.
+ */
+ public boolean isAncestor(final FileName ancestor)
+ {
+ if (!ancestor.getRootURI().equals(getRootURI()))
+ {
+ return false;
+ }
+ return checkName(ancestor.getPath(), getPath(), NameScope.DESCENDENT);
+ }
+
+ /**
+ * Determines if another file name is a descendent of this file name.
+ */
+ public boolean isDescendent(final FileName descendent)
+ {
+ return isDescendent(descendent, NameScope.DESCENDENT);
+ }
+
+ /**
+ * Determines if another file name is a descendent of this file name.
+ */
+ public boolean isDescendent(final FileName descendent,
+ final NameScope scope)
+ {
+ if (!descendent.getRootURI().equals(getRootURI()))
+ {
+ return false;
+ }
+ return checkName(getPath(), descendent.getPath(), scope);
+ }
+
+ /**
+ * Returns the requested or current type of this name. <br />
+ * <p/>
+ * The "requested" type is the one determined during resolving the name. <br/>
+ * In this case the name is a {@link FileType#FOLDER} if it ends with an "/" else
+ * it will be a {@link FileType#FILE}<br/>
+ * </p>
+ * <p/>
+ * Once attached it will be changed to reflect the real type of this resource.
+ * </p>
+ *
+ * @return {@link FileType#FOLDER} or {@link FileType#FILE}
+ */
+ public FileType getType()
+ {
+ return type;
+ }
+
+ /**
+ * sets the type of this file e.g. when it will be attached.
+ *
+ * @param type {@link FileType#FOLDER} or {@link FileType#FILE}
+ */
+ void setType(FileType type) throws FileSystemException
+ {
+ if (type != FileType.FOLDER && type != FileType.FILE && type != FileType.FILE_OR_FOLDER)
+ {
+ throw new FileSystemException("vfs.provider/filename-type.error");
+ }
+
+ this.type = type;
+ }
+
+ /**
+ * Checks whether a path fits in a particular scope of another path.
+ *
+ * @param basePath An absolute, normalised path.
+ * @param path An absolute, normalised path.
+ */
+ public static boolean checkName(final String basePath,
+ final String path,
+ final NameScope scope)
+ {
+ if (scope == NameScope.FILE_SYSTEM)
+ {
+ // All good
+ return true;
+ }
+
+ if (!path.startsWith(basePath))
+ {
+ return false;
+ }
+
+ int baseLen = basePath.length();
+ if (VFS.isUriStyle())
+ {
+ // strip the trailing "/"
+ baseLen--;
+ }
+
+ if (scope == NameScope.CHILD)
+ {
+ if (path.length() == baseLen
+ || (baseLen > 1 && path.charAt(baseLen) != SEPARATOR_CHAR)
+ || path.indexOf(SEPARATOR_CHAR, baseLen + 1) != -1)
+ {
+ return false;
+ }
+ }
+ else if (scope == NameScope.DESCENDENT)
+ {
+ if (path.length() == baseLen
+ || (baseLen > 1 && path.charAt(baseLen) != SEPARATOR_CHAR))
+ {
+ return false;
+ }
+ }
+ else if (scope == NameScope.DESCENDENT_OR_SELF)
+ {
+ if (baseLen > 1
+ && path.length() > baseLen
+ && path.charAt(baseLen) != SEPARATOR_CHAR)
+ {
+ return false;
+ }
+ }
+ else if (scope != NameScope.FILE_SYSTEM)
+ {
+ throw new IllegalArgumentException();
+ }
+
+ return true;
+ }
+
+ /**
+ * returns a "friendly path", this is a path without a password.
+ */
+ public String getFriendlyURI()
+ {
+ final StringBuffer buffer = new StringBuffer();
+ appendRootUri(buffer, false);
+ buffer.append(getPath());
+ return buffer.toString();
+ }
}
Modified: commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs/provider/AbstractFileObject.java
URL: http://svn.apache.org/viewvc/commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs/provider/AbstractFileObject.java?rev=764356&r1=764355&r2=764356&view=diff
==============================================================================
--- commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs/provider/AbstractFileObject.java (original)
+++ commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs/provider/AbstractFileObject.java Mon Apr 13 04:06:01 2009
@@ -80,7 +80,7 @@
{
this.name = (AbstractFileName) name;
this.fs = fs;
- fs.fileObjectHanded(this);
+ fs.fileObjectHanded(this);
}
/**
@@ -239,28 +239,28 @@
throw new FileSystemException("vfs.provider/get-last-modified-not-supported.error");
}
- /**
- * Sets the last modified time of this file. Is only called if
- * {@link #doGetType} does not return {@link FileType#IMAGINARY}.
- * <p/>
- * This implementation throws an exception.
- *
- * @return false if it was not possible to change the time
- */
- protected boolean doSetLastModTime(final long modtime)
- throws Exception
- {
- doSetLastModifiedTime(modtime);
- return true;
- }
+ /**
+ * Sets the last modified time of this file. Is only called if
+ * {@link #doGetType} does not return {@link FileType#IMAGINARY}.
+ * <p/>
+ * This implementation throws an exception.
+ *
+ * @return false if it was not possible to change the time
+ */
+ protected boolean doSetLastModTime(final long modtime)
+ throws Exception
+ {
+ doSetLastModifiedTime(modtime);
+ return true;
+ }
/**
* Sets the last modified time of this file. Is only called if
* {@link #doGetType} does not return {@link FileType#IMAGINARY}.
* <p/>
* This implementation throws an exception.
- *
- * @deprecated use {@link #doSetLastModTime}
+ *
+ * @deprecated use {@link #doSetLastModTime}
*/
protected void doSetLastModifiedTime(final long modtime)
throws Exception
@@ -297,8 +297,8 @@
* does not return {@link FileType#IMAGINARY}.
* <p/>
* This implementation throws an exception.
- * @returns true if removing the attribute succeed. In this case we remove the attribute from
- * our cache
+ * @returns true if removing the attribute succeed. In this case we remove the attribute from
+ * our cache
*/
protected void doRemoveAttribute(final String atttrName)
throws Exception
@@ -567,7 +567,7 @@
{
throw new FileNotFolderException(name);
}
-
+
/* VFS-210
if (!getType().hasChildren())
{
@@ -1121,15 +1121,15 @@
}
}
- /**
- * Create a FileContent implementation
- */
- protected FileContent doCreateFileContent() throws FileSystemException
- {
- return new DefaultFileContent(this, getFileContentInfoFactory());
- }
+ /**
+ * Create a FileContent implementation
+ */
+ protected FileContent doCreateFileContent() throws FileSystemException
+ {
+ return new DefaultFileContent(this, getFileContentInfoFactory());
+ }
- /**
+ /**
* This will prepare the fileObject to get resynchronized with the underlaying filesystem if required
*/
public void refresh() throws FileSystemException
@@ -1158,8 +1158,8 @@
try
{
content.close();
- content = null;
- }
+ content = null;
+ }
catch (FileSystemException e)
{
exc = e;
@@ -1299,7 +1299,7 @@
throw new FileSystemException("vfs.provider/write-read-only.error", name);
}
*/
-
+
if (bAppend && !getFileSystem().hasCapability(Capability.APPEND_CONTENT))
{
throw new FileSystemException("vfs.provider/write-append-not-supported.error", name);
@@ -1726,10 +1726,10 @@
return operations;
}
- protected void finalize() throws Throwable
- {
- fs.fileObjectDestroyed(this);
+ protected void finalize() throws Throwable
+ {
+ fs.fileObjectDestroyed(this);
- super.finalize();
- }
+ super.finalize();
+ }
}
Modified: commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs/provider/AbstractFileSystem.java
URL: http://svn.apache.org/viewvc/commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs/provider/AbstractFileSystem.java?rev=764356&r1=764355&r2=764356&view=diff
==============================================================================
--- commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs/provider/AbstractFileSystem.java (original)
+++ commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs/provider/AbstractFileSystem.java Mon Apr 13 04:06:01 2009
@@ -77,13 +77,13 @@
*/
private final FileSystemOptions fileSystemOptions;
- /**
- * How many fileObjects are handed out
- */
- private long useCount;
+ /**
+ * How many fileObjects are handed out
+ */
+ private long useCount;
- private FileSystemKey cacheKey;
+ private FileSystemKey cacheKey;
/**
* open streams counter for this filesystem
@@ -316,16 +316,16 @@
*/
if (getFileSystemManager().getCacheStrategy().equals(CacheStrategy.ON_RESOLVE))
{
- file.refresh();
+ file.refresh();
}
return file;
}
protected FileObject decorateFileObject(FileObject file) throws FileSystemException
- {
+ {
if (getFileSystemManager().getCacheStrategy().equals(CacheStrategy.ON_CALL))
{
- file = new OnCallRefreshFileObject(file);
+ file = new OnCallRefreshFileObject(file);
}
if (getFileSystemManager().getFileObjectDecoratorConst() != null)
@@ -349,9 +349,9 @@
}
return file;
- }
+ }
- /**
+ /**
* Creates a temporary local copy of a file and its descendents.
*/
public File replicateFile(final FileObject file,
@@ -504,39 +504,39 @@
*/
private void fireEvent(final AbstractFileChangeEvent event)
{
- FileListener[] fileListeners = null;
- final FileObject file = event.getFile();
+ FileListener[] fileListeners = null;
+ final FileObject file = event.getFile();
- synchronized (listenerMap)
+ synchronized (listenerMap)
{
final ArrayList listeners = (ArrayList) listenerMap.get(file.getName());
if (listeners != null)
{
- fileListeners = (FileListener[]) listeners.toArray(new FileListener[listeners.size()]);
- }
- }
-
- if (fileListeners != null)
- {
- for (int i = 0; i < fileListeners.length; i++)
- {
- final FileListener fileListener = fileListeners[i];
- try
- {
- event.notify(fileListener);
- }
- catch (final Exception e)
- {
- final String message = Messages.getString("vfs.provider/notify-listener.warn", file);
- // getLogger().warn(message, e);
- VfsLog.warn(getLogger(), log, message, e);
- }
- }
- }
- }
+ fileListeners = (FileListener[]) listeners.toArray(new FileListener[listeners.size()]);
+ }
+ }
- /*
- void fileDetached(FileObject fileObject)
+ if (fileListeners != null)
+ {
+ for (int i = 0; i < fileListeners.length; i++)
+ {
+ final FileListener fileListener = fileListeners[i];
+ try
+ {
+ event.notify(fileListener);
+ }
+ catch (final Exception e)
+ {
+ final String message = Messages.getString("vfs.provider/notify-listener.warn", file);
+ // getLogger().warn(message, e);
+ VfsLog.warn(getLogger(), log, message, e);
+ }
+ }
+ }
+ }
+
+ /*
+ void fileDetached(FileObject fileObject)
{
useCount--;
}
@@ -546,19 +546,19 @@
useCount++;
}
- */
+ */
+
+ void fileObjectHanded(FileObject fileObject)
+ {
+ useCount++;
+ }
- void fileObjectHanded(FileObject fileObject)
- {
- useCount++;
- }
-
- void fileObjectDestroyed(FileObject fileObject)
- {
- useCount--;
- }
+ void fileObjectDestroyed(FileObject fileObject)
+ {
+ useCount--;
+ }
- void setCacheKey(FileSystemKey cacheKey)
+ void setCacheKey(FileSystemKey cacheKey)
{
this.cacheKey = cacheKey;
}
Modified: commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs/provider/AbstractLayeredFileProvider.java
URL: http://svn.apache.org/viewvc/commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs/provider/AbstractLayeredFileProvider.java?rev=764356&r1=764355&r2=764356&view=diff
==============================================================================
--- commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs/provider/AbstractLayeredFileProvider.java (original)
+++ commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs/provider/AbstractLayeredFileProvider.java Mon Apr 13 04:06:01 2009
@@ -5,9 +5,9 @@
* 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.
Modified: commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs/provider/AbstractOriginatingFileProvider.java
URL: http://svn.apache.org/viewvc/commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs/provider/AbstractOriginatingFileProvider.java?rev=764356&r1=764355&r2=764356&view=diff
==============================================================================
--- commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs/provider/AbstractOriginatingFileProvider.java (original)
+++ commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs/provider/AbstractOriginatingFileProvider.java Mon Apr 13 04:06:01 2009
@@ -68,22 +68,22 @@
protected FileObject findFile(final FileName name, final FileSystemOptions fileSystemOptions)
throws FileSystemException
{
- // Check in the cache for the file system
- final FileName rootName = getContext().getFileSystemManager().resolveName(name, FileName.ROOT_PATH);
-
- FileSystem fs;
- synchronized (this)
- {
- fs = findFileSystem(rootName, fileSystemOptions);
- if (fs == null)
- {
- // Need to create the file system, and cache it
- fs = doCreateFileSystem(rootName, fileSystemOptions);
- addFileSystem(rootName, fs);
- }
- }
+ // Check in the cache for the file system
+ final FileName rootName = getContext().getFileSystemManager().resolveName(name, FileName.ROOT_PATH);
- // Locate the file
+ FileSystem fs;
+ synchronized (this)
+ {
+ fs = findFileSystem(rootName, fileSystemOptions);
+ if (fs == null)
+ {
+ // Need to create the file system, and cache it
+ fs = doCreateFileSystem(rootName, fileSystemOptions);
+ addFileSystem(rootName, fs);
+ }
+ }
+
+ // Locate the file
// return fs.resolveFile(name.getPath());
return fs.resolveFile(name);
}
Modified: commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs/provider/AbstractRandomAccessContent.java
URL: http://svn.apache.org/viewvc/commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs/provider/AbstractRandomAccessContent.java?rev=764356&r1=764355&r2=764356&view=diff
==============================================================================
--- commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs/provider/AbstractRandomAccessContent.java (original)
+++ commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs/provider/AbstractRandomAccessContent.java Mon Apr 13 04:06:01 2009
@@ -25,7 +25,7 @@
* Implements the DataOutput part of the RandomAccessContent interface and throws
* UnsupportedOperationException if one of those methods are called.
* (for read-only random access implementations)
- *
+ *
* @author <a href="mailto:imario@apache.org">Mario Ivankovits</a>
* @version $Revision$ $Date$
*/