|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.eclipse.birt.report.model.api.util.URIUtil
Utility class to handle URI.
Field Summary | |
static java.lang.String |
BUNDLE_RESOURCE_SCHEMA
URL with bundle resource protocol. |
static java.lang.String |
FILE_SCHEMA
File schema. |
static java.lang.String |
FTP_SCHEMA
URL with JAR protocol. |
static java.lang.String |
HTTP_SCHEMA
URL with JAR protocol. |
static java.lang.String |
JAR_EXTENTION
File with jar extention name. |
static java.lang.String |
JAR_SCHEMA
URL with JAR protocol. |
Constructor Summary | |
URIUtil()
|
Method Summary | |
static java.lang.String |
convertFileNameToURLString(java.lang.String filePath)
Converts a filename to a valid URL string. |
static java.net.URL |
getDirectory(java.lang.String filePath)
Converts a filename to a valid URL. |
static java.lang.String |
getLocalPath(java.lang.String uri)
Checks uri is file path. |
static java.lang.String |
getRelativePath(java.lang.String base,
java.lang.String resource)
Return the relative path for the given resource according
to base . |
static boolean |
isValidResourcePath(java.lang.String resourceDir)
Tests whether the input string is a valid resource directory. |
static java.lang.String |
resolveAbsolutePath(java.lang.String base,
java.lang.String relativePath)
Return the relative path for the given resource according
to base . |
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 FILE_SCHEMA
public static final java.lang.String JAR_SCHEMA
public static final java.lang.String HTTP_SCHEMA
public static final java.lang.String FTP_SCHEMA
public static final java.lang.String BUNDLE_RESOURCE_SCHEMA
public static final java.lang.String JAR_EXTENTION
Constructor Detail |
public URIUtil()
Method Detail |
public static java.lang.String getLocalPath(java.lang.String uri)
uri
is file path. If uri
is an
absolute uri and refers to a file, removes "file://" and returns the file
path. If uri
is relative uri and refers to a file, returns
the uri
. For other cases, returns null.
For examples, following uri are supported:
uri
- the input uri
uri
refers to a file. Otherwise
null.public static java.lang.String convertFileNameToURLString(java.lang.String filePath)
filePath
- the file name
public static java.net.URL getDirectory(java.lang.String filePath)
filePath
- the file name
public static java.lang.String getRelativePath(java.lang.String base, java.lang.String resource)
resource
according
to base
. Only handle file system and valid url syntax.
The base
value should be directory ONLY and does NOT
contain file name and the format can be:
/
in the end of directory will be striped in the
return value.
base
- the base directoryresource
- the full path
public static java.lang.String resolveAbsolutePath(java.lang.String base, java.lang.String relativePath)
resource
according
to base
. Only handle file system. Network protocols such
as http, ftp, etc. are not supported.
The base
value should be directory ONLY and does NOT
contain file name and the format can be:
base
- the base directoryrelativePath
- the relative path
public static boolean isValidResourcePath(java.lang.String resourceDir)
resourceDir
- the resource directory
true
if the input string is a valid resource
directory, false
otherwise.
java.net.MalformedURLException
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |