本文整理汇总了Java中com.pff.PSTFolder类的典型用法代码示例。如果您正苦于以下问题:Java PSTFolder类的具体用法?Java PSTFolder怎么用?Java PSTFolder使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
PSTFolder类属于com.pff包,在下文中一共展示了PSTFolder类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: buildTree
import com.pff.PSTFolder; //导入依赖的package包/类
private void buildTree(DefaultMutableTreeNode top, PSTFolder theFolder) {
// this is recursive, try and keep up.
try {
Vector children = theFolder.getSubFolders();
Iterator childrenIterator = children.iterator();
while (childrenIterator.hasNext()) {
PSTFolder folder = (PSTFolder)childrenIterator.next();
DefaultMutableTreeNode node = new DefaultMutableTreeNode(folder.getDisplayName());
if (folder.getSubFolders().size() > 0) {
buildTree(node, folder);
}
top.add(node);
}
} catch (Exception err) {
System.exit(1);
}
}
示例2: getPSTFolder
import com.pff.PSTFolder; //导入依赖的package包/类
/**
* *
* Get Folder structure for provided .pst file path
*
* @return @throws PSTException
* @throws IOException
* @throws Exception
*/
public PSTFolder getPSTFolder() throws PSTException, IOException, Exception {
PSTFile pstFile = new PSTFile(this.emailFilePath);
if (pstFile == null) {
throw new Exception("pstFile object is null.");
}
return pstFile.getRootFolder();
}
示例3: caching
import com.pff.PSTFolder; //导入依赖的package包/类
private static void caching () {
try {
PSTFolder root = pstFile.getRootFolder() ;
status = writeToCache(root);
logger.log(Level.INFO, "Finisch Caching Email");
}
catch (PSTException e) {
logger.log(Level.SEVERE, "Uncaught exception", e);
status = false;
}
catch (IOException ex){
logger.log(Level.SEVERE, "Uncaught exception", ex);
status = false;
}
}
示例4: writeToCache
import com.pff.PSTFolder; //导入依赖的package包/类
private static boolean writeToCache (PSTFolder mainFolder) {
boolean statusTmp = false;
try{
Iterator<PSTFolder> itr = mainFolder.getSubFolders().iterator();
while ( itr.hasNext() ){
PSTFolder folder = itr.next();
if ( folder.getSubFolders().size() > 0 && folder.hasSubfolders() ) {
if ( folder.getContentCount() > 0 )
messageHeaderList.addAll(getFolderContent(folder));
writeToCache(folder);
}
else {
messageHeaderList.addAll(getFolderContent(folder));
}
}
statusTmp = true;
}
catch (PSTException e) {
logger.log(Level.SEVERE, "Uncaught exception", e);
}
catch (IOException ex){
logger.log(Level.SEVERE, "Uncaught exception", ex);
}
return (statusTmp);
}
示例5: processFolder
import com.pff.PSTFolder; //导入依赖的package包/类
/**
*
* @param folder found folder from PST
* @throws PSTException PST API error
* @throws IOException I/O failure
* @throws ConfigException XText configuration error
*/
protected void processFolder(PSTFolder folder) throws PSTException, IOException,
ConfigException {
log.info("Folder:" + folder.getDisplayName());
++depth;
if (depth >= maxDepth) {
--depth;
log.error("MAX DEPTH reached. Avoid infinite recursion");
return;
}
if (folder.hasSubfolders()) {
Vector<PSTFolder> children = folder.getSubFolders();
for (PSTFolder child : children) {
processFolder(child);
}
}
log.info("\t\tProcessing content items");
int count = folder.getContentCount();
if (count > 0) {
PSTObject msg = null;
while ((msg = folder.getNextChild()) != null) {
// As libPST is organized with PSTMessage (email) being a base class, it must only be used as a default.
// Try all other subclasses first.
//
String savedItem = null;
if (msg instanceof PSTContact) {
savedItem = processContact("Contacts", folder.getDisplayName(),
(PSTContact) msg);
} else if (msg instanceof PSTDistList) {
savedItem = processDistList("Lists", folder.getDisplayName(), (PSTDistList) msg);
} else if (msg instanceof PSTAppointment) {
savedItem = processAppointment("Appointments", folder.getDisplayName(),
(PSTAppointment) msg);
} else if (msg instanceof PSTMessage) {
processMessage(folder.getDisplayName(), (PSTMessage) msg);
} else {
log.info("\tItem: {}; Type:{} created at {}", msg.getDisplayName(),
msg.getMessageClass(), msg.getCreationTime());
}
if (savedItem != null && listener != null) {
listener.collected(new File(savedItem));
}
}
}
--depth;
}