Class TextUtil
- java.lang.Object
-
- org.exoplatform.services.jcr.webdav.util.TextUtil
-
public class TextUtil extends Object
Created by The eXo Platform SAS.- Version:
- $Id: PutCommand.java 12004 2007-01-17 12:03:57Z geaz $
- Author:
- Vitaly Guly - gavrikvetal@gmail.com
-
-
Constructor Summary
Constructors Constructor Description TextUtil()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static Stringescape(String string, char escape, boolean isPath)Escapes string using escape symbol.static StringgetExtension(String filename)Extracts the extension of the file.static booleanisMediaFile(String mimeType)Checks if Mime-Type is media mime type.static StringnameOnly(String path)Cuts the current name from the path.static StringparentPath(String path)static StringpathOnly(String path)Cuts the path from string.static StringrelativizePath(String path)Creates relative path from string.static StringrelativizePath(String path, boolean withIndex)Creates relative path from string.static StringremoveIndexFromPath(String path)Removes the index from the path if it has an index definedstatic Stringunescape(String string, char escape)Unescapes string using escape symbol.
-
-
-
Method Detail
-
unescape
public static String unescape(String string, char escape)
Unescapes string using escape symbol.- Parameters:
string- stringescape- escape symbol- Returns:
- unescaped string
-
escape
public static String escape(String string, char escape, boolean isPath)
Escapes string using escape symbol.- Parameters:
string- stringescape- escape symbolisPath- if the string is path- Returns:
- escaped string
-
relativizePath
public static String relativizePath(String path)
Creates relative path from string.- Parameters:
path- path- Returns:
- relative path
-
relativizePath
public static String relativizePath(String path, boolean withIndex)
Creates relative path from string.- Parameters:
path- pathwithIndex- indicates whether we should keep the index or not- Returns:
- relative path
-
removeIndexFromPath
public static String removeIndexFromPath(String path)
Removes the index from the path if it has an index defined
-
pathOnly
public static String pathOnly(String path)
Cuts the path from string.- Parameters:
path- full path- Returns:
- relative path.
-
parentPath
public static String parentPath(String path)
- Parameters:
path- path- Returns:
- parentPath
-
nameOnly
public static String nameOnly(String path)
Cuts the current name from the path.- Parameters:
path- path- Returns:
- current name
-
isMediaFile
public static boolean isMediaFile(String mimeType)
Checks if Mime-Type is media mime type.- Parameters:
mimeType- Mime-Type- Returns:
- true if is media false if not.
-
-