|
|||||||||||
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 |
FILE_SCHEMA
|
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 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
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. Network protocols such
as http, ftp, etc. are not supported. If such cases happens,
resource
is returned.
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
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |