Hi ,
I am writing a java class to push contents from a directory which is present in my local machine to a workarea in TeamSite.
I am following the below steps to achieve this.
1) getting the CSSDK client connection to the TeamSite.
2) Use IoUtils.copyLocalFileToStore method to push the contents.
I am able to push the contents successfully only if i have the directory structure created in TeamSite workarea as in the local machine. For example.
In Local machine i have C:\DCR\templatedata\Category1\Data\en_US\dcr1.
then in Teamsite i need to have the below structure
In TeamSite WORKAREA\workarea\templatedata\Category1\Data\en_US.
I found a .createDirectory Method, I believe this is used to create the directory structure in my workarea and this is how i am using it.
destPath - path to my workarea -> reading from a property file
cspath - templatedata\Category1\Data\en_US\dcr1 ( manupulated from C:\DCR\templatedata\Category1\Data\en_US\dcr1)
##############
CSVPath workareaPath = new CSVPath(destPath);
CSVPath path5 = workareaPath.getArea();
CSWorkarea teamsiteWorkarea = csClient.getWorkarea(path5, false);
CSAreaRelativePath teamsitefileAreaPath = new CSAreaRelativePath(cspath);
if (teamsiteWorkarea.getFile(teamsitefileAreaPath) == null) {
CSDir dir1 = teamsiteWorkarea.createDirectory(teamsitefileAreaPath);
}
#############
I am getting a null pointer exception when i run the class
Can you please help me to underastand if .createDirectory method is used to create the path in my Workarea ?
Thanks
Paul