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,
InputStream is)
Create a external file in the specified folder.
|
static FolderItem |
createExternalFile(WorkspaceFolder destinationFolder,
String name,
String description,
InputStream is,
Map<String,String> properties)
Create an external file with properties
|
static FolderItem |
createExternalFile(WorkspaceFolder destinationFolder,
String name,
String description,
InputStream is,
Map<String,String> properties,
String mimeType,
long size)
Create an external file with mimetype and properties
|
static FolderItem |
createExternalFile(WorkspaceFolder destinationFolder,
String name,
String description,
String storageId)
Create an external file in the specified folder.
|
static FolderItem |
createExternalFile(WorkspaceFolder destinationFolder,
String name,
String description,
String mimeType,
InputStream is)
Create an item by inpustream with a given mimetype
|
static FolderItem |
createExternalFile(WorkspaceFolder destinationFolder,
String name,
String description,
String storageId,
Map<String,String> properties)
Create a external file with properties
|
static FolderItem |
createExternalFile(WorkspaceFolder destinationFolder,
String name,
String description,
String storageId,
Map<String,String> properties,
String mimeType,
long size)
Create a external file with properties
|
static FolderItem |
createExternalFile(WorkspaceFolder destinationFolder,
String name,
String description,
String mimeType,
String storageId) |
static ACLType |
getACLTypeByKey(List<String> list)
Get ACL by key
|
static String |
getCopyName(String initialName,
WorkspaceFolder folder)
Retrieve an unique name copying a item to the specified folder.
|
static List<String> |
getMembersByGroup(String id)
Get members by group ID
|
static String |
getUniqueName(String initialName,
WorkspaceFolder folder)
Retrieve an unique name for the specified folder.
|
static void |
overwrite(WorkspaceItem item,
FileInputStream fileInputStream) |
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 storageId) throws InsufficientPrivilegesException, InternalErrorException, ItemAlreadyExistException, IOException
destinationFolder - the destination folder.name - the external file name.description - the external file description.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, String storageId) throws InsufficientPrivilegesException, InternalErrorException, ItemAlreadyExistException, IOException
public static FolderItem createExternalFile(WorkspaceFolder destinationFolder, String name, String description, String storageId, Map<String,String> properties) 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 storageId, Map<String,String> properties, String mimeType, long size) 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, 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 FolderItem createExternalFile(WorkspaceFolder destinationFolder, String name, String description, String mimeType, InputStream is) throws InsufficientPrivilegesException, InternalErrorException, ItemAlreadyExistException, IOException
destinationFolder - name - description - mimeType - is - InsufficientPrivilegesExceptionInternalErrorExceptionItemAlreadyExistExceptionIOExceptionpublic static FolderItem createExternalFile(WorkspaceFolder destinationFolder, String name, String description, InputStream is, Map<String,String> properties) 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, InputStream is, Map<String,String> properties, String mimeType, long size) throws InsufficientPrivilegesException, InternalErrorException, ItemAlreadyExistException, IOException
destinationFolder - name - description - is - mimeType - properties - InsufficientPrivilegesExceptionInternalErrorExceptionItemAlreadyExistExceptionIOExceptionpublic static ACLType getACLTypeByKey(List<String> list) throws InternalErrorException
list - InternalErrorExceptionpublic static List<String> getMembersByGroup(String id) throws InternalErrorException
id - the gruoup IDInternalErrorExceptionpublic static void overwrite(WorkspaceItem item, FileInputStream fileInputStream) throws InternalErrorException, InsufficientPrivilegesException, ItemNotFoundException
item - fileInputStream - InternalErrorExceptionInsufficientPrivilegesExceptionItemNotFoundExceptionCopyright © 2020. All Rights Reserved.