|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jboss.virtual.plugins.context.memory.MemoryContextFactory
public class MemoryContextFactory
Singelton implementation of a MemoryContextFactory. The roots are indexed as the 'host' part of the URLs they are stored under
Method Summary | |
---|---|
VirtualFileHandler |
createDirectory(java.net.URL url)
Creates a 'directory' within the context determined by the url host part |
VFSContext |
createRoot(java.net.URL url)
Creates a new root MemoryContext, or returns an already exixting one of one already exists for the name |
boolean |
delete(java.net.URL url)
Deletes a 'file' or a 'directory' |
boolean |
deleteRoot(java.net.URL url)
Deletes a root MemoryContext |
MemoryContext |
find(java.lang.String host)
Gets hold of a root MemoryContext |
static MemoryContextFactory |
getInstance()
Gets the singleton instance |
java.lang.String[] |
getProtocols()
Get the URL protocols/URI schemes this factory supports |
VFSContext |
getVFS(java.net.URI rootURI)
Obtain a vfs context for the given root uri. |
VFSContext |
getVFS(java.net.URL rootURL)
Obtain a vfs context for the given root url. |
VirtualFileHandler |
putFile(java.net.URL url,
byte[] contents)
Creates a 'file' within the context determined by the url host part |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static MemoryContextFactory getInstance()
public java.lang.String[] getProtocols()
VFSContextFactory
getProtocols
in interface VFSContextFactory
public VFSContext getVFS(java.net.URL rootURL) throws java.io.IOException
VFSContextFactory
getVFS
in interface VFSContextFactory
rootURL
- - the URL for the root of the virtual context
java.io.IOException
- - thrown if the root cannot be opened/accessedpublic VFSContext getVFS(java.net.URI rootURI) throws java.io.IOException
VFSContextFactory
getVFS
in interface VFSContextFactory
rootURI
- - the URI for the root of the virtual context
java.io.IOException
- - thrown if the root cannot be opened/accessedpublic MemoryContext find(java.lang.String host)
host
- The name of the root
public VFSContext createRoot(java.net.URL url)
url
- The url of the root, we use the 'host' part of the name for indexing the context
java.lang.IllegalArgumentException
- If the url parameter contains a pathpublic VirtualFileHandler createDirectory(java.net.URL url)
url
- The url of the directory we want tot create
java.lang.IllegalArgumentException
- if there is no root matching the host part of the urlpublic VirtualFileHandler putFile(java.net.URL url, byte[] contents)
url
- The url of the directory we want tot createcontents
- The contents of the file
java.lang.IllegalArgumentException
- if there is no root matching the host part of the urlpublic boolean deleteRoot(java.net.URL url)
url
- of the root context we want to delete
java.lang.IllegalArgumentException
- If the url parameter contains a pathpublic boolean delete(java.net.URL url)
url
- of the 'file' or 'directory' we want to delete
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |