imario 2004/05/17 10:56:35
Modified: vfs/src/java/org/apache/commons/vfs/impl
StandardFileSystemManager.java
Log:
BUG29007: Allow overloading of
FileReplicator = cretaeDefaultFileReplicator
Introduced GlobalConfiguration and moved configuration for FilesCache into it.
Removed configuration-option from providers.xml.
Revision Changes Path
1.19 +7 -35
jakarta-commons-sandbox/vfs/src/java/org/apache/commons/vfs/impl/StandardFileSystemManager.java
Index: StandardFileSystemManager.java
===================================================================
RCS file:
/home/cvs/jakarta-commons-sandbox/vfs/src/java/org/apache/commons/vfs/impl/StandardFileSystemManager.java,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -r1.18 -r1.19
--- StandardFileSystemManager.java 15 May 2004 09:15:11 -0000 1.18
+++ StandardFileSystemManager.java 17 May 2004 17:56:35 -0000 1.19
@@ -16,7 +16,6 @@
package org.apache.commons.vfs.impl;
import org.apache.commons.vfs.FileSystemException;
-import org.apache.commons.vfs.FilesCache;
import org.apache.commons.vfs.provider.FileProvider;
import org.apache.commons.vfs.util.Messages;
import org.w3c.dom.Element;
@@ -68,7 +67,7 @@
public void init() throws FileSystemException
{
// Set the replicator and temporary file store (use the same component)
- final DefaultFileReplicator replicator = new DefaultFileReplicator();
+ final DefaultFileReplicator replicator = createDefaultFileReplicator();
setReplicator(new PrivilegedFileReplicator(replicator));
setTemporaryFileStore(replicator);
@@ -95,6 +94,11 @@
super.init();
}
+ protected DefaultFileReplicator createDefaultFileReplicator()
+ {
+ return new DefaultFileReplicator();
+ }
+
/**
* Configures this manager from an XML configuration file.
*/
@@ -143,14 +147,6 @@
final Element map = (Element) extensions.item(i);
addExtensionMap(map);
}
-
- // set the filescache implementation
- final NodeList filesCaches = config.getElementsByTagName("files-cache");
- if (filesCaches.getLength() > 0)
- {
- final Element filesCache = (Element) filesCaches.item(0);
- addFilesCache(filesCache);
- }
}
catch (final Exception e)
{
@@ -158,13 +154,6 @@
}
}
- private void addFilesCache(Element filesCache) throws FileSystemException
- {
- final String classname = filesCache.getAttribute("class-name");
- final FilesCache cache = createFilesCache(classname);
- setFilesCache(cache);
- }
-
/**
* Adds an extension map.
*/
@@ -284,23 +273,6 @@
catch (final Exception e)
{
throw new FileSystemException("vfs.impl/create-provider.error",
providerClassName, e);
- }
- }
-
- /**
- * Creates a fileCache implementation.
- */
- private FilesCache createFilesCache(final String filesCacheClassName)
- throws FileSystemException
- {
- try
- {
- final Class filesCacheClass =
classLoader.loadClass(filesCacheClassName);
- return (FilesCache) filesCacheClass.newInstance();
- }
- catch (final Exception e)
- {
- throw new FileSystemException("vfs.impl/create-files-cache.error",
filesCacheClassName, e);
}
}
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]