public class PathUtil extends Object
| Constructor and Description |
|---|
PathUtil() |
| Modifier and Type | Method and Description |
|---|---|
static String |
getRelativePath(String targetPath,
String basePath)
Get the relative path from one file to another, specifying the directory
separator.
|
static String |
getRelativePath(String targetPath,
String basePath,
String pathSeparator)
Get the relative path from one file to another, specifying the directory
separator.
|
static String |
getSubPath(File f,
File parentDir)
Returns relative path from parentDir to f.
|
static boolean |
makeParents(File f) |
public static String getRelativePath(String targetPath, String basePath) throws org.zanata.util.PathUtil.PathResolutionException
target - targetPath is calculated to this filebase - basePath is calculated from this filePathResolutionException - if no relative path existsorg.zanata.util.PathUtil.PathResolutionExceptionpublic static String getRelativePath(String targetPath, String basePath, String pathSeparator) throws org.zanata.util.PathUtil.PathResolutionException
target - targetPath is calculated to this filebase - basePath is calculated from this fileseparator - directory separator. The platform default is not assumed
so that we can test Unix behaviour when running on Windows (for
example)PathResolutionException - if no relative path existsorg.zanata.util.PathUtil.PathResolutionExceptionpublic static String getSubPath(File f, File parentDir) throws IOException, org.zanata.util.PathUtil.PathResolutionException
f - a file inside parentDirparentDir - IOExceptionPathResolutionExceptionorg.zanata.util.PathUtil.PathResolutionExceptionpublic static boolean makeParents(File f) throws IOException
IOExceptionCopyright © 2013 Zanata Project. All Rights Reserved.