Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

deep directory creation. #7

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion alfresco-api-examples/config.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
site=alfresco-api-demo

# Specify a folder to create in the root of the test site
folder_name=test folder
folder_name=Je/me/demande/si/je/peux/cr\u00E9er/des/r\u00E9pertoires/profonds

# Specify a test file and type
local_file_path=/users/jpotts/Documents/sample/sample-a.pdf
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,14 @@ public Folder createFolder(String parentFolderId, String folderName) {
Session cmisSession = getCmisSession();
Folder rootFolder = (Folder) cmisSession.getObject(parentFolderId);

if (folderName.contains("/")) {
for (String subFolderName : folderName.split("/")) {
rootFolder = createFolder(parentFolderId, subFolderName);
parentFolderId = rootFolder.getId();
}
return rootFolder;
}

Folder subFolder = null;
try {
// Making an assumption here that you probably wouldn't normally do
Expand Down