|
||||||||||
| 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 | |
|---|---|
VirtualFile |
createDirectory(URL url)
Creates a 'directory' within the context determined by the url host part |
VFSContext |
createRoot(URL url)
Creates a new root MemoryContext, or returns an already exixting one of one already exists for the name |
boolean |
delete(URL url)
Deletes a 'file' or a 'directory' |
boolean |
deleteRoot(URL url)
Deletes a root MemoryContext |
VFS |
find(String host)
Gets hold of a root MemoryContext |
static MemoryContextFactory |
getInstance()
Gets the singleton instance |
String[] |
getProtocols()
Get the URL protocols/URI schemes this factory supports |
VFSContext |
getVFS(URI rootURI)
Obtain a vfs context for the given root uri. |
VFSContext |
getVFS(URL rootURL)
Obtain a vfs context for the given root url. |
protected static boolean |
isValidRootURL(URL url)
Is url valid root url. |
VirtualFile |
putFile(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 String[] getProtocols()
VFSContextFactory
getProtocols in interface VFSContextFactory
public VFSContext getVFS(URL rootURL)
throws IOException
VFSContextFactory
getVFS in interface VFSContextFactoryrootURL - - the URL for the root of the virtual context
IOException - - thrown if the root cannot be opened/accessed
public VFSContext getVFS(URI rootURI)
throws IOException
VFSContextFactory
getVFS in interface VFSContextFactoryrootURI - - the URI for the root of the virtual context
IOException - - thrown if the root cannot be opened/accessedpublic VFS find(String host)
host - The name of the root
protected static boolean isValidRootURL(URL url)
url - the url to check
public VFSContext createRoot(URL url)
url - The url of the root, we use the 'host' part of the name for indexing the context
IllegalArgumentException - If the url parameter contains a pathpublic VirtualFile createDirectory(URL url)
url - The url of the directory we want to create
IllegalArgumentException - if there is no root matching the host part of the url
public VirtualFile putFile(URL url,
byte[] contents)
url - The url of the directory we want to createcontents - The contents of the file
IllegalArgumentException - if there is no root matching the host part of the urlpublic boolean deleteRoot(URL url)
url - of the root context we want to delete
IllegalArgumentException - If the url parameter contains a pathpublic boolean delete(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 | |||||||||