public class Utils extends Object
| Modifier and Type | Field and Description |
|---|---|
static String |
EXO_SYMLINK |
static long |
GB |
static long |
KB |
static String |
MAPPING_FILE |
static long |
MB |
static String |
PRIVATE |
static String |
PUBLIC |
| Constructor and Description |
|---|
Utils() |
| Modifier and Type | Method and Description |
|---|---|
static void |
addEditedConfiguredData(String template,
String className,
String id,
boolean skipActivities)
Keep the name of templates in jcr:data property at the first time loaded.
|
static String |
cleanName(String oldName)
Clean string.
|
static String |
cleanNameWithAccents(String fileName)
Return name after cleaning
|
static String |
cleanString(String str)
Clean string.
|
static String |
escapeIllegalCharacterInQuery(String query) |
static String |
fileSize(javax.jcr.Node node)
gets the file size in friendly format
|
static String |
formatSize(long size) |
static Set<String> |
getAllEditedConfiguredData(String className,
String id,
boolean skipActivities)
Get all the templates which have been added into the system
|
static javax.jcr.Node |
getChildOfType(javax.jcr.Node node,
String childType) |
static Calendar |
getDate(javax.jcr.Node node) |
static String |
getFileType(javax.jcr.Node node) |
static String |
getFileType(org.exoplatform.services.jcr.impl.core.NodeImpl node) |
static String |
getJcrContentBaseVersion(javax.jcr.Node node)
get jcr:baseVersion of a node
|
static String |
getJcrContentLastModified(javax.jcr.Node node)
get Last Modify date of jcr:content of a node
|
static Map<String,String> |
getMapImportHistory(InputStream importHistorySourceStream)
get data from the version history file
|
static List<String> |
getMemberships() |
static String |
getNodeTypeIcon(javax.jcr.Node node,
String appended) |
static String |
getNodeTypeIcon(javax.jcr.Node node,
String appended,
String mode) |
static String |
getObjectId(String nodePath) |
static String |
getOwner(javax.jcr.Node node) |
static String |
getPersonalDrivePath(String parameterizedDrivePath,
String userId) |
static List<javax.jcr.nodetype.PropertyDefinition> |
getProperties(javax.jcr.Node node) |
static javax.jcr.Node |
getServiceLogContentNode(String serviceName,
String logType)
Get Service Log Content Node of specific service.
|
static String |
getTitle(javax.jcr.Node node)
Gets the title.
|
static boolean |
hasChild(javax.jcr.Node node,
String childType) |
static boolean |
isDocument(javax.jcr.Node node)
Check if a node is document type.
|
static boolean |
isFolder(javax.jcr.Node node) |
static boolean |
isInTrash(javax.jcr.Node node) |
static boolean |
isSupportThumbnailView(String mimeType) |
static javax.jcr.Node |
makePath(javax.jcr.Node rootNode,
String path,
String nodetype) |
static javax.jcr.Node |
makePath(javax.jcr.Node rootNode,
String path,
String nodetype,
Map permissions) |
static void |
processImportHistory(javax.jcr.Node currentNode,
InputStream versionHistorySourceStream,
Map<String,String> mapHistoryValue)
this function used to process import version history for a node
|
static void |
removeDeadSymlinks(javax.jcr.Node node) |
static void |
removeDeadSymlinks(javax.jcr.Node node,
boolean keepInTrash)
Remove all the link of a deleted node
|
static void |
removeEditedConfiguredData(String template,
String className,
String id,
boolean skipActivities) |
static void |
removeSymlinks(javax.jcr.Node node)
Remove the symlink of a deleted node
|
public static final String MAPPING_FILE
public static final String EXO_SYMLINK
public static final String PRIVATE
public static final String PUBLIC
public static final long KB
public static final long MB
public static final long GB
public static javax.jcr.Node makePath(javax.jcr.Node rootNode,
String path,
String nodetype)
throws javax.jcr.PathNotFoundException,
javax.jcr.RepositoryException
javax.jcr.PathNotFoundExceptionjavax.jcr.RepositoryExceptionpublic static javax.jcr.Node makePath(javax.jcr.Node rootNode,
String path,
String nodetype,
Map permissions)
throws javax.jcr.PathNotFoundException,
javax.jcr.RepositoryException
javax.jcr.PathNotFoundExceptionjavax.jcr.RepositoryExceptionpublic static void processImportHistory(javax.jcr.Node currentNode,
InputStream versionHistorySourceStream,
Map<String,String> mapHistoryValue)
throws Exception
currentNode - versionHistorySourceStream - mapHistoryValue - Exceptionpublic static Map<String,String> getMapImportHistory(InputStream importHistorySourceStream) throws Exception
importHistorySourceStream - Exceptionpublic static String getPersonalDrivePath(String parameterizedDrivePath, String userId) throws Exception
Exceptionpublic static List<javax.jcr.nodetype.PropertyDefinition> getProperties(javax.jcr.Node node) throws Exception
Exceptionpublic static boolean isInTrash(javax.jcr.Node node)
throws javax.jcr.RepositoryException
javax.jcr.RepositoryExceptionpublic static String getTitle(javax.jcr.Node node) throws Exception
node - the nodeException - the exceptionpublic static void removeSymlinks(javax.jcr.Node node)
throws Exception
node - The deleted nodeExceptionpublic static void removeDeadSymlinks(javax.jcr.Node node,
boolean keepInTrash)
throws Exception
node - keepInTrash - true if the link will be move to trash, otherwise set by falseExceptionpublic static void removeDeadSymlinks(javax.jcr.Node node)
throws Exception
Exceptionpublic static javax.jcr.Node getChildOfType(javax.jcr.Node node,
String childType)
throws Exception
Exceptionpublic static boolean hasChild(javax.jcr.Node node,
String childType)
throws Exception
Exceptionpublic static javax.jcr.Node getServiceLogContentNode(String serviceName, String logType) throws Exception
serviceName - Exceptionpublic static Set<String> getAllEditedConfiguredData(String className, String id, boolean skipActivities) throws Exception
className - Simple name of class.id - The unique value which used to build service log name.skipActivities - To skip raising activities on activity stream.Exceptionpublic static void addEditedConfiguredData(String template, String className, String id, boolean skipActivities) throws Exception
template - Name of template which will be kept in jcr:data propertyclassName - A simple class nameid - The unique value which used to build service log name.skipActivities - To skip raising activities on activity stream.Exceptionpublic static void removeEditedConfiguredData(String template, String className, String id, boolean skipActivities) throws Exception
Exceptionpublic static String getObjectId(String nodePath) throws UnsupportedEncodingException
UnsupportedEncodingExceptionpublic static String cleanString(String str)
str - the strpublic static String cleanName(String oldName)
oldName - the strpublic static String cleanNameWithAccents(String fileName)
fileName - file namepublic static String getNodeTypeIcon(javax.jcr.Node node, String appended, String mode) throws javax.jcr.RepositoryException
javax.jcr.RepositoryExceptionpublic static String getNodeTypeIcon(javax.jcr.Node node, String appended) throws javax.jcr.RepositoryException
javax.jcr.RepositoryExceptionpublic static String getFileType(javax.jcr.Node node) throws Exception
Exceptionpublic static String getFileType(org.exoplatform.services.jcr.impl.core.NodeImpl node) throws Exception
Exceptionpublic static boolean isDocument(javax.jcr.Node node)
throws Exception
node - Exceptionpublic static String getJcrContentLastModified(javax.jcr.Node node) throws Exception
node - Exceptionpublic static String getJcrContentBaseVersion(javax.jcr.Node node) throws Exception
node - Exceptionpublic static String fileSize(javax.jcr.Node node) throws Exception
node - the file nodeExceptionpublic static String formatSize(long size)
public static boolean isSupportThumbnailView(String mimeType)
public static boolean isFolder(javax.jcr.Node node)
throws javax.jcr.RepositoryException
javax.jcr.RepositoryExceptionCopyright © 2003–2019 eXo Platform SAS. All rights reserved.