String typeStr=request.getParameter("Type");
String currentFolderStr=request.getParameter("CurrentFolder");
String currentPath=baseDir+typeStr+currentFolderStr;
File currentDir = fckMgr.getFolder(blogCode, currentPath);
if (currentDir == null) {
currentDir = fckMgr.createFolder(blogCode, currentPath, user);
}
Document document=null;
try {
DocumentBuilderFactory factory=DocumentBuilderFactory.newInstance();
DocumentBuilder builder = factory.newDocumentBuilder();
document=builder.newDocument();
} catch (ParserConfigurationException pce) {
pce.printStackTrace();
}
Node root=CreateCommonXml(document,commandStr,typeStr,currentFolderStr,"some.fckcontent?blog="+blogCode+"&filepath="+currentPath);
LOGGER.debug("Command = " + commandStr);
if(commandStr.equals("GetFolders")) {
getFolders(currentDir,root,document);
}
else if (commandStr.equals("GetFoldersAndFiles")) {
getFolders(currentDir,root,document);
getFiles(currentDir,root,document);
}
else if (commandStr.equals("CreateFolder")) {
String newFolderStr=request.getParameter("NewFolderName");
String retValue="110";
if(fckMgr.getFolder(blogCode, currentPath+newFolderStr) != null) {
retValue="101";
}
else {
File newFolder=fckMgr.createFolder(blogCode, currentPath+newFolderStr, user);
if (newFolder != null) {
retValue="0";
} else {
retValue="102";
}