public class WorkspaceUtil extends Object
| Modifier and Type | Field and Description |
|---|---|
protected static org.slf4j.Logger |
logger |
| Constructor and Description |
|---|
WorkspaceUtil() |
| Modifier and Type | Method and Description |
|---|---|
static String |
cleanName(String name)
Clean the given name from invalid chars.
|
static FolderItem |
createExternalFile(WorkspaceFolder destinationFolder,
String name,
String description,
String mimeType,
InputStream is)
Create a external file in the specified folder.
|
static FolderItem |
createExternalFile(WorkspaceFolder destinationFolder,
String name,
String description,
String mimeType,
String storageId)
Create a external file in the specified folder.
|
static ACLType |
getACLTypeByKey(List<String> list) |
static String |
getCopyName(String initialName,
WorkspaceFolder folder)
Retrieve an unique name copying a item to the specified folder.
|
static List<String> |
getMembersByGroup(String id) |
static File |
getTmpFile(InputStream in) |
static String |
getUniqueName(String initialName,
WorkspaceFolder folder)
Retrieve an unique name for the specified folder.
|
static String |
returnThreeDigitNo(int number)
Add prefix to number e.g (1 = 001)
|
public static String getUniqueName(String initialName, WorkspaceFolder folder) throws InternalErrorException
initialName - the initial name.folder - the item folder.InternalErrorException - if an error occurs.public static String getCopyName(String initialName, WorkspaceFolder folder) throws InternalErrorException
initialName - the initial name.folder - the item folder.InternalErrorException - if an error occurs.public static String returnThreeDigitNo(int number)
number - public static String cleanName(String name) throws InternalErrorException
name - the name to clean.InternalErrorException - if an error occurs.public static FolderItem createExternalFile(WorkspaceFolder destinationFolder, String name, String description, String mimeType, String storageId) throws InsufficientPrivilegesException, InternalErrorException, ItemAlreadyExistException, IOException
destinationFolder - the destination folder.name - the external file name.description - the external file description.mimeType - the external file mimetype.is - the external file data.InsufficientPrivilegesException - if an error occurs.InternalErrorException - if an error occurs.ItemAlreadyExistException - if an error occurs.IOExceptionpublic static FolderItem createExternalFile(WorkspaceFolder destinationFolder, String name, String description, String mimeType, InputStream is) throws InsufficientPrivilegesException, InternalErrorException, ItemAlreadyExistException, IOException
destinationFolder - the destination folder.name - the external file name.description - the external file description.mimeType - the external file mimetype.is - the external file data.InsufficientPrivilegesException - if an error occurs.InternalErrorException - if an error occurs.ItemAlreadyExistException - if an error occurs.IOExceptionpublic static File getTmpFile(InputStream in) throws InternalErrorException
InternalErrorExceptionpublic static List<String> getMembersByGroup(String id) throws InternalErrorException
InternalErrorExceptionCopyright © 2015. All Rights Reserved.