com.opensymphony.xwork2.util
Class URLUtil

java.lang.Object
  extended by com.opensymphony.xwork2.util.URLUtil

public class URLUtil
extends Object

Helper class to extract file paths from different urls


Field Summary
static String JBOSS5_VFS
           
static String JBOSS5_VFSFILE
           
static String JBOSS5_VFSMEMORY
           
static String JBOSS5_VFSZIP
           
 
Constructor Summary
URLUtil()
           
 
Method Summary
static URL getJBossPhysicalUrl(URL url)
          Try to determine physical file location.
static boolean isJarURL(URL fileUrl)
          Check if given URL is matching Jar pattern for different servers
static boolean isJBossUrl(URL fileUrl)
          Check if given URL is pointing to JBoss 5 VFS resource
static URL normalizeToFileProtocol(URL url)
          Convert URLs to URLs with "file" protocol
static boolean verifyUrl(String url)
          Verify That the given String is in valid URL format.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

JBOSS5_VFS

public static final String JBOSS5_VFS
See Also:
Constant Field Values

JBOSS5_VFSZIP

public static final String JBOSS5_VFSZIP
See Also:
Constant Field Values

JBOSS5_VFSMEMORY

public static final String JBOSS5_VFSMEMORY
See Also:
Constant Field Values

JBOSS5_VFSFILE

public static final String JBOSS5_VFSFILE
See Also:
Constant Field Values
Constructor Detail

URLUtil

public URLUtil()
Method Detail

normalizeToFileProtocol

public static URL normalizeToFileProtocol(URL url)
Convert URLs to URLs with "file" protocol

Parameters:
url - URL to convert to a jar url
Returns:
a URL to a file, or null if the URL external form cannot be parsed

verifyUrl

public static boolean verifyUrl(String url)
Verify That the given String is in valid URL format.

Parameters:
url - The url string to verify.
Returns:
a boolean indicating whether the URL seems to be incorrect.

isJarURL

public static boolean isJarURL(URL fileUrl)
Check if given URL is matching Jar pattern for different servers

Parameters:
fileUrl -
Returns:

isJBossUrl

public static boolean isJBossUrl(URL fileUrl)
Check if given URL is pointing to JBoss 5 VFS resource

Parameters:
fileUrl -
Returns:

getJBossPhysicalUrl

public static URL getJBossPhysicalUrl(URL url)
                               throws IOException
Try to determine physical file location.

Parameters:
url - JBoss VFS URL
Returns:
URL pointing to physical file or original URL
Throws:
IOException - If conversion fails


Copyright © 2000-2012 Apache Software Foundation. All Rights Reserved.