|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jboss.virtual.VFSUtils
public class VFSUtils
VFS Utilities
Field Summary | |
---|---|
static java.lang.String |
VFS_LINK_NAME
|
static java.lang.String |
VFS_LINK_PREFIX
|
static java.lang.String |
VFS_LINK_TARGET
|
Constructor Summary | |
---|---|
VFSUtils()
|
Method Summary | |
---|---|
static void |
addManifestLocations(VirtualFile file,
java.util.List<VirtualFile> paths)
Add manifest paths |
static java.lang.String |
fixName(java.lang.String name)
Fix a name (removes any trailing slash) |
static java.util.jar.Manifest |
getManifest(VFS archive)
Get a manifest from a virtual file system, assuming the root of the VFS is the root of an archive |
static java.util.jar.Manifest |
getManifest(VirtualFile archive)
Get a manifest from a virtual file, assuming the virtual file is the root of an archive |
static java.lang.String |
getName(java.net.URI uri)
|
static java.lang.String |
getPathsString(java.util.Collection<VirtualFile> paths)
Get the paths string for a collection of virtual files |
static boolean |
isLink(java.lang.String name)
Does a vf name contain the VFS link prefix |
static void |
parseLinkProperties(java.io.InputStream is,
java.util.List<LinkInfo> info,
java.util.Properties props)
Parse a properties link file |
static java.util.Map<java.lang.String,java.lang.String> |
parseURLQuery(java.lang.String query)
Take a URL.getQuery string and parse it into name=value pairs |
static java.util.List<LinkInfo> |
readLinkInfo(java.io.InputStream is,
java.lang.String name,
java.util.Properties props)
Read the link information from the stream based on the type as determined from the name suffix. |
static java.util.jar.Manifest |
readManifest(VirtualFile manifest)
Read the manifest from given manifest VirtualFile. |
static java.net.URI |
toURI(java.net.URL url)
Deal with urls that may include spaces. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String VFS_LINK_PREFIX
public static final java.lang.String VFS_LINK_NAME
public static final java.lang.String VFS_LINK_TARGET
Constructor Detail |
---|
public VFSUtils()
Method Detail |
---|
public static java.lang.String getPathsString(java.util.Collection<VirtualFile> paths)
paths
- the paths
java.lang.IllegalArgumentException
- for null pathspublic static void addManifestLocations(VirtualFile file, java.util.List<VirtualFile> paths) throws java.io.IOException
file
- the filepaths
- the paths to add to
java.io.IOException
- if there is an error reading the manifest or the
virtual file is closed
java.lang.IllegalStateException
- if the file has no parent
java.lang.IllegalArgumentException
- for a null file or pathspublic static java.util.jar.Manifest getManifest(VirtualFile archive) throws java.io.IOException
archive
- the root the archive
java.io.IOException
- if there is an error reading the manifest or the
virtual file is closed
java.lang.IllegalArgumentException
- for a null archivepublic static java.util.jar.Manifest readManifest(VirtualFile manifest) throws java.io.IOException
manifest
- the VF to read from
java.io.IOException
- if problems while opening VF stream occurpublic static java.util.jar.Manifest getManifest(VFS archive) throws java.io.IOException
archive
- the vfs
java.io.IOException
- if there is an error reading the manifest
java.lang.IllegalArgumentException
- for a null archivepublic static java.lang.String fixName(java.lang.String name)
name
- the name to fix
java.lang.IllegalArgumentException
- for a null namepublic static java.lang.String getName(java.net.URI uri)
uri
-
public static java.util.Map<java.lang.String,java.lang.String> parseURLQuery(java.lang.String query)
query
- Possibly empty/null url query string
public static boolean isLink(java.lang.String name)
name
- - the name portion of a virtual file
public static java.util.List<LinkInfo> readLinkInfo(java.io.InputStream is, java.lang.String name, java.util.Properties props) throws java.io.IOException, java.net.URISyntaxException
is
- - input stream to the link file contentsname
- - the name of the virtual file representing the linkprops
- the propertes
java.io.IOException
- on failure to read/parse the stream
java.net.URISyntaxException
- for an error parsing a URIpublic static void parseLinkProperties(java.io.InputStream is, java.util.List<LinkInfo> info, java.util.Properties props) throws java.io.IOException, java.net.URISyntaxException
is
- - input stream to the link file contentsinfo
- the link infosprops
- the propertes
java.io.IOException
- on failure to read/parse the stream
java.net.URISyntaxException
- for an error parsing a URIpublic static java.net.URI toURI(java.net.URL url) throws java.net.URISyntaxException
url
- the url
java.net.URISyntaxException
- for any error
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |