org.jboss.osgi.vfs
Interface VFSAdaptor


public interface VFSAdaptor

The basic adaptor for the VFS that needs to be implemented for a specific jboss-vfs version. This abstraction should be removed once we settle on a single jboss-vfs version.

Since:
02-Mar-2010
Author:
thomas.diesler@jboss.com

Method Summary
 VirtualFile adapt(Object virtualFile)
          Adapt a concrete instance of a jboss-vfs VirtualFile.
 Object adapt(VirtualFile virtualFile)
          Adapt a VirtualFile to a concrete instance of a jboss-vfs VirtualFile.
 VirtualFile toVirtualFile(InputStream input)
          Adapt an InputStream to a virtual file.
 VirtualFile toVirtualFile(String name, InputStream input)
          Adapt an named InputStream to a virtual file.
 VirtualFile toVirtualFile(URI uri)
          Get the root virtual file
 VirtualFile toVirtualFile(URL url)
          Get the root virtual file
 

Method Detail

toVirtualFile

VirtualFile toVirtualFile(URL url)
                          throws IOException
Get the root virtual file

Parameters:
url - the root url
Returns:
the virtual file
Throws:
IOException - if there is a problem accessing the VFS

toVirtualFile

VirtualFile toVirtualFile(URI uri)
                          throws IOException
Get the root virtual file

Parameters:
uri - the root uri
Returns:
the virtual file
Throws:
IOException - if there is a problem accessing the VFS

toVirtualFile

VirtualFile toVirtualFile(String name,
                          InputStream input)
                          throws IOException
Adapt an named InputStream to a virtual file.

Parameters:
name - The name of the virtual file
input - The input stream
Returns:
The VirtualFile abstraction
Throws:
IOException - if there is a problem accessing the VFS

toVirtualFile

VirtualFile toVirtualFile(InputStream input)
                          throws IOException
Adapt an InputStream to a virtual file.

Parameters:
input - The input stream
Returns:
The VirtualFile abstraction
Throws:
IOException - if there is a problem accessing the VFS

adapt

VirtualFile adapt(Object virtualFile)
Adapt a concrete instance of a jboss-vfs VirtualFile.

Parameters:
virtualFile - The VirtualFile instance
Returns:
The VirtualFile abstraction
Throws:
IllegalArgumentException - If the given virtualFile is not a VirtualFile supported by the VFSAdaptor implementation

adapt

Object adapt(VirtualFile virtualFile)
Adapt a VirtualFile to a concrete instance of a jboss-vfs VirtualFile.

Parameters:
virtualFile - The VirtualFile instance
Returns:
The jboss-vfs VirtualFile


Copyright © 2012. All Rights Reserved.