private boolean create(String nodePath, String parentPath)
{
try {
NodeRef parentNode = getRepository().findNodeRef("path", parentPath.split("/"));
} catch(Exception e) {
System.out.println("create folder - erreur de création sur " + parentPath );
return true;
}
if (parentNode!=null)
{
FileInfo fi=null;
try {
fi = getServiceRegistry().getFileFolderService().create(parentNode,nodePath.replaceAll("/", ""),ContentModel.TYPE_FOLDER);
} catch (Exception e) {
System.out.println("create folder - erreur sur create folder - ");
}
System.out.println("create folder faite - nodeParent=" + parentNode
+ " - nodePath=" + nodePath + "___"
+ "\n name=" + fi.getName() + " - nodeRef=" +fi.getNodeRef() + " - properties=" +fi.getProperties()
);
}
return false;
}
private FolderBase creatFold3bis(String parent, String folder, boolean debug)
{
System.out.println("create folder ———————debut ");
FileInfo fi=null;
NodeRef parentNode=null;
if (parentPath.equals("Espace racine"))
{
try {
parentNode = getRepository().getCompanyHome();
} catch (Exception e) {
if (debug) System.out.println(" findNodeRef no company home ");
e.printStackTrace();
}
}
else
{
try {
parentNode = getRepository().findNodeRef("path", parentPath.split("/"));
} catch(Exception e) {
System.out.println("create folder - erreur de création sur " + parentPath );
return null;
}
}
if (parentNode!=null)
{
try {
fi = getServiceRegistry().getFileFolderService().create(parentNode,nodePath.replaceAll("/", ""),ContentModel.TYPE_FOLDER);
System.out.println("create folder faite - nodeParent=" + parentNode
+ " - nodePath=" + nodePath + "___"
+ "\n name=" + fi.getName() + " - nodeRef=" +fi.getNodeRef() + " - properties=" +fi.getProperties()
);
} catch (Exception e) {
System.out.println("create folder - erreur sur create folder - ");
}
}
System.out.println("create folder ———————fin ");
return new FolderBase(fi.getName(), "workspace/SpacesStore/" + parentPath + nodePath, fi.getNodeRef(), debug );
}
Content from pre 2016 and from language groups that have been closed.
Content is read-only.
By using this site, you are agreeing to allow us to collect and use cookies as outlined in Alfresco’s Cookie Statement and Terms of Use (and you have a legitimate interest in Alfresco and our products, authorizing us to contact you in such methods). If you are not ok with these terms, please do not use this website.