public class PathUtil
Type Params | Return Type | Name and description |
---|---|---|
|
public static String |
absoluteToRelativePath(String absolutePath, String projectFolderPath) |
|
public static File |
ensureDirectory(File file, boolean isFile) Create path for file if not existed. |
|
public static String |
getRelativePathForLog(String fileName) Get relative path for xml log. |
|
public static URL |
getUrl(String rawUrl, String defaultProtocol) Returns an instance of URL that parsed from the given rawUrl |
|
public static String |
relativeToAbsolutePath(String relativePath, String projectFolderPath) |
Create path for file if not existed. If isFile create path to parent directory of the file. Or else create directory for the path.
file
- File whose parent need to be created.isFile
- true if the path in file file. false if path is directory.Get relative path for xml log. The path will start from the report folder.
fileName
- Absolute path of the file. Returns an instance of URL that parsed from the given rawUrl
rawUrl
- input of an URL.
defaultProtocol
- : In case the given rawUrl
doesn't contain its protocol, system will use this parameter
instead. Example: rawUrl = google.com
and defaultProtocol = https
then URL = https://www.google.com