[jboss-cvs] JBossAS SVN: r90730 - in projects/vfs/branches/dml-zip-rework/src: main/java/org/jboss/virtual/plugins and 7 other directories.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Tue Jun 30 23:04:19 EDT 2009
Author: david.lloyd at jboss.com
Date: 2009-06-30 23:04:19 -0400 (Tue, 30 Jun 2009)
New Revision: 90730
Removed:
projects/vfs/branches/dml-zip-rework/src/main/java/org/jboss/virtual/plugins/cache/
projects/vfs/branches/dml-zip-rework/src/main/java/org/jboss/virtual/plugins/context/AbstractContextFactory.java
projects/vfs/branches/dml-zip-rework/src/main/java/org/jboss/virtual/plugins/context/AbstractExceptionHandler.java
projects/vfs/branches/dml-zip-rework/src/main/java/org/jboss/virtual/plugins/context/AbstractURIHandler.java
projects/vfs/branches/dml-zip-rework/src/main/java/org/jboss/virtual/plugins/context/AbstractURLHandler.java
projects/vfs/branches/dml-zip-rework/src/main/java/org/jboss/virtual/plugins/context/AbstractVFSContext.java
projects/vfs/branches/dml-zip-rework/src/main/java/org/jboss/virtual/plugins/context/AbstractVirtualFileHandler.java
projects/vfs/branches/dml-zip-rework/src/main/java/org/jboss/virtual/plugins/context/DefaultOptions.java
projects/vfs/branches/dml-zip-rework/src/main/java/org/jboss/virtual/plugins/context/DelegatingHandler.java
projects/vfs/branches/dml-zip-rework/src/main/java/org/jboss/virtual/plugins/context/ReplacementHandler.java
projects/vfs/branches/dml-zip-rework/src/main/java/org/jboss/virtual/plugins/context/StructuredVirtualFileHandler.java
projects/vfs/branches/dml-zip-rework/src/main/java/org/jboss/virtual/plugins/context/VfsArchiveBrowser.java
projects/vfs/branches/dml-zip-rework/src/main/java/org/jboss/virtual/plugins/context/VfsArchiveBrowserFactory.java
projects/vfs/branches/dml-zip-rework/src/main/java/org/jboss/virtual/plugins/context/file/
projects/vfs/branches/dml-zip-rework/src/main/java/org/jboss/virtual/plugins/context/helpers/
projects/vfs/branches/dml-zip-rework/src/main/java/org/jboss/virtual/plugins/context/jzip/
projects/vfs/branches/dml-zip-rework/src/main/java/org/jboss/virtual/plugins/context/memory/
projects/vfs/branches/dml-zip-rework/src/main/java/org/jboss/virtual/plugins/context/temp/
projects/vfs/branches/dml-zip-rework/src/main/java/org/jboss/virtual/plugins/context/vfs/
projects/vfs/branches/dml-zip-rework/src/main/java/org/jboss/virtual/plugins/copy/
projects/vfs/branches/dml-zip-rework/src/main/java/org/jboss/virtual/plugins/registry/
projects/vfs/branches/dml-zip-rework/src/main/java/org/jboss/virtual/spi/
Modified:
projects/vfs/branches/dml-zip-rework/src/main/java/org/jboss/virtual/AssembledDirectory.java
projects/vfs/branches/dml-zip-rework/src/main/java/org/jboss/virtual/MemoryFileFactory.java
projects/vfs/branches/dml-zip-rework/src/main/java/org/jboss/virtual/VFS.java
projects/vfs/branches/dml-zip-rework/src/main/java/org/jboss/virtual/VFSUtils.java
projects/vfs/branches/dml-zip-rework/src/main/java/org/jboss/virtual/VirtualFile.java
projects/vfs/branches/dml-zip-rework/src/main/java/org/jboss/virtual/plugins/vfs/VirtualFileUrlStreamHandler.java
projects/vfs/branches/dml-zip-rework/src/main/java/org/jboss/virtual/plugins/vfs/helpers/AbstractVirtualFileHandlerVisitor.java
projects/vfs/branches/dml-zip-rework/src/main/java/org/jboss/virtual/plugins/vfs/helpers/WrappingVirtualFileHandlerVisitor.java
projects/vfs/branches/dml-zip-rework/src/main/java/org/jboss/virtual/protocol/AbstractVFSHandler.java
projects/vfs/branches/dml-zip-rework/src/main/java/org/jboss/virtual/protocol/vfs/Handler.java
projects/vfs/branches/dml-zip-rework/src/test/java/org/jboss/test/virtual/support/AbstractMockVirtualFileHandler.java
projects/vfs/branches/dml-zip-rework/src/test/java/org/jboss/test/virtual/support/FileOAContextFactory.java
projects/vfs/branches/dml-zip-rework/src/test/java/org/jboss/test/virtual/support/MockSimpleVirtualFileHandler.java
projects/vfs/branches/dml-zip-rework/src/test/java/org/jboss/test/virtual/support/MockStructuredVirtualFileHandler.java
projects/vfs/branches/dml-zip-rework/src/test/java/org/jboss/test/virtual/support/MockVFSContext.java
projects/vfs/branches/dml-zip-rework/src/test/java/org/jboss/test/virtual/support/MockVFSContextFactory.java
projects/vfs/branches/dml-zip-rework/src/test/java/org/jboss/test/virtual/support/MockVirtualFileHandlerVisitor.java
projects/vfs/branches/dml-zip-rework/src/test/java/org/jboss/test/virtual/test/AbstractMockVFSTest.java
projects/vfs/branches/dml-zip-rework/src/test/java/org/jboss/test/virtual/test/AbstractVFSContextTest.java
projects/vfs/branches/dml-zip-rework/src/test/java/org/jboss/test/virtual/test/AbstractVFSRegistryTest.java
projects/vfs/branches/dml-zip-rework/src/test/java/org/jboss/test/virtual/test/AbstractVFSTest.java
projects/vfs/branches/dml-zip-rework/src/test/java/org/jboss/test/virtual/test/AbstractVirtualFileHandlerTest.java
projects/vfs/branches/dml-zip-rework/src/test/java/org/jboss/test/virtual/test/AssembledContextTestCase.java
projects/vfs/branches/dml-zip-rework/src/test/java/org/jboss/test/virtual/test/CachePolicyVFSCacheTest.java
projects/vfs/branches/dml-zip-rework/src/test/java/org/jboss/test/virtual/test/CombinedVFSCacheTestCase.java
projects/vfs/branches/dml-zip-rework/src/test/java/org/jboss/test/virtual/test/ExceptionHandlerTestCase.java
projects/vfs/branches/dml-zip-rework/src/test/java/org/jboss/test/virtual/test/FileCleanupUnitTest.java
projects/vfs/branches/dml-zip-rework/src/test/java/org/jboss/test/virtual/test/FileVFSContextUnitTestCase.java
projects/vfs/branches/dml-zip-rework/src/test/java/org/jboss/test/virtual/test/FileVFSUnitTestCase.java
projects/vfs/branches/dml-zip-rework/src/test/java/org/jboss/test/virtual/test/FileVirtualFileHandlerUnitTestCase.java
projects/vfs/branches/dml-zip-rework/src/test/java/org/jboss/test/virtual/test/IterableTimedCacheTestCase.java
projects/vfs/branches/dml-zip-rework/src/test/java/org/jboss/test/virtual/test/JARVFSContextUnitTestCase.java
projects/vfs/branches/dml-zip-rework/src/test/java/org/jboss/test/virtual/test/JARVirtualFileHandlerUnitTestCase.java
projects/vfs/branches/dml-zip-rework/src/test/java/org/jboss/test/virtual/test/LRUCacheTestCase.java
projects/vfs/branches/dml-zip-rework/src/test/java/org/jboss/test/virtual/test/MapVFSCacheTest.java
projects/vfs/branches/dml-zip-rework/src/test/java/org/jboss/test/virtual/test/MemoryTestCase.java
projects/vfs/branches/dml-zip-rework/src/test/java/org/jboss/test/virtual/test/SoftRefCacheTestCase.java
projects/vfs/branches/dml-zip-rework/src/test/java/org/jboss/test/virtual/test/TimedCacheTestCase.java
projects/vfs/branches/dml-zip-rework/src/test/java/org/jboss/test/virtual/test/VFSCacheTest.java
projects/vfs/branches/dml-zip-rework/src/test/java/org/jboss/test/virtual/test/VirtualFileUnitTestCase.java
projects/vfs/branches/dml-zip-rework/src/test/java/org/jboss/test/virtual/test/WeakRefCacheTestCase.java
projects/vfs/branches/dml-zip-rework/src/test/java/org/jboss/test/virtual/test/ZipEntryHandlerUnitTestCase.java
projects/vfs/branches/dml-zip-rework/src/test/java/org/jboss/test/virtual/test/ZipEntryVFSContextUnitTestCase.java
Log:
Burn it to the ground
Modified: projects/vfs/branches/dml-zip-rework/src/main/java/org/jboss/virtual/AssembledDirectory.java
===================================================================
--- projects/vfs/branches/dml-zip-rework/src/main/java/org/jboss/virtual/AssembledDirectory.java 2009-07-01 02:30:42 UTC (rev 90729)
+++ projects/vfs/branches/dml-zip-rework/src/main/java/org/jboss/virtual/AssembledDirectory.java 2009-07-01 03:04:19 UTC (rev 90730)
@@ -28,10 +28,6 @@
import java.util.regex.Pattern;
import org.jboss.virtual.plugins.context.jar.JarUtils;
-import org.jboss.virtual.plugins.context.vfs.AssembledContext;
-import org.jboss.virtual.plugins.context.vfs.AssembledDirectoryHandler;
-import org.jboss.virtual.plugins.context.vfs.AssembledFileHandler;
-import org.jboss.virtual.plugins.context.vfs.ByteArrayHandler;
import org.jboss.virtual.plugins.vfs.helpers.FilterVirtualFileVisitor;
import org.jboss.virtual.plugins.vfs.helpers.SuffixesExcludeFilter;
Modified: projects/vfs/branches/dml-zip-rework/src/main/java/org/jboss/virtual/MemoryFileFactory.java
===================================================================
--- projects/vfs/branches/dml-zip-rework/src/main/java/org/jboss/virtual/MemoryFileFactory.java 2009-07-01 02:30:42 UTC (rev 90729)
+++ projects/vfs/branches/dml-zip-rework/src/main/java/org/jboss/virtual/MemoryFileFactory.java 2009-07-01 03:04:19 UTC (rev 90730)
@@ -25,8 +25,6 @@
import java.net.URI;
import java.net.URL;
-import org.jboss.virtual.plugins.context.memory.MemoryContextFactory;
-
/**
* Memory VFS API.
*
Modified: projects/vfs/branches/dml-zip-rework/src/main/java/org/jboss/virtual/VFS.java
===================================================================
--- projects/vfs/branches/dml-zip-rework/src/main/java/org/jboss/virtual/VFS.java 2009-07-01 02:30:42 UTC (rev 90729)
+++ projects/vfs/branches/dml-zip-rework/src/main/java/org/jboss/virtual/VFS.java 2009-07-01 03:04:19 UTC (rev 90730)
@@ -28,12 +28,6 @@
import org.jboss.logging.Logger;
import org.jboss.virtual.plugins.vfs.helpers.WrappingVirtualFileHandlerVisitor;
-import org.jboss.virtual.spi.ExceptionHandler;
-import org.jboss.virtual.spi.VFSContext;
-import org.jboss.virtual.spi.VFSContextFactory;
-import org.jboss.virtual.spi.VFSContextFactoryLocator;
-import org.jboss.virtual.spi.VirtualFileHandler;
-import org.jboss.virtual.spi.registry.VFSRegistry;
/**
* Virtual File System
Modified: projects/vfs/branches/dml-zip-rework/src/main/java/org/jboss/virtual/VFSUtils.java
===================================================================
--- projects/vfs/branches/dml-zip-rework/src/main/java/org/jboss/virtual/VFSUtils.java 2009-07-01 02:30:42 UTC (rev 90729)
+++ projects/vfs/branches/dml-zip-rework/src/main/java/org/jboss/virtual/VFSUtils.java 2009-07-01 03:04:19 UTC (rev 90730)
@@ -44,16 +44,6 @@
import org.jboss.logging.Logger;
import org.jboss.util.StringPropertyReplacer;
import org.jboss.util.collection.CollectionsFactory;
-import org.jboss.virtual.plugins.copy.CopyMechanism;
-import org.jboss.virtual.plugins.copy.ExplodedCopyMechanism;
-import org.jboss.virtual.plugins.copy.TempCopyMechanism;
-import org.jboss.virtual.plugins.copy.UnjarCopyMechanism;
-import org.jboss.virtual.plugins.copy.UnpackCopyMechanism;
-import org.jboss.virtual.spi.LinkInfo;
-import org.jboss.virtual.spi.Options;
-import org.jboss.virtual.spi.VFSContext;
-import org.jboss.virtual.spi.VirtualFileHandler;
-import org.jboss.virtual.spi.cache.VFSCacheFactory;
/**
* VFS Utilities
Modified: projects/vfs/branches/dml-zip-rework/src/main/java/org/jboss/virtual/VirtualFile.java
===================================================================
--- projects/vfs/branches/dml-zip-rework/src/main/java/org/jboss/virtual/VirtualFile.java 2009-07-01 02:30:42 UTC (rev 90729)
+++ projects/vfs/branches/dml-zip-rework/src/main/java/org/jboss/virtual/VirtualFile.java 2009-07-01 03:04:19 UTC (rev 90730)
@@ -35,8 +35,6 @@
import org.jboss.virtual.plugins.vfs.helpers.FilterVirtualFileVisitor;
import org.jboss.virtual.plugins.vfs.helpers.MatchAllVirtualFileFilter;
-import org.jboss.virtual.spi.VFSContext;
-import org.jboss.virtual.spi.VirtualFileHandler;
import org.jboss.util.collection.WeakSet;
/**
Deleted: projects/vfs/branches/dml-zip-rework/src/main/java/org/jboss/virtual/plugins/context/AbstractContextFactory.java
===================================================================
--- projects/vfs/branches/dml-zip-rework/src/main/java/org/jboss/virtual/plugins/context/AbstractContextFactory.java 2009-07-01 02:30:42 UTC (rev 90729)
+++ projects/vfs/branches/dml-zip-rework/src/main/java/org/jboss/virtual/plugins/context/AbstractContextFactory.java 2009-07-01 03:04:19 UTC (rev 90730)
@@ -1,89 +0,0 @@
-/*
-* JBoss, Home of Professional Open Source
-* Copyright 2006, JBoss Inc., and individual contributors as indicated
-* by the @authors tag. See the copyright.txt in the distribution for a
-* full listing of individual contributors.
-*
-* This is free software; you can redistribute it and/or modify it
-* under the terms of the GNU Lesser General Public License as
-* published by the Free Software Foundation; either version 2.1 of
-* the License, or (at your option) any later version.
-*
-* This software is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-* Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public
-* License along with this software; if not, write to the Free
-* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-*/
-package org.jboss.virtual.plugins.context;
-
-import java.net.URL;
-import java.net.MalformedURLException;
-import java.net.URI;
-import java.net.URISyntaxException;
-
-import org.jboss.virtual.spi.VFSContextFactory;
-
-/**
- * Abstract context factory.
- *
- * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
- */
-public abstract class AbstractContextFactory implements VFSContextFactory
-{
- private String[] protocols;
-
- protected AbstractContextFactory(String... protocols)
- {
- this.protocols = protocols;
- }
-
- public String[] getProtocols()
- {
- return protocols;
- }
-
- /**
- * Check if URL param is already VFS URL.
- *
- * @param url the url
- * @return stripped url
- * @throws MalformedURLException for any error
- */
- protected static URL fromVFS(URL url) throws MalformedURLException
- {
- String externalForm = url.toExternalForm();
- if (externalForm.startsWith("vfs"))
- return new URL(externalForm.substring(3));
-
- return url;
- }
-
- /**
- * Check if URI param is already VFS URI.
- *
- * @param uri the uri
- * @return stripped uri
- * @throws URISyntaxException for any error
- */
- protected static URI fromVFS(URI uri) throws URISyntaxException
- {
- String scheme = uri.getScheme();
- if (scheme.startsWith("vfs"))
- return new URI(
- scheme.substring(3),
- uri.getUserInfo(),
- uri.getHost(),
- uri.getPort(),
- uri.getPath(),
- uri.getQuery(),
- uri.getFragment()
- );
-
- return uri;
- }
-}
Deleted: projects/vfs/branches/dml-zip-rework/src/main/java/org/jboss/virtual/plugins/context/AbstractExceptionHandler.java
===================================================================
--- projects/vfs/branches/dml-zip-rework/src/main/java/org/jboss/virtual/plugins/context/AbstractExceptionHandler.java 2009-07-01 02:30:42 UTC (rev 90729)
+++ projects/vfs/branches/dml-zip-rework/src/main/java/org/jboss/virtual/plugins/context/AbstractExceptionHandler.java 2009-07-01 03:04:19 UTC (rev 90730)
@@ -1,41 +0,0 @@
-/*
-* JBoss, Home of Professional Open Source
-* Copyright 2006, JBoss Inc., and individual contributors as indicated
-* by the @authors tag. See the copyright.txt in the distribution for a
-* full listing of individual contributors.
-*
-* This is free software; you can redistribute it and/or modify it
-* under the terms of the GNU Lesser General Public License as
-* published by the Free Software Foundation; either version 2.1 of
-* the License, or (at your option) any later version.
-*
-* This software is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-* Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public
-* License along with this software; if not, write to the Free
-* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-*/
-package org.jboss.virtual.plugins.context;
-
-import org.jboss.logging.Logger;
-import org.jboss.virtual.spi.ExceptionHandler;
-
-/**
- * AbstractExceptionHandler
- *
- * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
- */
-public abstract class AbstractExceptionHandler implements ExceptionHandler
-{
- /** The log */
- protected final Logger log = Logger.getLogger(getClass());
-
- public void handleZipEntriesInitException(Exception e, String name)
- {
- throw new RuntimeException(e);
- }
-}
\ No newline at end of file
Deleted: projects/vfs/branches/dml-zip-rework/src/main/java/org/jboss/virtual/plugins/context/AbstractURIHandler.java
===================================================================
--- projects/vfs/branches/dml-zip-rework/src/main/java/org/jboss/virtual/plugins/context/AbstractURIHandler.java 2009-07-01 02:30:42 UTC (rev 90729)
+++ projects/vfs/branches/dml-zip-rework/src/main/java/org/jboss/virtual/plugins/context/AbstractURIHandler.java 2009-07-01 03:04:19 UTC (rev 90730)
@@ -1,99 +0,0 @@
-/*
-* JBoss, Home of Professional Open Source
-* Copyright 2006, JBoss Inc., and individual contributors as indicated
-* by the @authors tag. See the copyright.txt in the distribution for a
-* full listing of individual contributors.
-*
-* This is free software; you can redistribute it and/or modify it
-* under the terms of the GNU Lesser General Public License as
-* published by the Free Software Foundation; either version 2.1 of
-* the License, or (at your option) any later version.
-*
-* This software is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-* Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public
-* License along with this software; if not, write to the Free
-* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-*/
-package org.jboss.virtual.plugins.context;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.net.URI;
-
-import org.jboss.virtual.spi.VFSContext;
-import org.jboss.virtual.spi.VirtualFileHandler;
-
-/**
- * URIHandler stub.
- *
- * @author <a href="adrian at jboss.com">Adrian Brock</a>
- * @version $Revision: 1.1 $
- */
-public abstract class AbstractURIHandler extends AbstractVirtualFileHandler
-{
- private static final long serialVersionUID = 1L;
-
- /** The uri */
- private final URI uri;
-
- /**
- * Create a newURLHandler.
- *
- * @param context the context
- * @param parent the parent
- * @param uri the uri
- * @param name the name
- * @throws IllegalArgumentException for a null context, vfsPath or url
- */
- public AbstractURIHandler(VFSContext context, VirtualFileHandler parent, URI uri, String name)
- {
- super(context, parent, name);
- if (uri == null)
- throw new IllegalArgumentException("Null uri");
- this.uri = uri;
- }
-
- /**
- * Get the uri
- *
- * @return the uri
- */
- public URI getURI()
- {
- return uri;
- }
-
- public long getLastModified() throws IOException
- {
- checkClosed();
- return 0;
- }
-
- public long getSize() throws IOException
- {
- checkClosed();
- return 0;
- }
-
- public boolean isHidden() throws IOException
- {
- checkClosed();
- return false;
- }
-
- public InputStream openStream() throws IOException
- {
- checkClosed();
- return null;
- }
-
- public URI toURI()
- {
- return uri;
- }
-}
Deleted: projects/vfs/branches/dml-zip-rework/src/main/java/org/jboss/virtual/plugins/context/AbstractURLHandler.java
===================================================================
--- projects/vfs/branches/dml-zip-rework/src/main/java/org/jboss/virtual/plugins/context/AbstractURLHandler.java 2009-07-01 02:30:42 UTC (rev 90729)
+++ projects/vfs/branches/dml-zip-rework/src/main/java/org/jboss/virtual/plugins/context/AbstractURLHandler.java 2009-07-01 03:04:19 UTC (rev 90730)
@@ -1,210 +0,0 @@
-/*
-* JBoss, Home of Professional Open Source
-* Copyright 2006, JBoss Inc., and individual contributors as indicated
-* by the @authors tag. See the copyright.txt in the distribution for a
-* full listing of individual contributors.
-*
-* This is free software; you can redistribute it and/or modify it
-* under the terms of the GNU Lesser General Public License as
-* published by the Free Software Foundation; either version 2.1 of
-* the License, or (at your option) any later version.
-*
-* This software is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-* Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public
-* License along with this software; if not, write to the Free
-* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-*/
-package org.jboss.virtual.plugins.context;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.net.JarURLConnection;
-import java.net.MalformedURLException;
-import java.net.URI;
-import java.net.URISyntaxException;
-import java.net.URL;
-import java.net.URLConnection;
-
-import org.jboss.virtual.VFSUtils;
-import org.jboss.virtual.spi.VFSContext;
-import org.jboss.virtual.spi.VirtualFileHandler;
-
-/**
- * URLHandler.
- *
- * @author <a href="adrian at jboss.com">Adrian Brock</a>
- * @version $Revision: 1.1 $
- */
-public abstract class AbstractURLHandler extends AbstractVirtualFileHandler
-{
- /** serialVersionUID */
- private static final long serialVersionUID = 1L;
-
- /** The url */
- private final URL url;
-
- /**
- * Create a newURLHandler.
- *
- * @param context the context
- * @param parent the parent
- * @param url the url
- * @param name the name
- * @throws IllegalArgumentException for a null context, vfsPath or url
- */
- public AbstractURLHandler(VFSContext context, VirtualFileHandler parent, URL url, String name)
- {
- super(context, parent, name);
- if (url == null)
- throw new IllegalArgumentException("Null url");
- this.url = url;
- initCacheLastModified();
- }
-
- /**
- * Open connection.
- *
- * @return url's connection
- * @throws IOException for any error
- */
- protected URLConnection openConnection() throws IOException
- {
- return openConnection(url);
- }
-
- /**
- * Open connection.
- * Set use cacheable to false,
- * due to locking on Windows.
- *
- * @param url the url to open
- * @return url's connection
- * @throws IOException for any error
- */
- protected static URLConnection openConnection(URL url) throws IOException
- {
- URLConnection conn = url.openConnection();
- conn.setUseCaches(false);
- return conn;
- }
-
- protected void initCacheLastModified()
- {
- try
- {
- URLConnection c = openConnection();
- try
- {
- this.cachedLastModified = c.getLastModified();
- }
- finally
- {
- closeConnection(c);
- }
- }
- catch (IOException e)
- {
- throw new RuntimeException(e);
- }
- }
-
- private void closeConnection(URLConnection c)
- {
- try
- {
- if (c instanceof JarURLConnection == false)
- VFSUtils.safeClose(c.getInputStream());
- }
- catch (Exception ex)
- {
- if (log.isDebugEnabled())
- log.debug("IGNORING: Exception while closing connection", ex);
- }
- }
-
- /**
- * Get the url
- *
- * @return the url
- */
- public URL getURL()
- {
- return url;
- }
-
- public URL toURL() throws MalformedURLException, URISyntaxException
- {
- return getURL();
- }
-
- public long getLastModified() throws IOException
- {
- checkClosed();
- URLConnection c = openConnection();
- try
- {
- return c.getLastModified();
- }
- finally
- {
- closeConnection(c);
- }
- }
-
- public long getSize() throws IOException
- {
- checkClosed();
- URLConnection c = openConnection();
- try
- {
- return c.getContentLength();
- }
- finally
- {
- closeConnection(c);
- }
- }
-
- /**
- * Basis existence on URLConnection.getLastModified() != 0. This may
- * not be true for all url connections.
- *
- * @see URLConnection#getLastModified()
- * @see org.jboss.test.virtual.test.URLExistsUnitTestCase
- */
- public boolean exists() throws IOException
- {
- URLConnection c = openConnection();
- try
- {
- return c.getLastModified() != 0;
- }
- finally
- {
- closeConnection(c);
- }
- }
-
- public boolean isHidden() throws IOException
- {
- checkClosed();
- return false;
- }
-
- public InputStream openStream() throws IOException
- {
- checkClosed();
- URLConnection conn = openConnection();
- return conn.getInputStream();
- }
-
- public URI toURI() throws URISyntaxException
- {
- return VFSUtils.toURI(url);
- }
-}
Deleted: projects/vfs/branches/dml-zip-rework/src/main/java/org/jboss/virtual/plugins/context/AbstractVFSContext.java
===================================================================
--- projects/vfs/branches/dml-zip-rework/src/main/java/org/jboss/virtual/plugins/context/AbstractVFSContext.java 2009-07-01 02:30:42 UTC (rev 90729)
+++ projects/vfs/branches/dml-zip-rework/src/main/java/org/jboss/virtual/plugins/context/AbstractVFSContext.java 2009-07-01 03:04:19 UTC (rev 90730)
@@ -1,581 +0,0 @@
-/*
-* JBoss, Home of Professional Open Source
-* Copyright 2006, JBoss Inc., and individual contributors as indicated
-* by the @authors tag. See the copyright.txt in the distribution for a
-* full listing of individual contributors.
-*
-* This is free software; you can redistribute it and/or modify it
-* under the terms of the GNU Lesser General Public License as
-* published by the Free Software Foundation; either version 2.1 of
-* the License, or (at your option) any later version.
-*
-* This software is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-* Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public
-* License along with this software; if not, write to the Free
-* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-*/
-package org.jboss.virtual.plugins.context;
-
-import java.io.IOException;
-import java.net.MalformedURLException;
-import java.net.URI;
-import java.net.URISyntaxException;
-import java.net.URL;
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-import java.util.Collections;
-import java.util.Map.Entry;
-
-import org.jboss.logging.Logger;
-import org.jboss.util.collection.ConcurrentNavigableMap;
-import org.jboss.util.collection.ConcurrentSkipListMap;
-import org.jboss.virtual.VFS;
-import org.jboss.virtual.VFSUtils;
-import org.jboss.virtual.VirtualFile;
-import org.jboss.virtual.VirtualFileFilter;
-import org.jboss.virtual.VisitorAttributes;
-import org.jboss.virtual.spi.ExceptionHandler;
-import org.jboss.virtual.spi.Options;
-import org.jboss.virtual.spi.TempInfo;
-import org.jboss.virtual.spi.VFSContext;
-import org.jboss.virtual.spi.VirtualFileHandler;
-import org.jboss.virtual.spi.VirtualFileHandlerVisitor;
-import org.jboss.virtual.spi.VFSContextConstraints;
-
-/**
- * AbstractVFSContext.
- *
- * @author <a href="adrian at jboss.com">Adrian Brock</a>
- * @author Scott.Stark at jboss.org
- * @author <a href="ales.justin at jboss.com">Ales Justin</a>
- * @author Jason T. Greene
- * @version $Revision: 1.1 $
- */
-public abstract class AbstractVFSContext implements VFSContext
-{
- /** The log */
- protected final Logger log = Logger.getLogger(getClass());
-
- /** The VFS wrapper */
- private final VFS vfs = new VFS(this);
-
- /** The root url */
- private final URI rootURI;
-
- /** Options associated with the root URL */
- private final Options options = createNewOptions();
-
- /** Root's peer within another context */
- private volatile VirtualFileHandler rootPeer;
-
- /** The temp handlers */
- private final ConcurrentNavigableMap<TempInfoKey, TempInfo> tempInfos = new ConcurrentSkipListMap<TempInfoKey, TempInfo>();
-
- /**
- * Create a new AbstractVFSContext.
- *
- * @param rootURI the root url
- * @throws IllegalArgumentException if rootURI is null
- */
- protected AbstractVFSContext(URI rootURI)
- {
- if (rootURI == null)
- throw new IllegalArgumentException("Null rootURI");
- this.rootURI = rootURI;
- String query = rootURI.getQuery();
- Map<String, ?> map = VFSUtils.parseURLQuery(query);
- options.addOptions(map);
- }
-
- /**
- * Create a new AbstractVFSContext.
- *
- * @param rootURL the root url
- * @throws URISyntaxException for illegal URL
- * @throws IllegalArgumentException if rootURI is null
- */
- protected AbstractVFSContext(URL rootURL) throws URISyntaxException
- {
- this(rootURL.toURI());
- }
-
- public Set<VFSContextConstraints> getConstraints()
- {
- return Collections.emptySet();
- }
-
- /**
- * Create options.
- *
- * @return the new options
- */
- protected Options createNewOptions()
- {
- return new DefaultOptions();
- }
-
- public VFS getVFS()
- {
- return vfs;
- }
-
- public URI getRootURI()
- {
- return rootURI;
- }
-
- public void setRootPeer(VirtualFileHandler handler)
- {
- this.rootPeer = handler;
- }
-
- public VirtualFileHandler getRootPeer()
- {
- return rootPeer;
- }
-
- public Options getOptions()
- {
- return options;
- }
-
- protected void setOption(String name, Object option)
- {
- if (option == null)
- options.removeOption(name);
- else
- options.addOption(name, option);
- }
-
- protected Object getOption(String name)
- {
- return options.getOption(name);
- }
-
- protected <T> T getOption(Class<T> expectedType)
- {
- if (expectedType == null)
- throw new IllegalArgumentException("Null expectedType");
-
- return getOption(expectedType.getName(), expectedType);
- }
-
- protected <T> T getOption(String name, Class<T> expectedType)
- {
- return options.getOption(name, expectedType);
- }
-
- /**
- * Get peer vfs context.
- *
- * @return the peer context
- */
- protected VFSContext getPeerContext()
- {
- VirtualFileHandler peer = getRootPeer();
- return peer != null ? peer.getVFSContext() : null;
- }
-
- /**
- * Helper method to set options on an URL
- *
- * @param url url to set options on
- * @return url with query parameters
- * @throws java.net.MalformedURLException if url manipulation fails
- */
- protected URL setOptionsToURL(URL url) throws MalformedURLException
- {
- Map<String, String> map = options.getOptions(String.class);
- if (map.isEmpty())
- return url;
-
- StringBuilder sb = new StringBuilder(url.toString());
- sb.append("?");
- int i = 0;
-
- for (Map.Entry<String, String> ent : map.entrySet())
- {
- if (i > 0)
- sb.append("&");
- sb.append(ent.getKey()).append("=").append(ent.getValue());
- i++;
- }
-
- return new URL(sb.toString());
- }
-
- public List<VirtualFileHandler> getChildren(VirtualFileHandler parent, boolean ignoreErrors) throws IOException
- {
- if (parent == null)
- throw new IllegalArgumentException("Null parent");
- return parent.getChildren(ignoreErrors);
- }
-
- public VirtualFileHandler getChild(VirtualFileHandler parent, String path) throws IOException
- {
- if (parent == null)
- throw new IllegalArgumentException("Null parent");
- if (path == null)
- throw new IllegalArgumentException("Null path");
- return parent.getChild(path);
- }
-
- /**
- * Construct a URL from a given parent and a name
- *
- * @param parent a parent
- * @param name a name of the child
- * @return URL corresponding to a child
- * @throws IOException for any error
- */
- public URL getChildURL(VirtualFileHandler parent, String name) throws IOException
- {
- if(parent != null)
- {
- VFSContext parentCtx = parent.getVFSContext();
- if (parentCtx != this)
- {
- if (parentCtx instanceof AbstractVFSContext)
- {
- return ((AbstractVFSContext) parentCtx).getChildURL(parent, name);
- }
- else
- {
- StringBuilder urlStr = new StringBuilder(512);
- try
- {
- urlStr.append(parent.toURI());
- if (urlStr.charAt( urlStr.length()-1) != '/')
- urlStr.append("/");
-
- urlStr.append(name);
- return new URL(urlStr.toString());
- }
- catch (URISyntaxException e)
- {
- throw new RuntimeException("Failed to create child URL: " + parent + " + " + name, e);
- }
- }
- }
- }
-
- StringBuilder urlStr = new StringBuilder(512);
- URI rootUri = getRootURI();
- urlStr.append(rootUri.getScheme())
- .append(":").append(rootUri.getPath());
-
- if(parent != null)
- {
- if (urlStr.charAt( urlStr.length()-1) != '/')
- urlStr.append("/");
-
- String pPathName = parent.getPathName();
- if(pPathName.length() != 0)
- urlStr.append(pPathName);
-
- if (urlStr.charAt( urlStr.length()-1) != '/')
- urlStr.append("/");
-
- urlStr.append(name);
- }
-
- return new URL(urlStr.toString());
- }
-
- public void visit(VirtualFileHandler handler, VirtualFileHandlerVisitor visitor) throws IOException
- {
- if (handler == null)
- throw new IllegalArgumentException("Null handler");
- if (visitor == null)
- throw new IllegalArgumentException("Null visitor");
-
- VisitorAttributes attributes = visitor.getAttributes();
- boolean includeRoot = attributes.isIncludeRoot();
- boolean leavesOnly = attributes.isLeavesOnly();
- boolean ignoreErrors = attributes.isIgnoreErrors();
- boolean includeHidden = attributes.isIncludeHidden();
- VirtualFileFilter recurseFilter = attributes.getRecurseFilter();
- visit(handler, visitor, includeRoot, leavesOnly, ignoreErrors, includeHidden, recurseFilter);
- }
-
- /**
- * Visit. the file system, recursive death checking is left to the visitor
- * or otherwise a stack overflow.
- *
- * @param handler the reference handler
- * @param visitor the visitor
- * @param includeRoot whether to visit the root
- * @param leavesOnly whether to visit leaves only
- * @param ignoreErrors whether to ignore errors
- * @param includeHidden whether to include hidden files
- * @param recurseFilter the recurse filter
- * @throws IOException for any problem accessing the virtual file system
- */
- protected void visit(VirtualFileHandler handler, VirtualFileHandlerVisitor visitor,
- boolean includeRoot, boolean leavesOnly, boolean ignoreErrors,
- boolean includeHidden, VirtualFileFilter recurseFilter)
- throws IOException
- {
- // Visit the root when asked
- if (includeRoot)
- visitor.visit(handler);
-
- // Visit the children
- boolean trace = log.isTraceEnabled();
- List<VirtualFileHandler> children;
- try
- {
- children = getChildren(handler, ignoreErrors);
- }
- catch (IOException e)
- {
- if (ignoreErrors == false)
- throw e;
- if( trace )
- log.trace("Ignored: " + e);
- return;
- }
-
- // Look through each child
- for (VirtualFileHandler child : children)
- {
- // Ignore hidden if asked
- if (includeHidden == false && child.isHidden())
- {
- if( trace )
- log.trace("Ignoring hidden file: "+child);
- continue;
- }
-
- // Visit the leaf or non-leaves when asked
- boolean isLeaf = child.isLeaf();
- if (leavesOnly == false || isLeaf)
- visitor.visit(child);
- else if( trace )
- {
- log.trace("Skipping non-leaf file: "+child);
- }
-
- // Recurse when asked
- VirtualFile file = child.getVirtualFile();
- if (isLeaf == false && recurseFilter != null && recurseFilter.accepts(file))
- {
- try
- {
- if (handler instanceof DelegatingHandler)
- child.getVFSContext().visit(child, visitor);
- else
- visit(child, visitor, false, leavesOnly, ignoreErrors, includeHidden, recurseFilter);
- }
- catch (StackOverflowError e)
- {
- log.debug("Original: " + child, e);
- throw new IOException("Stack overflow, the file system is too complicated? " + child);
- }
- }
- }
- }
-
- private final static class TempInfoKey implements Comparable<TempInfoKey>
- {
- private static String LAST = "---@@@LAST@@@---";
- private final String originalPath;
- private final String tempPath;
- private int hashCode;
-
- static TempInfoKey last(String path)
- {
- return new TempInfoKey(path, LAST);
- }
-
- private TempInfoKey(TempInfo ti)
- {
- this(ti.getPath(), ti.getTempFile().getAbsolutePath());
- }
-
- private TempInfoKey(String path)
- {
- this(path, "");
- }
-
- private TempInfoKey(String path, String tempPath)
- {
- if (path == null)
- throw new IllegalArgumentException("Path can not be null!");
-
- if (path == null)
- throw new IllegalArgumentException("Temp path can not be null!");
-
-
- this.originalPath = path;
- this.tempPath = tempPath;
- }
-
- public int compareTo(TempInfoKey o)
- {
- int result = originalPath.compareTo(o.originalPath);
- if (result == 0)
- result = tempPath == LAST ? 1 : tempPath.compareTo(o.tempPath);
-
- return result;
- }
-
- public boolean equals(Object o)
- {
- if (this == o)
- return true;
-
- if (o instanceof TempInfoKey == false)
- return false;
-
- TempInfoKey other = (TempInfoKey)o;
-
- return originalPath.equals(other.originalPath) && tempPath.equals(other.tempPath);
- }
-
- public int hashCode()
- {
- // Safe race
- if (hashCode != 0)
- return hashCode;
-
- return hashCode = originalPath.hashCode() ^ tempPath.hashCode();
- }
- }
-
- public void addTempInfo(TempInfo tempInfo)
- {
- TempInfoKey tempInfoKey = new TempInfoKey(tempInfo);
- tempInfos.put(tempInfoKey, tempInfo);
- }
-
- public TempInfo getTempInfo(String path)
- {
- Iterator<Map.Entry<TempInfoKey, TempInfo>> iter = tempInfos.tailMap(new TempInfoKey(path)).entrySet().iterator();
- while (iter.hasNext())
- {
- Entry<TempInfoKey, TempInfo> entry = iter.next();
- if (entry.getKey().originalPath.equals(path) == false)
- return null;
-
- TempInfo value = entry.getValue();
- if (value.isValid())
- return value;
-
- // Not valid, eager clean
- iter.remove();
- }
-
- return null;
- }
-
- public TempInfo getFurthestParentTemp(String path)
- {
- // Start at the last possible matching entry, and scan upwards until the first matching
- // entry is found. Alternatively, path could be broken up by the separation delimiter,
- // and each lookup done from there.
- Entry<TempInfoKey, TempInfo> floor = tempInfos.floorEntry(TempInfoKey.last(path));
- TempInfo result = null;
- while (floor != null && path.startsWith(floor.getKey().originalPath))
- {
- TempInfo value = floor.getValue();
- if (value.isValid())
- result = value;
-
- floor = tempInfos.lowerEntry(floor.getKey());
- }
-
- return result;
- }
-
- public void cleanupTempInfo(String path)
- {
- boolean trace = log.isTraceEnabled();
- List<String> info = null;
- ConcurrentNavigableMap<TempInfoKey, TempInfo> tailMap = tempInfos.tailMap(new TempInfoKey(path));
- Iterator<Map.Entry<TempInfoKey, TempInfo>> iter = tailMap.entrySet().iterator();
- while (iter.hasNext())
- {
- Entry<TempInfoKey, TempInfo> entry = iter.next();
-
- if (entry.getKey().originalPath.startsWith(path) == false)
- break;
-
- TempInfo ti = entry.getValue();
- if (trace)
- {
- if (info == null)
- info = new ArrayList<String>();
-
- info.add(ti.toString());
- }
-
- try
- {
- ti.cleanup();
- }
- catch (Throwable ignored)
- {
- }
- iter.remove();
- }
-
- if (trace)
- {
- log.trace("Removing temp info for path: '" + path + "', temps: " + info);
- }
- }
-
- public Iterable<TempInfo> getTempInfos()
- {
- return new ArrayList<TempInfo>(tempInfos.values());
- }
-
- public ExceptionHandler getExceptionHandler()
- {
- return getOption(ExceptionHandler.class);
- }
-
- public void setExceptionHandler(ExceptionHandler exceptionHandler)
- {
- setOption(ExceptionHandler.class.getName(), exceptionHandler);
- }
-
- @Override
- public String toString()
- {
- StringBuilder buffer = new StringBuilder();
- buffer.append(getClass().getSimpleName());
- buffer.append('@');
- buffer.append(System.identityHashCode(this));
- buffer.append('[');
- buffer.append(rootURI);
- buffer.append(']');
- return buffer.toString();
- }
-
- @Override
- public int hashCode()
- {
- return rootURI.hashCode();
- }
-
- @Override
- public boolean equals(Object obj)
- {
- if (this == obj)
- return true;
- if (obj == null || obj instanceof VFSContext == false)
- return false;
- VFSContext other = (VFSContext) obj;
- return rootURI.equals(other.getRootURI());
- }
-}
\ No newline at end of file
Deleted: projects/vfs/branches/dml-zip-rework/src/main/java/org/jboss/virtual/plugins/context/AbstractVirtualFileHandler.java
===================================================================
--- projects/vfs/branches/dml-zip-rework/src/main/java/org/jboss/virtual/plugins/context/AbstractVirtualFileHandler.java 2009-07-01 02:30:42 UTC (rev 90729)
+++ projects/vfs/branches/dml-zip-rework/src/main/java/org/jboss/virtual/plugins/context/AbstractVirtualFileHandler.java 2009-07-01 03:04:19 UTC (rev 90730)
@@ -1,842 +0,0 @@
-/*
-* JBoss, Home of Professional Open Source
-* Copyright 2006, JBoss Inc., and individual contributors as indicated
-* by the @authors tag. See the copyright.txt in the distribution for a
-* full listing of individual contributors.
-*
-* This is free software; you can redistribute it and/or modify it
-* under the terms of the GNU Lesser General Public License as
-* published by the Free Software Foundation; either version 2.1 of
-* the License, or (at your option) any later version.
-*
-* This software is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-* Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public
-* License along with this software; if not, write to the Free
-* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-*/
-package org.jboss.virtual.plugins.context;
-
-import java.io.IOException;
-import java.io.ObjectInputStream;
-import java.io.ObjectInputStream.GetField;
-import java.io.ObjectOutputStream;
-import java.io.ObjectOutputStream.PutField;
-import java.io.ObjectStreamField;
-import java.net.MalformedURLException;
-import java.net.URI;
-import java.net.URISyntaxException;
-import java.net.URL;
-import java.util.List;
-import java.util.concurrent.atomic.AtomicIntegerFieldUpdater;
-
-import org.jboss.logging.Logger;
-import org.jboss.virtual.VFSUtils;
-import org.jboss.virtual.VirtualFile;
-import org.jboss.virtual.plugins.vfs.helpers.PathTokenizer;
-import org.jboss.virtual.spi.VFSContext;
-import org.jboss.virtual.spi.VFSContextFactory;
-import org.jboss.virtual.spi.VFSContextFactoryLocator;
-import org.jboss.virtual.spi.VirtualFileHandler;
-import org.jboss.virtual.spi.Options;
-
-/**
- * AbstractVirtualFileHandler.
- *
- * @author <a href="ales.justin at jboss.com">Ales Justin</a>
- * @author <a href="adrian at jboss.com">Adrian Brock</a>
- * @author Scott.Stark at jboss.org
- * @author <a href="strukelj at parsek.net">Marko Strukelj</a>
- * @version $Revision: 1.1 $
- */
-public abstract class AbstractVirtualFileHandler implements VirtualFileHandler
-{
- /** The log */
- protected static final Logger log = Logger.getLogger(AbstractVirtualFileHandler.class);
- /** serialVersionUID */
- private static final long serialVersionUID = 1L;
- /** The class serial fields */
- private static final ObjectStreamField[] serialPersistentFields =
- {
- new ObjectStreamField("rootURI", URI.class),
- new ObjectStreamField("parent", VirtualFileHandler.class),
- new ObjectStreamField("name", String.class),
- new ObjectStreamField("vfsUrl", URL.class)
- };
-
- /**
- * The VFS context
- *
- * @serialField rootURI URI the VFS context rootURI
- */
- private VFSContext context;
-
- /**
- * The parent
- *
- * @serialField parent VirtualFileHandler the virtual file parent
- */
- private VirtualFileHandler parent;
-
- /**
- * The name
- *
- * @serialField name String the virtual file name
- */
- private String name;
-
- /**
- * The vfs URL
- *
- * @serialField vfsUrl the vfs based url
- */
- private URL vfsUrl;
-
- /** The vfsPath */
- private transient String vfsPath;
-
- /** The local vfsPath */
- private transient String localVfsPath;
-
- /** The reference count */
- private transient volatile int references;
-
- /** The reference count updater */
- private static final AtomicIntegerFieldUpdater<AbstractVirtualFileHandler> referencesUpdater = AtomicIntegerFieldUpdater.newUpdater(AbstractVirtualFileHandler.class, "references");
-
- /** The cached last modified */
- protected transient long cachedLastModified;
-
- /** The vfsUrlCache */
- private transient URL vfsUrlCached;
-
- /**
- * Create a new handler
- *
- * @param context the context
- * @param parent the parent
- * @param name the name
- * @throws IllegalArgumentException if the context or name is null;
- */
- protected AbstractVirtualFileHandler(VFSContext context, VirtualFileHandler parent, String name)
- {
- if (context == null)
- throw new IllegalArgumentException("Null context");
- if (name == null)
- throw new IllegalArgumentException("Null name");
- this.context = context;
- this.parent = parent;
- this.name = VFSUtils.fixName(name);
- this.vfsPath = null; // nullify possible invalid vfsPath initializations when running with debugger
- }
-
- /**
- * Check if parent exists.
- */
- protected void checkParentExists()
- {
- if (parent == null)
- throw new IllegalArgumentException("Parent must exist!");
- }
-
- /**
- * Get child url.
- *
- * @param childPath the child path
- * @param isDirectory is directory
- * @return full child URL
- * @throws IOException for any io error
- * @throws URISyntaxException for any uri error
- */
- protected URL getChildVfsUrl(String childPath, boolean isDirectory) throws IOException, URISyntaxException
- {
- checkParentExists();
- URL parentVfsUrl = getParent().toVfsUrl();
- String vfsUrlString = parentVfsUrl.toString();
- if (vfsUrlString.length() > 0 && vfsUrlString.endsWith("/") == false)
- vfsUrlString += "/";
- vfsUrlString += childPath;
- if (isDirectory && vfsUrlString.endsWith("/") == false)
- vfsUrlString += "/";
- return new URL(vfsUrlString);
- }
-
- /**
- * Get child path name.
- *
- * @param childPath the child path
- * @param isDirectory is directory
- * @return full child URL
- * @throws IOException for any io error
- */
- protected String getChildPathName(String childPath, boolean isDirectory) throws IOException
- {
- checkParentExists();
- String childPathName = getParent().getPathName();
- if (childPathName.length() > 0 && childPathName.endsWith("/") == false)
- childPathName += "/";
- childPathName += childPath;
- if (isDirectory && childPathName.endsWith("/") == false)
- childPathName += "/";
- return childPathName;
- }
-
- public boolean isArchive() throws IOException
- {
- return false;
- }
-
- public boolean hasBeenModified() throws IOException
- {
- boolean hasBeenModified = false;
- long last = getLastModified();
- if (cachedLastModified != last)
- {
- hasBeenModified = cachedLastModified != 0;
- cachedLastModified = last;
- }
- return hasBeenModified;
- }
-
- public String getName()
- {
- return name;
- }
-
- /**
- * Get a pathName relative to most outer context (contexts can be mounted one within other)
- *
- * @return pathName
- */
- public String getPathName()
- {
- if (vfsPath == null)
- {
- StringBuilder pathName = new StringBuilder();
- initPath(pathName);
- vfsPath = pathName.toString();
- }
- return vfsPath;
- }
-
- /**
- * todo This is a hack until we can fix http://jira.jboss.com/jira/browse/JBMICROCONT-164
- *
- * @param path the path name
- */
- public void setPathName(String path)
- {
- this.vfsPath = path;
- }
-
- /**
- * Get a pathName relative to local context
- *
- * @return pathName
- */
- public String getLocalPathName()
- {
- if (localVfsPath == null)
- localVfsPath = readLocalPathName();
-
- return localVfsPath;
- }
-
- /**
- * Create local path name.
- *
- * @return the local path name
- */
- private String readLocalPathName()
- {
- try
- {
- VirtualFileHandler handler = getLocalVFSContext().getRoot();
- String rootPathName = handler.getPathName();
- String pathName = getPathName();
- int len = rootPathName.length();
- if (len == 0)
- return pathName;
- else if (rootPathName.length() < pathName.length())
- return pathName.substring(len + 1);
- else
- return "";
- }
- catch (IOException ex)
- {
- log.warn("Failed to compose local path name: context: " + getLocalVFSContext() + ", name: " + getName(), ex);
- }
-
- return getPathName();
- }
-
- public URL toURL() throws MalformedURLException, URISyntaxException
- {
- return toURI().toURL();
- }
-
- public URL toVfsUrl() throws MalformedURLException, URISyntaxException
- {
- if (vfsUrlCached == null)
- {
- if (isTemporary())
- {
- try
- {
- VFSContext context = getVFSContext();
- String path = getPathName();
-
- Options options = context.getOptions();
- VirtualFileHandler oldRoot = options.getOption(VirtualFileHandler.class);
- if (oldRoot == null)
- {
- StringBuffer buf = new StringBuffer();
-
- URI rootURI = context.getRootURI();
- URI copyURI = new URI(rootURI.getScheme(), rootURI.getHost(), rootURI.getPath(), null);
- buf.append(copyURI.toURL().toExternalForm());
-
- if (path != null && path.length() > 0)
- {
- if (buf.charAt(buf.length() - 1) != '/')
- {
- buf.append('/');
- }
- buf.append(path);
- }
-
- if (buf.charAt(buf.length() - 1) != '/' && isLeaf() == false)
- {
- buf.append('/');
- }
-
- vfsUrlCached = new URL(buf.toString());
- }
- else
- {
- VirtualFileHandler handler = oldRoot.getChild(path);
- if (handler == null)
- {
- URL oldRootURL = oldRoot.toVfsUrl();
- if (path != null && path.length() > 0)
- {
- String oldRootURLString = oldRootURL.toExternalForm();
- if (oldRootURLString.endsWith("/") == false && path.startsWith("/") == false)
- oldRootURLString += "/";
- vfsUrlCached = new URL(oldRootURLString + path);
- }
- else
- {
- vfsUrlCached = oldRootURL;
- }
- log.warn("No such existing handler, falling back to old root + path: " + vfsUrlCached);
- }
- else
- {
- vfsUrlCached = handler.toVfsUrl();
- }
- }
-
- }
- catch (IOException e)
- {
- throw new MalformedURLException(e.getMessage());
- }
- }
- else
- {
- vfsUrlCached = toInternalVfsUrl();
- }
- }
- return vfsUrlCached;
- }
-
- /**
- * Get internal representation of vfs url.
- *
- * @return the vfs url
- * @throws MalformedURLException for any error
- * @throws URISyntaxException for any error
- */
- protected URL toInternalVfsUrl() throws MalformedURLException, URISyntaxException
- {
- return vfsUrl;
- }
-
- public URL getRealURL() throws IOException, URISyntaxException
- {
- return toURL();
- }
-
- /**
- * Get VFS url.
- *
- * @return vfs url
- */
- protected URL getVfsUrl()
- {
- return vfsUrl;
- }
-
- /**
- * Set the vfs URL.
- *
- * @param vfsUrl vfs url
- */
- protected void setVfsUrl(URL vfsUrl)
- {
- this.vfsUrl = vfsUrl;
- }
-
- /**
- * Initialise the path into the path name
- *
- * @param pathName the path name
- * @return whether it added anything
- */
- private boolean initPath(StringBuilder pathName)
- {
- if (context.getRootPeer() != null)
- if (initPeerPath(pathName))
- return true;
-
- if (parent != null)
- {
- if (parent instanceof AbstractVirtualFileHandler)
- {
- AbstractVirtualFileHandler handler = (AbstractVirtualFileHandler) parent;
- if (handler.initPath(pathName))
- pathName.append('/');
- }
- else
- {
- pathName.append(parent.getPathName());
- }
- pathName.append(getName());
- return true;
- }
- return false;
- }
-
- /**
- * Initialise the peer path.
- *
- * @param pathName the path name
- * @return whether it added anything
- */
- private boolean initPeerPath(StringBuilder pathName)
- {
- VirtualFileHandler grandParent = null;
-
- if (parent != null)
- {
- try
- {
- grandParent = parent.getParent();
- }
- catch(IOException ex)
- {
- // if we throw exception here we'll most likely cause an infinite recursion
- log.warn("AbstractVirtualFileHandler.initPath failed: ctx: " + context
- + ", parent: " + parent + " name: " + name, ex);
- }
- }
-
- if (grandParent == null)
- {
- VirtualFileHandler peer = context.getRootPeer();
-
- // bypass parent and delegate straight to peer
-
- if (peer instanceof AbstractVirtualFileHandler)
- {
- AbstractVirtualFileHandler handler = (AbstractVirtualFileHandler) peer;
- if (handler.initPath(pathName) && parent != null)
- pathName.append('/');
- }
- else
- {
- pathName.append(peer.getPathName());
- }
-
- if (parent != null)
- {
- // if it's a root node we skip adding '/' and a name
- pathName.append(getName());
- }
-
- return true;
- }
-
- return false;
- }
-
- public VirtualFile getVirtualFile()
- {
- checkClosed();
- increment();
- return new VirtualFile(this);
- }
-
- /**
- * Get this handler's parent.
- * If this handler represents a root of the context mounted within another context
- * a parent from the outer context will be returned.
- *
- * @return parent handler
- * @throws IOException for any error
- */
- public VirtualFileHandler getParent() throws IOException
- {
- checkClosed();
- if (parent == null)
- {
- if (context instanceof AbstractVFSContext)
- {
- AbstractVFSContext avfc = (AbstractVFSContext) context;
- VirtualFileHandler peer = avfc.getRootPeer();
- if (peer != null)
- return peer.getParent();
- }
- }
- return parent;
- }
-
- /**
- * Get this handler's most outer context (contexts can be mounted one within other).
- *
- * @return context
- */
- public VFSContext getVFSContext()
- {
- checkClosed();
- if (context instanceof AbstractVFSContext)
- {
- AbstractVFSContext avfs = (AbstractVFSContext) context;
- VirtualFileHandler peer = avfs.getRootPeer();
- if (peer != null)
- return peer.getVFSContext();
- }
- return context;
- }
-
- /**
- * Get this handler's local context
- *
- * @return context
- */
- public VFSContext getLocalVFSContext()
- {
- return context;
- }
-
- /**
- * Increment the reference count
- *
- * @return the resulting count
- */
- protected int increment()
- {
- return referencesUpdater.incrementAndGet(this);
- }
-
- /**
- * Decrement the reference count
- *
- * @return the resulting count
- */
- protected int decrement()
- {
- return referencesUpdater.decrementAndGet(this);
- }
-
- /**
- * Check whether we are closed
- *
- * @throws IllegalStateException when closed
- */
- protected void checkClosed() throws IllegalStateException
- {
- if (references < 0)
- throw new IllegalStateException("Closed " + toStringLocal());
- }
-
- /**
- * Get the references count.
- *
- * @return the ref count
- */
- protected int getReferences()
- {
- return references;
- }
-
- public void cleanup()
- {
- }
-
- /**
- * Is the handler temporary.
- *
- * @return true if temporary, false otherwise
- */
- protected boolean isTemporary()
- {
- Options options = getVFSContext().getOptions();
- return options.getBooleanOption(VFSUtils.IS_TEMP_FILE);
- }
-
- public void close()
- {
- try
- {
- if (getReferences() == 1)
- doClose();
- }
- finally
- {
- referencesUpdater.decrementAndGet(this);
- }
- }
-
- /**
- * The real close
- */
- protected void doClose()
- {
- // nothing
- }
-
- /**
- * Delete the file represented by this handler.
- *
- * File deletion is comprised of two parts:
- *
- * <ol>
- * <li>physical file deletion - performed by this method or its override</li>
- * <li>removal of any child references from the parent - performed by {@link #removeChild(String)} of the parent</li>
- * </ol>
- *
- * This method doesn't do any physical file removal because it has no concept of underlying physical file.
- * An implementation that does physical file removal should override this method and call super.delete() at the end.
- *
- * @param gracePeriod max time to wait for any locks
- * @return true if file was deleted, false otherwise
- * @throws IOException if an error occurs
- */
- public boolean delete(int gracePeriod) throws IOException
- {
- VirtualFileHandler parent = getParent();
- return parent != null && parent.removeChild(getName());
- }
-
- /**
- * Structured implementation of get child
- *
- * @param path the path
- * @return the handler or <code>null</code> if it doesn't exist
- * @throws IOException for any error accessing the virtual file system
- * @throws IllegalArgumentException for a null name
- */
- public VirtualFileHandler structuredFindChild(String path) throws IOException
- {
- checkClosed();
-
- // Parse the path
- List<String> tokens = PathTokenizer.getTokens(path);
- if (tokens == null || tokens.size() == 0)
- return this;
-
- // Go through each context starting from ours
- // check the parents are not leaves.
- VirtualFileHandler current = this;
- for (int i = 0; i < tokens.size(); ++i)
- {
- if (current == null)
- return null;
-
- String token = tokens.get(i);
- if (PathTokenizer.isCurrentToken(token))
- continue;
-
- if (PathTokenizer.isReverseToken(token))
- {
- VirtualFileHandler parent = current.getParent();
- if (parent == null) // TODO - still IOE or null?
- throw new IOException("Using reverse path on top file handler: " + current + ", " + path);
- else
- current = parent;
-
- continue;
- }
-
- if (current.isLeaf())
- {
- return null;
- }
- else if (current instanceof StructuredVirtualFileHandler)
- {
- StructuredVirtualFileHandler structured = (StructuredVirtualFileHandler)current;
- current = structured.createChildHandler(token);
- }
- else
- {
- String remainingPath = PathTokenizer.getRemainingPath(tokens, i);
- return current.getChild(remainingPath);
- }
- }
-
- // The last one is the result
- return current;
- }
-
- /**
- * Simple implementation of findChild
- *
- * @param path the path
- * @return the handler
- * @throws IOException for any error accessing the virtual file system
- * @throws IllegalArgumentException for a null name
- */
- public VirtualFileHandler simpleFindChild(String path) throws IOException
- {
- if (path == null)
- throw new IllegalArgumentException("Null path");
-
- if (path.length() == 0)
- return this;
-
- // check for reverse .. path
- String appliedPath = PathTokenizer.applySpecialPaths(path);
- List<VirtualFileHandler> children = getChildren(false);
- for (VirtualFileHandler child : children)
- {
- if (child.getName().equals(appliedPath))
- return child;
- }
- return null;
- }
-
- public void replaceChild(VirtualFileHandler original, VirtualFileHandler replacement)
- {
- internalReplaceChild(original, replacement);
- if (replacement instanceof AbstractVirtualFileHandler)
- {
- AbstractVirtualFileHandler avfh = (AbstractVirtualFileHandler)replacement;
- avfh.parent = this;
- }
- }
-
- /**
- * Replace original child with unpacked replacement.
- *
- * @param original the original
- * @param replacement the replacement
- */
- protected void internalReplaceChild(VirtualFileHandler original, VirtualFileHandler replacement)
- {
- throw new UnsupportedOperationException("Replacement is unsupported: " + toString());
- }
-
- @Override
- public String toString()
- {
- StringBuilder buffer = new StringBuilder();
- buffer.append(getClass().getSimpleName());
- buffer.append('@');
- buffer.append(System.identityHashCode(this));
- buffer.append("[path=").append(getPathName());
- buffer.append(" context=").append(getVFSContext().getRootURI());
- buffer.append(" real=").append(safeToURLString());
- buffer.append(']');
- return buffer.toString();
- }
-
- public String toStringLocal()
- {
- StringBuilder buffer = new StringBuilder();
- buffer.append(getClass().getSimpleName());
- buffer.append('@');
- buffer.append(System.identityHashCode(this));
- buffer.append("[path=").append(getLocalPathName());
- buffer.append(" context=").append(context.getRootURI());
- //buffer.append(" real=").append(safeToURLString());
- buffer.append(']');
- return buffer.toString();
- }
-
- @Override
- public int hashCode()
- {
- return getPathName().hashCode();
- }
-
- @Override
- public boolean equals(Object obj)
- {
- if (this == obj)
- return true;
- if (obj == null || obj instanceof VirtualFileHandler == false)
- return false;
- VirtualFileHandler other = (VirtualFileHandler) obj;
- if (getVFSContext().equals(other.getVFSContext()) == false)
- return false;
- if (getPathName().equals(other.getPathName()) == false)
- return false;
- return true;
- }
-
- /*
- @Override
- protected void finalize() throws Throwable
- {
- close();
- }
- */
-
- /**
- * Safely get a url version of the string
- *
- * @return the string or unknown if there is an error
- */
- private String safeToURLString()
- {
- try
- {
- return toURI().toString();
- }
- catch (URISyntaxException ignored)
- {
- return "<unknown>";
- }
- }
-
- private void writeObject(ObjectOutputStream out)
- throws IOException
- {
- PutField fields = out.putFields();
- fields.put("rootURI", getLocalVFSContext().getRootURI());
- fields.put("parent", parent);
- fields.put("name", name);
- fields.put("vfsUrl", vfsUrl);
- out.writeFields();
- }
-
- private void readObject(ObjectInputStream in)
- throws IOException, ClassNotFoundException
- {
- // Read in the serialPersistentFields
- GetField fields = in.readFields();
- URI rootURI = (URI) fields.get("rootURI", null);
- this.parent = (VirtualFileHandler) fields.get("parent", null);
- this.name = (String) fields.get("name", null);
- VFSContextFactory factory = VFSContextFactoryLocator.getFactory(rootURI);
- this.context = factory.getVFS(rootURI);
- this.references = 0;
- this.vfsUrl = (URL)fields.get("vfsUrl", null);
- }
-}
Deleted: projects/vfs/branches/dml-zip-rework/src/main/java/org/jboss/virtual/plugins/context/DefaultOptions.java
===================================================================
--- projects/vfs/branches/dml-zip-rework/src/main/java/org/jboss/virtual/plugins/context/DefaultOptions.java 2009-07-01 02:30:42 UTC (rev 90729)
+++ projects/vfs/branches/dml-zip-rework/src/main/java/org/jboss/virtual/plugins/context/DefaultOptions.java 2009-07-01 03:04:19 UTC (rev 90730)
@@ -1,193 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.virtual.plugins.context;
-
-import java.util.HashMap;
-import java.util.Map;
-import java.util.concurrent.Future;
-
-import org.jboss.virtual.spi.Options;
-
-/**
- * Options impl.
- *
- * @author <a href="ales.justin at jboss.com">Ales Justin</a>
- */
-public class DefaultOptions implements Options
-{
- /** The options */
- private transient Map<String, Object> options;
-
- public int size()
- {
- return options == null ? 0 : options.size();
- }
-
- public void merge(Options other)
- {
- if (other == null)
- throw new IllegalArgumentException("Null other options");
-
- if (other.size() == 0)
- return;
-
- // get all from other
- Map<String, Object> map = other.getOptions(Object.class);
-
- synchronized (this)
- {
- if (options == null)
- options = new HashMap<String, Object>();
-
- options.putAll(map);
- }
- }
-
- public <T> Map<String, T> getOptions(Class<T> exactType)
- {
- if (exactType == null)
- throw new IllegalArgumentException("Null exact type");
-
- Map<String, T> result = new HashMap<String,T>();
- synchronized (this)
- {
- if (options != null && options.isEmpty() == false)
- {
- for (Map.Entry<String, Object> entry : options.entrySet())
- {
- Object value = entry.getValue();
- if (exactType.isInstance(value))
- {
- result.put(entry.getKey(), exactType.cast(value));
- }
- }
- }
- }
- return result;
- }
-
- public void addOption(String name, Object option)
- {
- if (name == null)
- throw new IllegalArgumentException("Null name");
-
- if (option == null)
- return;
-
- synchronized (this)
- {
- if (options == null)
- options = new HashMap<String, Object>();
- options.put(name, option);
- }
- }
-
- public void addOptions(Map<String, ?> map)
- {
- if (map == null)
- throw new IllegalArgumentException("Null map");
-
- for (Map.Entry<String, ?> entry : map.entrySet())
- {
- addOption(entry.getKey(), entry.getValue());
- }
- }
-
- public void removeOption(String name)
- {
- if (name == null)
- throw new IllegalArgumentException("Null name");
-
- synchronized (this)
- {
- if (options == null)
- return;
- options.remove(name);
- }
- }
-
- public Object getOption(String name)
- {
- if (name == null)
- throw new IllegalArgumentException("Null name");
-
- Object result;
- synchronized (this)
- {
- if (options == null)
- return null;
- result = options.get(name);
- }
- if (result == null)
- return null;
-
- // Special case if the option is a future object
- if (result instanceof Future)
- {
- try
- {
- return ((Future<?>) result).get();
- }
- catch (RuntimeException e)
- {
- throw e;
- }
- catch (Exception e)
- {
- throw new RuntimeException("Error getting option from future " + result, e);
- }
- }
- return result;
- }
-
- public <T> T getOption(Class<T> expectedType)
- {
- if (expectedType == null)
- throw new IllegalArgumentException("Null expectedType");
-
- return getOption(expectedType.getName(), expectedType);
- }
-
- public <T> T getOption(String name, Class<T> expectedType)
- {
- if (expectedType == null)
- throw new IllegalArgumentException("Null expectedType");
-
- Object result = getOption(name);
- if (result == null)
- return null;
- return expectedType.cast(result);
- }
-
- public boolean getBooleanOption(String name)
- {
- Object option = getOption(name);
- if (option != null)
- {
- if (option instanceof Boolean)
- return (Boolean)option;
- else
- return Boolean.parseBoolean(option.toString());
- }
- return false;
- }
-}
Deleted: projects/vfs/branches/dml-zip-rework/src/main/java/org/jboss/virtual/plugins/context/DelegatingHandler.java
===================================================================
--- projects/vfs/branches/dml-zip-rework/src/main/java/org/jboss/virtual/plugins/context/DelegatingHandler.java 2009-07-01 02:30:42 UTC (rev 90729)
+++ projects/vfs/branches/dml-zip-rework/src/main/java/org/jboss/virtual/plugins/context/DelegatingHandler.java 2009-07-01 03:04:19 UTC (rev 90730)
@@ -1,250 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2006, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-
-package org.jboss.virtual.plugins.context;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.net.MalformedURLException;
-import java.net.URI;
-import java.net.URISyntaxException;
-import java.net.URL;
-import java.util.List;
-
-import org.jboss.util.JBossObject;
-import org.jboss.virtual.spi.VFSContext;
-import org.jboss.virtual.spi.VirtualFileHandler;
-
-/**
- * A delegating VirtualFileHandler that allows for overriding the delegate
- * parent and name. One usecase is a link which roots another VFSContext
- * under a different parent and name.
- *
- * @author Scott.Stark at jboss.org
- * @author Ales.Justin at jboss.org
- * @version $Revision:$
- */
-public class DelegatingHandler extends AbstractVirtualFileHandler
-{
- /** Serialization */
- private static final long serialVersionUID = 1;
-
- /** The delegate */
- private VirtualFileHandler delegate;
-
- /**
- * Create a DelegatingHandler without a delegate - which will have to be set afterwards
- *
- * @param context - the context for the parent
- * @param parent - the parent of the delegate in this VFS
- * @param name - the name of the delegate in this VFS
- */
- public DelegatingHandler(VFSContext context, VirtualFileHandler parent, String name)
- {
- this(context, parent, name, null);
- }
-
- /**
- * Create a DelegatingHandler
- *
- * @param context - the context for the parent
- * @param parent - the parent of the delegate in this VFS
- * @param name - the name of the delegate in this VFS
- * @param delegate - the handler delegate
- */
- public DelegatingHandler(VFSContext context, VirtualFileHandler parent, String name, VirtualFileHandler delegate)
- {
- super(context, parent, name);
- this.delegate = delegate;
- }
-
- public void setDelegate(VirtualFileHandler handler)
- {
- this.delegate = handler;
- }
-
- public VirtualFileHandler getDelegate()
- {
- if (delegate == null)
- throw new IllegalArgumentException("Null delegate");
- return delegate;
- }
-
- /**
- * Set the vfs url.
- *
- * @param vfsUrl the vfs url
- */
- protected void setVfsUrl(URL vfsUrl)
- {
- if (delegate instanceof AbstractVirtualFileHandler)
- {
- ((AbstractVirtualFileHandler)delegate).setVfsUrl(vfsUrl);
- }
- }
-
- public VirtualFileHandler getChild(String path) throws IOException
- {
- VirtualFileHandler child = getDelegate().getChild(path);
- if (getDelegate().equals(child))
- return this;
- else
- return child;
- }
-
- public boolean removeChild(String path) throws IOException
- {
- throw new IOException("This method should never get called!");
- }
-
- public List<VirtualFileHandler> getChildren(boolean ignoreErrors) throws IOException
- {
- return getDelegate().getChildren(ignoreErrors);
- }
-
- public long getLastModified() throws IOException
- {
- return getDelegate().getLastModified();
- }
-
- public long getSize() throws IOException
- {
- return getDelegate().getSize();
- }
-
- public boolean isLeaf() throws IOException
- {
- return getDelegate().isLeaf();
- }
-
- @Override
- public boolean isArchive() throws IOException
- {
- return getDelegate().isArchive();
- }
-
- public boolean exists() throws IOException
- {
- return getDelegate().exists();
- }
-
- public boolean isHidden() throws IOException
- {
- return getDelegate().isHidden();
- }
-
- public boolean isNested() throws IOException
- {
- return getDelegate().isNested();
- }
-
- @Override
- public void cleanup()
- {
- getDelegate().cleanup();
- }
-
- @Override
- public void close()
- {
- if (delegate == null)
- return;
-
- try
- {
- if ((delegate instanceof AbstractVirtualFileHandler) && getReferences() == 1)
- {
- AbstractVirtualFileHandler avfh = AbstractVirtualFileHandler.class.cast(delegate);
- avfh.doClose();
- }
- else
- {
- delegate.close();
- }
- }
- finally
- {
- decrement();
- }
- }
-
- public boolean delete(int gracePeriod) throws IOException
- {
- return getDelegate().delete(gracePeriod);
- }
-
- public InputStream openStream() throws IOException
- {
- return getDelegate().openStream();
- }
-
- public URI toURI() throws URISyntaxException
- {
- return getDelegate().toURI();
- }
-
- public URL toURL() throws URISyntaxException, MalformedURLException
- {
- return getDelegate().toURL();
- }
-
- protected void internalReplaceChild(VirtualFileHandler original, VirtualFileHandler replacement)
- {
- getDelegate().replaceChild(original, replacement);
- }
-
- public URL toVfsUrl() throws MalformedURLException, URISyntaxException
- {
- return getDelegate().toVfsUrl();
- }
-
- public URL getRealURL() throws IOException, URISyntaxException
- {
- return getDelegate().getRealURL();
- }
-
- public int hashCode()
- {
- if (delegate != null)
- return delegate.hashCode();
-
- return super.hashCode();
- }
-
- public boolean equals(Object o)
- {
- if (o == this)
- return true;
-
- if (o instanceof VirtualFileHandler == false)
- return false;
-
- VirtualFileHandler vfh = (VirtualFileHandler)o;
- if (vfh instanceof DelegatingHandler)
- {
- DelegatingHandler handler = (DelegatingHandler) o;
- vfh = handler.getDelegate();
- }
-
- return JBossObject.equals(delegate, vfh);
- }
-}
Deleted: projects/vfs/branches/dml-zip-rework/src/main/java/org/jboss/virtual/plugins/context/ReplacementHandler.java
===================================================================
--- projects/vfs/branches/dml-zip-rework/src/main/java/org/jboss/virtual/plugins/context/ReplacementHandler.java 2009-07-01 02:30:42 UTC (rev 90729)
+++ projects/vfs/branches/dml-zip-rework/src/main/java/org/jboss/virtual/plugins/context/ReplacementHandler.java 2009-07-01 03:04:19 UTC (rev 90730)
@@ -1,49 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2006, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-
-package org.jboss.virtual.plugins.context;
-
-import org.jboss.virtual.spi.VFSContext;
-import org.jboss.virtual.spi.VirtualFileHandler;
-
-/**
- * A replacement handler.
- * It uses delegate's vfs context.
- *
- * @author ales.justin at jboss.org
- */
-public class ReplacementHandler extends DelegatingHandler
-{
- /** Serialization */
- private static final long serialVersionUID = 1;
-
- public ReplacementHandler(VFSContext context, VirtualFileHandler parent, String name, VirtualFileHandler delegate)
- {
- super(context, parent, name, delegate);
- }
-
- @Override
- public VFSContext getVFSContext()
- {
- return getDelegate().getVFSContext();
- }
-}
\ No newline at end of file
Deleted: projects/vfs/branches/dml-zip-rework/src/main/java/org/jboss/virtual/plugins/context/StructuredVirtualFileHandler.java
===================================================================
--- projects/vfs/branches/dml-zip-rework/src/main/java/org/jboss/virtual/plugins/context/StructuredVirtualFileHandler.java 2009-07-01 02:30:42 UTC (rev 90729)
+++ projects/vfs/branches/dml-zip-rework/src/main/java/org/jboss/virtual/plugins/context/StructuredVirtualFileHandler.java 2009-07-01 03:04:19 UTC (rev 90730)
@@ -1,46 +0,0 @@
-/*
-* JBoss, Home of Professional Open Source
-* Copyright 2006, JBoss Inc., and individual contributors as indicated
-* by the @authors tag. See the copyright.txt in the distribution for a
-* full listing of individual contributors.
-*
-* This is free software; you can redistribute it and/or modify it
-* under the terms of the GNU Lesser General Public License as
-* published by the Free Software Foundation; either version 2.1 of
-* the License, or (at your option) any later version.
-*
-* This software is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-* Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public
-* License along with this software; if not, write to the Free
-* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-*/
-package org.jboss.virtual.plugins.context;
-
-import java.io.IOException;
-
-import org.jboss.virtual.spi.VirtualFileHandler;
-
-/**
- * A handler that has structure, i.e. you want
- * to go through the path in individual elements
- *
- * @author <a href="adrian at jboss.com">Adrian Brock</a>
- * @version $Revision: 1.1 $
- */
-public interface StructuredVirtualFileHandler
-{
- /**
- * Create a virtual file context
- *
- * @param name the name
- * @return the handler
- * @throws IOException for any error accessing the virtual file system
- * @throws IllegalArgumentException for a null name
- */
- VirtualFileHandler createChildHandler(String name) throws IOException;
-}
Deleted: projects/vfs/branches/dml-zip-rework/src/main/java/org/jboss/virtual/plugins/context/VfsArchiveBrowser.java
===================================================================
--- projects/vfs/branches/dml-zip-rework/src/main/java/org/jboss/virtual/plugins/context/VfsArchiveBrowser.java 2009-07-01 02:30:42 UTC (rev 90729)
+++ projects/vfs/branches/dml-zip-rework/src/main/java/org/jboss/virtual/plugins/context/VfsArchiveBrowser.java 2009-07-01 03:04:19 UTC (rev 90730)
@@ -1,121 +0,0 @@
-/*
-* JBoss, Home of Professional Open Source
-* Copyright 2006, JBoss Inc., and individual contributors as indicated
-* by the @authors tag. See the copyright.txt in the distribution for a
-* full listing of individual contributors.
-*
-* This is free software; you can redistribute it and/or modify it
-* under the terms of the GNU Lesser General Public License as
-* published by the Free Software Foundation; either version 2.1 of
-* the License, or (at your option) any later version.
-*
-* This software is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-* Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public
-* License along with this software; if not, write to the Free
-* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-*/
-package org.jboss.virtual.plugins.context;
-
-import java.io.IOException;
-import java.util.Iterator;
-import java.util.List;
-
-import org.jboss.util.file.ArchiveBrowser;
-import org.jboss.virtual.VirtualFile;
-import org.jboss.virtual.VirtualFileFilter;
-import org.jboss.virtual.VisitorAttributes;
-import org.jboss.virtual.plugins.context.jar.JarUtils;
-import org.jboss.virtual.plugins.vfs.helpers.FilterVirtualFileVisitor;
-import org.jboss.virtual.plugins.vfs.helpers.SuffixesExcludeFilter;
-
-/**
- * This is a bridge to an older, crappier API written by myself.
- *
- * @deprecated
- *
- * @author <a href="bill at jboss.com">Bill Burke</a>
- * @version $Revision: 1.1 $
- */
-public class VfsArchiveBrowser implements Iterator
-{
- private VirtualFile vf;
- private Iterator<VirtualFile> it;
-
- public VfsArchiveBrowser(ArchiveBrowser.Filter filter, VirtualFile vf)
- {
- this.vf = vf;
- List<VirtualFile> classes = getResources(new ArchiveBrowserFilter(filter));
- it = classes.iterator();
- }
-
- /**
- * Get resources.
- *
- * @param filter the filter
- * @return resources list
- */
- public List<VirtualFile> getResources(VirtualFileFilter filter)
- {
- VisitorAttributes va = new VisitorAttributes();
- va.setLeavesOnly(true);
- SuffixesExcludeFilter noJars = new SuffixesExcludeFilter(JarUtils.getSuffixes());
- va.setRecurseFilter(noJars);
- FilterVirtualFileVisitor visitor = new FilterVirtualFileVisitor(filter, va);
- try
- {
- vf.visit(visitor);
- }
- catch (IOException e)
- {
- throw new RuntimeException(e);
- }
- return visitor.getMatched();
- }
-
- public boolean hasNext()
- {
- return it.hasNext();
- }
-
- public Object next()
- {
- try
- {
- return it.next().openStream();
- }
- catch (IOException e)
- {
- throw new RuntimeException(e);
- }
- }
-
- public void remove()
- {
- it.remove();
- }
-
- /**
- * Archive browser delegate filter.
- */
- private class ArchiveBrowserFilter implements VirtualFileFilter
- {
- private ArchiveBrowser.Filter filter;
-
- public ArchiveBrowserFilter(ArchiveBrowser.Filter filter)
- {
- if (filter == null)
- throw new IllegalArgumentException("Null filter");
- this.filter = filter;
- }
-
- public boolean accepts(VirtualFile file)
- {
- return filter.accept(file.getName());
- }
- }
-}
Deleted: projects/vfs/branches/dml-zip-rework/src/main/java/org/jboss/virtual/plugins/context/VfsArchiveBrowserFactory.java
===================================================================
--- projects/vfs/branches/dml-zip-rework/src/main/java/org/jboss/virtual/plugins/context/VfsArchiveBrowserFactory.java 2009-07-01 02:30:42 UTC (rev 90729)
+++ projects/vfs/branches/dml-zip-rework/src/main/java/org/jboss/virtual/plugins/context/VfsArchiveBrowserFactory.java 2009-07-01 03:04:19 UTC (rev 90730)
@@ -1,59 +0,0 @@
-/*
-* JBoss, Home of Professional Open Source
-* Copyright 2006, JBoss Inc., and individual contributors as indicated
-* by the @authors tag. See the copyright.txt in the distribution for a
-* full listing of individual contributors.
-*
-* This is free software; you can redistribute it and/or modify it
-* under the terms of the GNU Lesser General Public License as
-* published by the Free Software Foundation; either version 2.1 of
-* the License, or (at your option) any later version.
-*
-* This software is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-* Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public
-* License along with this software; if not, write to the Free
-* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-*/
-package org.jboss.virtual.plugins.context;
-
-import java.io.IOException;
-import java.net.URL;
-import java.util.Iterator;
-
-import org.jboss.util.file.ArchiveBrowserFactory;
-import org.jboss.virtual.plugins.vfs.VirtualFileURLConnection;
-
-/**
- * This is a bridge to an older, crappier API written by Bill.
- *
- * @deprecated
- *
- * @author <a href="bill at jboss.com">Bill Burke</a>
- * @author <a href="ales.justin at jboss.com">Ales Justin</a>
- * @version $Revision: 1.1 $
- */
- at SuppressWarnings("deprecation")
-public class VfsArchiveBrowserFactory implements ArchiveBrowserFactory
-{
- /** VFS archive browser instance */
- public static final VfsArchiveBrowserFactory INSTANCE = new VfsArchiveBrowserFactory();
-
- @SuppressWarnings("deprecation")
- public Iterator create(URL url, org.jboss.util.file.ArchiveBrowser.Filter filter)
- {
- try
- {
- VirtualFileURLConnection conn = (VirtualFileURLConnection)url.openConnection();
- return new VfsArchiveBrowser(filter, conn.getContent());
- }
- catch (IOException e)
- {
- throw new RuntimeException("Unable to browse URL: " + url, e);
- }
- }
-}
Modified: projects/vfs/branches/dml-zip-rework/src/main/java/org/jboss/virtual/plugins/vfs/VirtualFileUrlStreamHandler.java
===================================================================
--- projects/vfs/branches/dml-zip-rework/src/main/java/org/jboss/virtual/plugins/vfs/VirtualFileUrlStreamHandler.java 2009-07-01 02:30:42 UTC (rev 90729)
+++ projects/vfs/branches/dml-zip-rework/src/main/java/org/jboss/virtual/plugins/vfs/VirtualFileUrlStreamHandler.java 2009-07-01 03:04:19 UTC (rev 90730)
@@ -27,9 +27,6 @@
import java.net.URLConnection;
import java.net.URLStreamHandler;
-import org.jboss.virtual.spi.VFSContext;
-import org.jboss.virtual.spi.VirtualFileHandler;
-
/**
* Used when creating VFS urls so we don't have to go through the handlers all the time
*
Modified: projects/vfs/branches/dml-zip-rework/src/main/java/org/jboss/virtual/plugins/vfs/helpers/AbstractVirtualFileHandlerVisitor.java
===================================================================
--- projects/vfs/branches/dml-zip-rework/src/main/java/org/jboss/virtual/plugins/vfs/helpers/AbstractVirtualFileHandlerVisitor.java 2009-07-01 02:30:42 UTC (rev 90729)
+++ projects/vfs/branches/dml-zip-rework/src/main/java/org/jboss/virtual/plugins/vfs/helpers/AbstractVirtualFileHandlerVisitor.java 2009-07-01 03:04:19 UTC (rev 90730)
@@ -22,7 +22,6 @@
package org.jboss.virtual.plugins.vfs.helpers;
import org.jboss.virtual.VisitorAttributes;
-import org.jboss.virtual.spi.VirtualFileHandlerVisitor;
/**
* AbstractVirtualFileVisitor.
Modified: projects/vfs/branches/dml-zip-rework/src/main/java/org/jboss/virtual/plugins/vfs/helpers/WrappingVirtualFileHandlerVisitor.java
===================================================================
--- projects/vfs/branches/dml-zip-rework/src/main/java/org/jboss/virtual/plugins/vfs/helpers/WrappingVirtualFileHandlerVisitor.java 2009-07-01 02:30:42 UTC (rev 90729)
+++ projects/vfs/branches/dml-zip-rework/src/main/java/org/jboss/virtual/plugins/vfs/helpers/WrappingVirtualFileHandlerVisitor.java 2009-07-01 03:04:19 UTC (rev 90730)
@@ -24,8 +24,6 @@
import org.jboss.virtual.VirtualFile;
import org.jboss.virtual.VirtualFileVisitor;
import org.jboss.virtual.VisitorAttributes;
-import org.jboss.virtual.spi.VirtualFileHandler;
-import org.jboss.virtual.spi.VirtualFileHandlerVisitor;
/**
* A handler visitor that wraps a normal file visitor
Modified: projects/vfs/branches/dml-zip-rework/src/main/java/org/jboss/virtual/protocol/AbstractVFSHandler.java
===================================================================
--- projects/vfs/branches/dml-zip-rework/src/main/java/org/jboss/virtual/protocol/AbstractVFSHandler.java 2009-07-01 02:30:42 UTC (rev 90729)
+++ projects/vfs/branches/dml-zip-rework/src/main/java/org/jboss/virtual/protocol/AbstractVFSHandler.java 2009-07-01 03:04:19 UTC (rev 90730)
@@ -32,7 +32,6 @@
import org.jboss.virtual.VirtualFile;
import org.jboss.virtual.plugins.vfs.VirtualFileURLConnection;
-import org.jboss.virtual.spi.registry.VFSRegistry;
/**
* VFS's file URL handler.
Modified: projects/vfs/branches/dml-zip-rework/src/main/java/org/jboss/virtual/protocol/vfs/Handler.java
===================================================================
--- projects/vfs/branches/dml-zip-rework/src/main/java/org/jboss/virtual/protocol/vfs/Handler.java 2009-07-01 02:30:42 UTC (rev 90729)
+++ projects/vfs/branches/dml-zip-rework/src/main/java/org/jboss/virtual/protocol/vfs/Handler.java 2009-07-01 03:04:19 UTC (rev 90730)
@@ -27,7 +27,6 @@
import java.net.URLStreamHandler;
import org.jboss.virtual.VirtualFile;
-import org.jboss.virtual.plugins.context.vfs.AssembledContextFactory;
import org.jboss.virtual.AssembledDirectory;
import org.jboss.virtual.plugins.vfs.VirtualFileURLConnection;
Modified: projects/vfs/branches/dml-zip-rework/src/test/java/org/jboss/test/virtual/support/AbstractMockVirtualFileHandler.java
===================================================================
--- projects/vfs/branches/dml-zip-rework/src/test/java/org/jboss/test/virtual/support/AbstractMockVirtualFileHandler.java 2009-07-01 02:30:42 UTC (rev 90729)
+++ projects/vfs/branches/dml-zip-rework/src/test/java/org/jboss/test/virtual/support/AbstractMockVirtualFileHandler.java 2009-07-01 03:04:19 UTC (rev 90730)
@@ -34,9 +34,6 @@
import java.util.concurrent.CopyOnWriteArrayList;
import org.jboss.util.UnexpectedThrowable;
-import org.jboss.virtual.plugins.context.AbstractVirtualFileHandler;
-import org.jboss.virtual.spi.VFSContext;
-import org.jboss.virtual.spi.VirtualFileHandler;
/**
* AbstractMockVirtualFileHandler.
Modified: projects/vfs/branches/dml-zip-rework/src/test/java/org/jboss/test/virtual/support/FileOAContextFactory.java
===================================================================
--- projects/vfs/branches/dml-zip-rework/src/test/java/org/jboss/test/virtual/support/FileOAContextFactory.java 2009-07-01 02:30:42 UTC (rev 90729)
+++ projects/vfs/branches/dml-zip-rework/src/test/java/org/jboss/test/virtual/support/FileOAContextFactory.java 2009-07-01 03:04:19 UTC (rev 90730)
@@ -25,9 +25,6 @@
import java.net.URI;
import java.io.IOException;
-import org.jboss.virtual.plugins.context.file.FileSystemContextFactory;
-import org.jboss.virtual.spi.VFSContext;
-
/**
* @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
*/
Modified: projects/vfs/branches/dml-zip-rework/src/test/java/org/jboss/test/virtual/support/MockSimpleVirtualFileHandler.java
===================================================================
--- projects/vfs/branches/dml-zip-rework/src/test/java/org/jboss/test/virtual/support/MockSimpleVirtualFileHandler.java 2009-07-01 02:30:42 UTC (rev 90729)
+++ projects/vfs/branches/dml-zip-rework/src/test/java/org/jboss/test/virtual/support/MockSimpleVirtualFileHandler.java 2009-07-01 03:04:19 UTC (rev 90730)
@@ -23,8 +23,6 @@
import java.io.IOException;
-import org.jboss.virtual.spi.VirtualFileHandler;
-
/**
* MockSimpleVirtualFileHandler.
*
Modified: projects/vfs/branches/dml-zip-rework/src/test/java/org/jboss/test/virtual/support/MockStructuredVirtualFileHandler.java
===================================================================
--- projects/vfs/branches/dml-zip-rework/src/test/java/org/jboss/test/virtual/support/MockStructuredVirtualFileHandler.java 2009-07-01 02:30:42 UTC (rev 90729)
+++ projects/vfs/branches/dml-zip-rework/src/test/java/org/jboss/test/virtual/support/MockStructuredVirtualFileHandler.java 2009-07-01 03:04:19 UTC (rev 90730)
@@ -23,9 +23,6 @@
import java.io.IOException;
-import org.jboss.virtual.plugins.context.StructuredVirtualFileHandler;
-import org.jboss.virtual.spi.VirtualFileHandler;
-
/**
* MockStructuredVirtualFileHandler.
*
Modified: projects/vfs/branches/dml-zip-rework/src/test/java/org/jboss/test/virtual/support/MockVFSContext.java
===================================================================
--- projects/vfs/branches/dml-zip-rework/src/test/java/org/jboss/test/virtual/support/MockVFSContext.java 2009-07-01 02:30:42 UTC (rev 90729)
+++ projects/vfs/branches/dml-zip-rework/src/test/java/org/jboss/test/virtual/support/MockVFSContext.java 2009-07-01 03:04:19 UTC (rev 90730)
@@ -29,8 +29,6 @@
import org.jboss.util.UnexpectedThrowable;
import org.jboss.virtual.VirtualFile;
-import org.jboss.virtual.plugins.context.AbstractVFSContext;
-import org.jboss.virtual.spi.VirtualFileHandler;
/**
* MockVFSContext.
Modified: projects/vfs/branches/dml-zip-rework/src/test/java/org/jboss/test/virtual/support/MockVFSContextFactory.java
===================================================================
--- projects/vfs/branches/dml-zip-rework/src/test/java/org/jboss/test/virtual/support/MockVFSContextFactory.java 2009-07-01 02:30:42 UTC (rev 90729)
+++ projects/vfs/branches/dml-zip-rework/src/test/java/org/jboss/test/virtual/support/MockVFSContextFactory.java 2009-07-01 03:04:19 UTC (rev 90730)
@@ -28,9 +28,6 @@
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
-import org.jboss.virtual.spi.VFSContext;
-import org.jboss.virtual.spi.VFSContextFactory;
-
/**
* MockVFSContextFactory.
*
Modified: projects/vfs/branches/dml-zip-rework/src/test/java/org/jboss/test/virtual/support/MockVirtualFileHandlerVisitor.java
===================================================================
--- projects/vfs/branches/dml-zip-rework/src/test/java/org/jboss/test/virtual/support/MockVirtualFileHandlerVisitor.java 2009-07-01 02:30:42 UTC (rev 90729)
+++ projects/vfs/branches/dml-zip-rework/src/test/java/org/jboss/test/virtual/support/MockVirtualFileHandlerVisitor.java 2009-07-01 03:04:19 UTC (rev 90730)
@@ -26,7 +26,6 @@
import org.jboss.virtual.VisitorAttributes;
import org.jboss.virtual.plugins.vfs.helpers.AbstractVirtualFileHandlerVisitor;
-import org.jboss.virtual.spi.VirtualFileHandler;
/**
* MockVirtualFileHandlerVisitor.
Modified: projects/vfs/branches/dml-zip-rework/src/test/java/org/jboss/test/virtual/test/AbstractMockVFSTest.java
===================================================================
--- projects/vfs/branches/dml-zip-rework/src/test/java/org/jboss/test/virtual/test/AbstractMockVFSTest.java 2009-07-01 02:30:42 UTC (rev 90729)
+++ projects/vfs/branches/dml-zip-rework/src/test/java/org/jboss/test/virtual/test/AbstractMockVFSTest.java 2009-07-01 03:04:19 UTC (rev 90730)
@@ -32,9 +32,6 @@
import org.jboss.virtual.VFS;
import org.jboss.virtual.VirtualFile;
import org.jboss.virtual.VirtualFileFilter;
-import org.jboss.virtual.spi.VFSContext;
-import org.jboss.virtual.spi.VFSContextFactoryLocator;
-import org.jboss.virtual.spi.VirtualFileHandler;
/**
* AbstractMockVFSTest.
Modified: projects/vfs/branches/dml-zip-rework/src/test/java/org/jboss/test/virtual/test/AbstractVFSContextTest.java
===================================================================
--- projects/vfs/branches/dml-zip-rework/src/test/java/org/jboss/test/virtual/test/AbstractVFSContextTest.java 2009-07-01 02:30:42 UTC (rev 90729)
+++ projects/vfs/branches/dml-zip-rework/src/test/java/org/jboss/test/virtual/test/AbstractVFSContextTest.java 2009-07-01 03:04:19 UTC (rev 90730)
@@ -32,8 +32,6 @@
import org.jboss.virtual.VFS;
import org.jboss.virtual.VFSUtils;
import org.jboss.virtual.VirtualFile;
-import org.jboss.virtual.spi.VFSContext;
-import org.jboss.virtual.spi.VirtualFileHandler;
/**
* AbstractVFSContextTest.
Modified: projects/vfs/branches/dml-zip-rework/src/test/java/org/jboss/test/virtual/test/AbstractVFSRegistryTest.java
===================================================================
--- projects/vfs/branches/dml-zip-rework/src/test/java/org/jboss/test/virtual/test/AbstractVFSRegistryTest.java 2009-07-01 02:30:42 UTC (rev 90729)
+++ projects/vfs/branches/dml-zip-rework/src/test/java/org/jboss/test/virtual/test/AbstractVFSRegistryTest.java 2009-07-01 03:04:19 UTC (rev 90730)
@@ -23,8 +23,6 @@
import java.lang.reflect.Field;
-import org.jboss.virtual.spi.registry.VFSRegistryBuilder;
-
/**
* Test vfs registry
*
Modified: projects/vfs/branches/dml-zip-rework/src/test/java/org/jboss/test/virtual/test/AbstractVFSTest.java
===================================================================
--- projects/vfs/branches/dml-zip-rework/src/test/java/org/jboss/test/virtual/test/AbstractVFSTest.java 2009-07-01 02:30:42 UTC (rev 90729)
+++ projects/vfs/branches/dml-zip-rework/src/test/java/org/jboss/test/virtual/test/AbstractVFSTest.java 2009-07-01 03:04:19 UTC (rev 90730)
@@ -31,8 +31,6 @@
import org.jboss.test.virtual.support.OptionsAwareURI;
import org.jboss.virtual.VFSUtils;
import org.jboss.virtual.VirtualFile;
-import org.jboss.virtual.spi.VFSContextFactory;
-import org.jboss.virtual.spi.VFSContextFactoryLocator;
/**
* AbstractVFSTest.
Modified: projects/vfs/branches/dml-zip-rework/src/test/java/org/jboss/test/virtual/test/AbstractVirtualFileHandlerTest.java
===================================================================
--- projects/vfs/branches/dml-zip-rework/src/test/java/org/jboss/test/virtual/test/AbstractVirtualFileHandlerTest.java 2009-07-01 02:30:42 UTC (rev 90729)
+++ projects/vfs/branches/dml-zip-rework/src/test/java/org/jboss/test/virtual/test/AbstractVirtualFileHandlerTest.java 2009-07-01 03:04:19 UTC (rev 90730)
@@ -30,8 +30,6 @@
import java.util.Set;
import org.jboss.virtual.VirtualFile;
-import org.jboss.virtual.spi.VFSContext;
-import org.jboss.virtual.spi.VirtualFileHandler;
/**
* AbstractVirtualFileHandlerTest.
Modified: projects/vfs/branches/dml-zip-rework/src/test/java/org/jboss/test/virtual/test/AssembledContextTestCase.java
===================================================================
--- projects/vfs/branches/dml-zip-rework/src/test/java/org/jboss/test/virtual/test/AssembledContextTestCase.java 2009-07-01 02:30:42 UTC (rev 90729)
+++ projects/vfs/branches/dml-zip-rework/src/test/java/org/jboss/test/virtual/test/AssembledContextTestCase.java 2009-07-01 03:04:19 UTC (rev 90730)
@@ -28,7 +28,6 @@
import junit.framework.Test;
import org.jboss.virtual.VirtualFile;
import org.jboss.virtual.AssembledDirectory;
-import org.jboss.virtual.plugins.context.vfs.AssembledContextFactory;
/**
* comment
Modified: projects/vfs/branches/dml-zip-rework/src/test/java/org/jboss/test/virtual/test/CachePolicyVFSCacheTest.java
===================================================================
--- projects/vfs/branches/dml-zip-rework/src/test/java/org/jboss/test/virtual/test/CachePolicyVFSCacheTest.java 2009-07-01 02:30:42 UTC (rev 90729)
+++ projects/vfs/branches/dml-zip-rework/src/test/java/org/jboss/test/virtual/test/CachePolicyVFSCacheTest.java 2009-07-01 03:04:19 UTC (rev 90730)
@@ -21,8 +21,6 @@
*/
package org.jboss.test.virtual.test;
-import org.jboss.virtual.spi.VFSContext;
-
/**
* Map VFSCache Test.
*
Modified: projects/vfs/branches/dml-zip-rework/src/test/java/org/jboss/test/virtual/test/CombinedVFSCacheTestCase.java
===================================================================
--- projects/vfs/branches/dml-zip-rework/src/test/java/org/jboss/test/virtual/test/CombinedVFSCacheTestCase.java 2009-07-01 02:30:42 UTC (rev 90729)
+++ projects/vfs/branches/dml-zip-rework/src/test/java/org/jboss/test/virtual/test/CombinedVFSCacheTestCase.java 2009-07-01 03:04:19 UTC (rev 90730)
@@ -26,11 +26,6 @@
import java.util.Map;
import junit.framework.Test;
-import org.jboss.virtual.plugins.cache.CombinedVFSCache;
-import org.jboss.virtual.plugins.cache.IterableTimedVFSCache;
-import org.jboss.virtual.spi.ExceptionHandler;
-import org.jboss.virtual.spi.VFSContext;
-import org.jboss.virtual.spi.cache.VFSCache;
/**
* Combined VFSCache Test.
Modified: projects/vfs/branches/dml-zip-rework/src/test/java/org/jboss/test/virtual/test/ExceptionHandlerTestCase.java
===================================================================
--- projects/vfs/branches/dml-zip-rework/src/test/java/org/jboss/test/virtual/test/ExceptionHandlerTestCase.java 2009-07-01 02:30:42 UTC (rev 90729)
+++ projects/vfs/branches/dml-zip-rework/src/test/java/org/jboss/test/virtual/test/ExceptionHandlerTestCase.java 2009-07-01 03:04:19 UTC (rev 90730)
@@ -27,7 +27,6 @@
import junit.framework.Test;
import org.jboss.virtual.VFS;
import org.jboss.virtual.VirtualFile;
-import org.jboss.virtual.plugins.context.helpers.NamesExceptionHandler;
/**
* ExceptionHandlerTestCase.
Modified: projects/vfs/branches/dml-zip-rework/src/test/java/org/jboss/test/virtual/test/FileCleanupUnitTest.java
===================================================================
--- projects/vfs/branches/dml-zip-rework/src/test/java/org/jboss/test/virtual/test/FileCleanupUnitTest.java 2009-07-01 02:30:42 UTC (rev 90729)
+++ projects/vfs/branches/dml-zip-rework/src/test/java/org/jboss/test/virtual/test/FileCleanupUnitTest.java 2009-07-01 03:04:19 UTC (rev 90730)
@@ -33,11 +33,6 @@
import org.jboss.virtual.VFS;
import org.jboss.virtual.VFSUtils;
import org.jboss.virtual.VirtualFile;
-import org.jboss.virtual.plugins.cache.LRUVFSCache;
-import org.jboss.virtual.plugins.copy.AbstractCopyMechanism;
-import org.jboss.virtual.spi.cache.VFSCache;
-import org.jboss.virtual.spi.cache.VFSCacheFactory;
-import org.jboss.virtual.spi.registry.VFSRegistry;
/**
* Test file closing
Modified: projects/vfs/branches/dml-zip-rework/src/test/java/org/jboss/test/virtual/test/FileVFSContextUnitTestCase.java
===================================================================
--- projects/vfs/branches/dml-zip-rework/src/test/java/org/jboss/test/virtual/test/FileVFSContextUnitTestCase.java 2009-07-01 02:30:42 UTC (rev 90729)
+++ projects/vfs/branches/dml-zip-rework/src/test/java/org/jboss/test/virtual/test/FileVFSContextUnitTestCase.java 2009-07-01 03:04:19 UTC (rev 90730)
@@ -26,9 +26,6 @@
import junit.framework.Test;
import junit.framework.TestSuite;
-import org.jboss.virtual.plugins.context.file.FileSystemContext;
-import org.jboss.virtual.spi.VFSContext;
-
/**
* FileVFSContextUnitTestCase.
*
Modified: projects/vfs/branches/dml-zip-rework/src/test/java/org/jboss/test/virtual/test/FileVFSUnitTestCase.java
===================================================================
--- projects/vfs/branches/dml-zip-rework/src/test/java/org/jboss/test/virtual/test/FileVFSUnitTestCase.java 2009-07-01 02:30:42 UTC (rev 90729)
+++ projects/vfs/branches/dml-zip-rework/src/test/java/org/jboss/test/virtual/test/FileVFSUnitTestCase.java 2009-07-01 03:04:19 UTC (rev 90730)
@@ -55,12 +55,7 @@
import org.jboss.virtual.VFSUtils;
import org.jboss.virtual.VirtualFile;
import org.jboss.virtual.VisitorAttributes;
-import org.jboss.virtual.plugins.context.file.FileSystemContext;
import org.jboss.virtual.plugins.vfs.helpers.SuffixMatchFilter;
-import org.jboss.virtual.spi.LinkInfo;
-import org.jboss.virtual.spi.VFSContextFactory;
-import org.jboss.virtual.spi.VFSContextFactoryLocator;
-import org.jboss.virtual.spi.VirtualFileHandler;
/**
* Tests of the VFS implementation
Modified: projects/vfs/branches/dml-zip-rework/src/test/java/org/jboss/test/virtual/test/FileVirtualFileHandlerUnitTestCase.java
===================================================================
--- projects/vfs/branches/dml-zip-rework/src/test/java/org/jboss/test/virtual/test/FileVirtualFileHandlerUnitTestCase.java 2009-07-01 02:30:42 UTC (rev 90729)
+++ projects/vfs/branches/dml-zip-rework/src/test/java/org/jboss/test/virtual/test/FileVirtualFileHandlerUnitTestCase.java 2009-07-01 03:04:19 UTC (rev 90730)
@@ -29,9 +29,6 @@
import junit.framework.Test;
import junit.framework.TestSuite;
-import org.jboss.virtual.plugins.context.file.FileSystemContext;
-import org.jboss.virtual.spi.VFSContext;
-import org.jboss.virtual.spi.VirtualFileHandler;
/**
* FileVirtualFileHandlerUnitTestCase.
Modified: projects/vfs/branches/dml-zip-rework/src/test/java/org/jboss/test/virtual/test/IterableTimedCacheTestCase.java
===================================================================
--- projects/vfs/branches/dml-zip-rework/src/test/java/org/jboss/test/virtual/test/IterableTimedCacheTestCase.java 2009-07-01 02:30:42 UTC (rev 90729)
+++ projects/vfs/branches/dml-zip-rework/src/test/java/org/jboss/test/virtual/test/IterableTimedCacheTestCase.java 2009-07-01 03:04:19 UTC (rev 90730)
@@ -22,8 +22,6 @@
package org.jboss.test.virtual.test;
import junit.framework.Test;
-import org.jboss.virtual.plugins.cache.IterableTimedVFSCache;
-import org.jboss.virtual.spi.cache.VFSCache;
/**
* Iterable timed VFSCache Test.
Modified: projects/vfs/branches/dml-zip-rework/src/test/java/org/jboss/test/virtual/test/JARVFSContextUnitTestCase.java
===================================================================
--- projects/vfs/branches/dml-zip-rework/src/test/java/org/jboss/test/virtual/test/JARVFSContextUnitTestCase.java 2009-07-01 02:30:42 UTC (rev 90729)
+++ projects/vfs/branches/dml-zip-rework/src/test/java/org/jboss/test/virtual/test/JARVFSContextUnitTestCase.java 2009-07-01 03:04:19 UTC (rev 90730)
@@ -35,9 +35,6 @@
import org.jboss.virtual.VFS;
import org.jboss.virtual.VFSUtils;
import org.jboss.virtual.VirtualFile;
-import org.jboss.virtual.plugins.context.file.FileSystemContext;
-import org.jboss.virtual.spi.VFSContext;
-import org.jboss.virtual.spi.VirtualFileHandler;
/**
* JARVFSContextUnitTestCase.
Modified: projects/vfs/branches/dml-zip-rework/src/test/java/org/jboss/test/virtual/test/JARVirtualFileHandlerUnitTestCase.java
===================================================================
--- projects/vfs/branches/dml-zip-rework/src/test/java/org/jboss/test/virtual/test/JARVirtualFileHandlerUnitTestCase.java 2009-07-01 02:30:42 UTC (rev 90729)
+++ projects/vfs/branches/dml-zip-rework/src/test/java/org/jboss/test/virtual/test/JARVirtualFileHandlerUnitTestCase.java 2009-07-01 03:04:19 UTC (rev 90730)
@@ -30,8 +30,6 @@
import junit.framework.Test;
import junit.framework.TestSuite;
import org.jboss.virtual.plugins.context.jar.JarUtils;
-import org.jboss.virtual.spi.VFSContext;
-import org.jboss.virtual.spi.VirtualFileHandler;
/**
* JARVirtualFileHandlerUnitTestCase.
Modified: projects/vfs/branches/dml-zip-rework/src/test/java/org/jboss/test/virtual/test/LRUCacheTestCase.java
===================================================================
--- projects/vfs/branches/dml-zip-rework/src/test/java/org/jboss/test/virtual/test/LRUCacheTestCase.java 2009-07-01 02:30:42 UTC (rev 90729)
+++ projects/vfs/branches/dml-zip-rework/src/test/java/org/jboss/test/virtual/test/LRUCacheTestCase.java 2009-07-01 03:04:19 UTC (rev 90730)
@@ -27,8 +27,6 @@
import junit.framework.Test;
import org.jboss.virtual.VFSUtils;
-import org.jboss.virtual.plugins.cache.LRUVFSCache;
-import org.jboss.virtual.spi.cache.VFSCache;
/**
* LRU VFSCache Test.
Modified: projects/vfs/branches/dml-zip-rework/src/test/java/org/jboss/test/virtual/test/MapVFSCacheTest.java
===================================================================
--- projects/vfs/branches/dml-zip-rework/src/test/java/org/jboss/test/virtual/test/MapVFSCacheTest.java 2009-07-01 02:30:42 UTC (rev 90729)
+++ projects/vfs/branches/dml-zip-rework/src/test/java/org/jboss/test/virtual/test/MapVFSCacheTest.java 2009-07-01 03:04:19 UTC (rev 90730)
@@ -23,8 +23,6 @@
import java.util.Map;
-import org.jboss.virtual.spi.VFSContext;
-
/**
* Map VFSCache Test.
*
Modified: projects/vfs/branches/dml-zip-rework/src/test/java/org/jboss/test/virtual/test/MemoryTestCase.java
===================================================================
--- projects/vfs/branches/dml-zip-rework/src/test/java/org/jboss/test/virtual/test/MemoryTestCase.java 2009-07-01 02:30:42 UTC (rev 90729)
+++ projects/vfs/branches/dml-zip-rework/src/test/java/org/jboss/test/virtual/test/MemoryTestCase.java 2009-07-01 03:04:19 UTC (rev 90730)
@@ -36,15 +36,6 @@
import org.jboss.virtual.MemoryFileFactory;
import org.jboss.virtual.VFS;
import org.jboss.virtual.VirtualFile;
-import org.jboss.virtual.plugins.context.memory.MemoryContextFactory;
-import org.jboss.virtual.plugins.context.memory.MemoryContextHandler;
-import org.jboss.virtual.plugins.cache.IterableTimedVFSCache;
-import org.jboss.virtual.spi.VFSContext;
-import org.jboss.virtual.spi.VFSContextFactory;
-import org.jboss.virtual.spi.VFSContextFactoryLocator;
-import org.jboss.virtual.spi.VirtualFileHandler;
-import org.jboss.virtual.spi.cache.VFSCache;
-import org.jboss.virtual.spi.cache.VFSCacheFactory;
/**
* Memory vfs tests.
Modified: projects/vfs/branches/dml-zip-rework/src/test/java/org/jboss/test/virtual/test/SoftRefCacheTestCase.java
===================================================================
--- projects/vfs/branches/dml-zip-rework/src/test/java/org/jboss/test/virtual/test/SoftRefCacheTestCase.java 2009-07-01 02:30:42 UTC (rev 90729)
+++ projects/vfs/branches/dml-zip-rework/src/test/java/org/jboss/test/virtual/test/SoftRefCacheTestCase.java 2009-07-01 03:04:19 UTC (rev 90730)
@@ -21,8 +21,6 @@
*/
package org.jboss.test.virtual.test;
-import org.jboss.virtual.plugins.cache.SoftRefVFSCache;
-import org.jboss.virtual.spi.cache.VFSCache;
import junit.framework.Test;
/**
Modified: projects/vfs/branches/dml-zip-rework/src/test/java/org/jboss/test/virtual/test/TimedCacheTestCase.java
===================================================================
--- projects/vfs/branches/dml-zip-rework/src/test/java/org/jboss/test/virtual/test/TimedCacheTestCase.java 2009-07-01 02:30:42 UTC (rev 90729)
+++ projects/vfs/branches/dml-zip-rework/src/test/java/org/jboss/test/virtual/test/TimedCacheTestCase.java 2009-07-01 03:04:19 UTC (rev 90730)
@@ -24,9 +24,6 @@
import java.util.Map;
import java.util.HashMap;
-import org.jboss.virtual.plugins.cache.TimedVFSCache;
-import org.jboss.virtual.spi.cache.VFSCache;
-import org.jboss.virtual.spi.VFSContext;
import org.jboss.virtual.VFSUtils;
import junit.framework.Test;
Modified: projects/vfs/branches/dml-zip-rework/src/test/java/org/jboss/test/virtual/test/VFSCacheTest.java
===================================================================
--- projects/vfs/branches/dml-zip-rework/src/test/java/org/jboss/test/virtual/test/VFSCacheTest.java 2009-07-01 02:30:42 UTC (rev 90729)
+++ projects/vfs/branches/dml-zip-rework/src/test/java/org/jboss/test/virtual/test/VFSCacheTest.java 2009-07-01 03:04:19 UTC (rev 90730)
@@ -28,11 +28,6 @@
import org.jboss.virtual.VFS;
import org.jboss.virtual.VirtualFile;
-import org.jboss.virtual.spi.VFSContext;
-import org.jboss.virtual.spi.cache.CacheStatistics;
-import org.jboss.virtual.spi.cache.VFSCache;
-import org.jboss.virtual.spi.cache.VFSCacheFactory;
-import org.jboss.virtual.spi.cache.helpers.NoopVFSCache;
/**
* VFSCache Test.
Modified: projects/vfs/branches/dml-zip-rework/src/test/java/org/jboss/test/virtual/test/VirtualFileUnitTestCase.java
===================================================================
--- projects/vfs/branches/dml-zip-rework/src/test/java/org/jboss/test/virtual/test/VirtualFileUnitTestCase.java 2009-07-01 02:30:42 UTC (rev 90729)
+++ projects/vfs/branches/dml-zip-rework/src/test/java/org/jboss/test/virtual/test/VirtualFileUnitTestCase.java 2009-07-01 03:04:19 UTC (rev 90730)
@@ -37,7 +37,6 @@
import org.jboss.virtual.VFS;
import org.jboss.virtual.VirtualFile;
import org.jboss.virtual.plugins.vfs.helpers.FilterVirtualFileVisitor;
-import org.jboss.virtual.spi.VirtualFileHandler;
/**
* VirtualFileUnitTestCase.
Modified: projects/vfs/branches/dml-zip-rework/src/test/java/org/jboss/test/virtual/test/WeakRefCacheTestCase.java
===================================================================
--- projects/vfs/branches/dml-zip-rework/src/test/java/org/jboss/test/virtual/test/WeakRefCacheTestCase.java 2009-07-01 02:30:42 UTC (rev 90729)
+++ projects/vfs/branches/dml-zip-rework/src/test/java/org/jboss/test/virtual/test/WeakRefCacheTestCase.java 2009-07-01 03:04:19 UTC (rev 90730)
@@ -21,8 +21,6 @@
*/
package org.jboss.test.virtual.test;
-import org.jboss.virtual.plugins.cache.WeakRefVFSCache;
-import org.jboss.virtual.spi.cache.VFSCache;
import junit.framework.Test;
/**
Modified: projects/vfs/branches/dml-zip-rework/src/test/java/org/jboss/test/virtual/test/ZipEntryHandlerUnitTestCase.java
===================================================================
--- projects/vfs/branches/dml-zip-rework/src/test/java/org/jboss/test/virtual/test/ZipEntryHandlerUnitTestCase.java 2009-07-01 02:30:42 UTC (rev 90729)
+++ projects/vfs/branches/dml-zip-rework/src/test/java/org/jboss/test/virtual/test/ZipEntryHandlerUnitTestCase.java 2009-07-01 03:04:19 UTC (rev 90730)
@@ -30,8 +30,6 @@
import junit.framework.Test;
import org.jboss.virtual.plugins.context.jar.JarUtils;
-import org.jboss.virtual.plugins.context.jzip.ZipFileContext;
-import org.jboss.virtual.spi.VFSContext;
import org.jboss.virtual.VFS;
import org.jboss.virtual.VirtualFile;
Modified: projects/vfs/branches/dml-zip-rework/src/test/java/org/jboss/test/virtual/test/ZipEntryVFSContextUnitTestCase.java
===================================================================
--- projects/vfs/branches/dml-zip-rework/src/test/java/org/jboss/test/virtual/test/ZipEntryVFSContextUnitTestCase.java 2009-07-01 02:30:42 UTC (rev 90729)
+++ projects/vfs/branches/dml-zip-rework/src/test/java/org/jboss/test/virtual/test/ZipEntryVFSContextUnitTestCase.java 2009-07-01 03:04:19 UTC (rev 90730)
@@ -34,11 +34,7 @@
import org.jboss.virtual.VFS;
import org.jboss.virtual.VFSUtils;
import org.jboss.virtual.VirtualFile;
-import org.jboss.virtual.plugins.context.file.FileSystemContext;
import org.jboss.virtual.plugins.context.jar.JarUtils;
-import org.jboss.virtual.plugins.context.jzip.ZipFileContext;
-import org.jboss.virtual.spi.VFSContext;
-import org.jboss.virtual.spi.VirtualFileHandler;
/**
* ZipEntryVFSContextUnitTestCase.
More information about the jboss-cvs-commits
mailing list