eXo JCR :: Component :: Webdav Service 1.15.10-GA

org.exoplatform.services.jcr.webdav.util
Class TextUtil

java.lang.Object
  extended by org.exoplatform.services.jcr.webdav.util.TextUtil

public class TextUtil
extends Object

Created by The eXo Platform SARL Author : Vitaly Guly.

Version:
$Id: PutCommand.java 12004 2007-01-17 12:03:57Z geaz $

Field Summary
static char[] hexTable
          Hexademical characters.
static BitSet URISave
           
static BitSet URISaveEx
           
 
Constructor Summary
TextUtil()
           
 
Method Summary
static String escape(String string, char escape, boolean isPath)
          Escapes string using escape symbol.
static String getExtension(String filename)
          Extracts the extension of the file.
static boolean isMediaFile(String mimeType)
          Checks if Mime-Type is media mime type.
static String nameOnly(String path)
          Cuts the current name from the path.
static String parentPath(String path)
           
static String pathOnly(String path)
          Cuts the path from string.
static String relativizePath(String path)
          Creates relative path from string.
static String unescape(String string, char escape)
          Unescapes string using escape symbol.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

URISave

public static BitSet URISave

URISaveEx

public static BitSet URISaveEx

hexTable

public static final char[] hexTable
Hexademical characters.

Constructor Detail

TextUtil

public TextUtil()
Method Detail

unescape

public static String unescape(String string,
                              char escape)
Unescapes string using escape symbol.

Parameters:
string - string
escape - escape symbol
Returns:
unescaped string

escape

public static String escape(String string,
                            char escape,
                            boolean isPath)
Escapes string using escape symbol.

Parameters:
string - string
escape - escape symbol
isPath - 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

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.

getExtension

public static String getExtension(String filename)
Extracts the extension of the file.

Parameters:
filename - file name
Returns:
extension or emtpy string if file has no extension

eXo JCR :: Component :: Webdav Service 1.15.10-GA

Copyright © 2014 eXo Platform SAS. All Rights Reserved.