文件夹的创建

package jwis.retest;

import wt.fc.ObjectReference;
import wt.fc.Persistable;
import wt.fc.ReferenceFactory;
import wt.folder.Folder;
import wt.folder.FolderHelper;
import wt.inf.container.WTContainer;
import wt.inf.container.WTContainerRef;
import wt.util.WTException;

/**
*
* @author Administrator
* 该类用于文件夹的创建
*/

public class InitFolder {

//获取文件夹的路径
public static String setFilePath(String folderPath){

String path = folderPath;

if(path == null || path.equals("")){
return "";
}

Folder subFolder = null;

String folderRef = "";

if(!path.startsWith("/")){

path = "/" + path;
}

if(!path.startsWith("/Default") && !path.equalsIgnoreCase("/Default")){

path = "/Default" + path;

}

return path;

}

//获取子文件夹
public static String getFolder(String path,WTContainer wtContainer) throws WTException{

String folderRef = "";

Folder subFoldSer = FolderHelper.service.getFolder(path,WTContainerRef.newWTContainerRef(wtContainer));

if(subFoldSer == null){

path = "/Default";

subFoldSer = FolderHelper.service.getFolder(path,WTContainerRef.newWTContainerRef(wtContainer));
}else{

ReferenceFactory ref = new ReferenceFactory();

folderRef = ref.getReferenceString(ObjectReference.newObjectReference(((Persistable) subFoldSer).getPersistInfo().getObjectIdentifier()));

}

return folderRef;

}




//得到文件夹结构
public static String getFolderOnly(String path,WTContainer wtContainer){




return null;

}

//得到文件夹结构,没有的则创建
public static String getFolderRef(String path,WTContainer wtContainer){




return null;

}


}

猜你喜欢

转载自katch-chou.iteye.com/blog/1035556