public Folder createFolder(...) throws SkyVaultException
creates a folder object in the specified location with the specified
properties.
createFolder
public Folder createFolder(Folder folder, String folderName,
Map<String, Serializable> properties) throws SkyVaultException creates a
folder object in the specified location with the specified
properties.
Parameters
- Folder folder
- A folder object representing the folder in which to create a new folder.
- String folderName
- The name of the folder to be created.
- Map<String, Serializable> properties
- A map containing the properties to be applied to the folder to be created.
Returns
Returns a Folder object representing the newly created folder.
Exception
Throws an SkyVaultServiceException if the operation cannot be completed.
Example
// Create sample folder Map<String, Serializable> properties = new HashMap<String, Serializable>(); properties.put(ContentModel.PROP_TITLE, SAMPLE_FOLDER_DESCRIPTION); properties.put(ContentModel.PROP_DESCRIPTION, SAMPLE_FOLDER_DESCRIPTION + "-00"); ... new_folder = session.getServiceRegistry().getDocumentFolderService().createFolder(parent_folder, SAMPLE_FOLDER_NAME, props);
createFolder
public Folder createFolder(Folder folder, String folderName,
Map<String, Serializable> properties, List<String> aspects) throws
SkyVaultException creates a folder object in the specified location with the
specified properties and aspects.
Parameters
- Folder folder
- A folder object representing the folder in which to create a new folder.
- String folderName
- The name of the folder to be created.
- Map<String, Serializable> properties
- A map containing the properties to be applied to the folder to be created.
- List<String> aspects
- The list of aspects to be applied. If no aspects are specified the default aspects will be applied.
Returns
Returns a Folder object representing the newly created folder.
Exception
Throws an SkyVaultServiceException if the operation cannot be completed.
Example
// Retrieve Unit test root folder. Folder rootFolder = createUnitTestFolder(alfsession); Assert.assertNotNull(rootFolder); // Create Folder with aspects (title and geographic implicitly) Map<String, Serializable> properties = new HashMap<String, Serializable>(); properties.put(ContentModel.PROP_TITLE, ROOT_TEST_FOLDER_NAME); properties.put(ContentModel.PROP_DESCRIPTION, ROOT_TEST_FOLDER_NAME); properties.put(ContentModel.PROP_LATITUDE, 51.522543); properties.put(ContentModel.PROP_LONGITUDE, -0.716689); // Add Aspect EXIF (explicitly List<String> aspects = new ArrayList<String>(1); aspects.add(ContentModel.ASPECT_EXIF); Folder folder = docfolderservice.createFolder(rootFolder, ROOT_TEST_FOLDER_NAME, properties, aspects);
Note: This method was added in version 1.1 of the SDK.
createFolder
public Folder createFolder(Folder folder, String folderName,
Map<String, Serializable> properties, List<String> aspects, String type)
throws SkyVaultException creates a folder object in the specified location with
the specified properties and aspects.
Parameters
- Folder folder
- A folder object representing the folder in which to create a new folder.
- String folderName
- The name of the folder to be created.
- Map<String, Serializable> properties
- A map containing the properties to be applied to the folder to be created.
- List<String> aspects
- The list of aspects to be applied. If no aspects are specified the default aspects will be applied.
- String type
- The custom type for the folder. If no type is specified the default type of cm:folder will be used.
Returns
Returns a Folder object representing the newly created folder.
Exception
Throws an SkyVaultServiceException if the operation cannot be completed.
Example
// Retrieve Unit test root folder. Folder rootFolder = createUnitTestFolder(alfsession); Assert.assertNotNull(rootFolder); // Create Folder with aspects (title and geographic implicitly) Map<String, Serializable> properties = new HashMap<String, Serializable>(); properties.put(ContentModel.PROP_TITLE, ROOT_TEST_FOLDER_NAME); properties.put(ContentModel.PROP_DESCRIPTION, ROOT_TEST_FOLDER_NAME); properties.put(ContentModel.PROP_LATITUDE, 51.522543); properties.put(ContentModel.PROP_LONGITUDE, -0.716689); // Add Aspect EXIF (explicitly List<String> aspects = new ArrayList<String>(1); aspects.add(ContentModel.ASPECT_EXIF); // "fdk:customfolder" is defined in your custom content model Folder folder = docfolderservice.createFolder(rootFolder, ROOT_TEST_FOLDER_NAME, properties, aspects, "fdk:customfolder");
Note: This method was added in version 1.1 of the SDK.