Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance. Project price only 1 $
You can buy this project and download/modify it how often you want.
/* ====================================================================
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
==================================================================== */
package org.apache.poi.poifs.poibrowser;
import java.util.HashMap;
import java.util.Map;
import javax.swing.tree.DefaultMutableTreeNode;
import javax.swing.tree.MutableTreeNode;
import org.apache.poi.hpsf.HPSFException;
import org.apache.poi.poifs.eventfilesystem.POIFSReaderEvent;
import org.apache.poi.poifs.eventfilesystem.POIFSReaderListener;
import org.apache.poi.poifs.filesystem.DocumentInputStream;
import org.apache.poi.poifs.filesystem.POIFSDocumentPath;
/**
*
Organizes document information in a tree model in order to be
* e.g. displayed in a Swing {@link javax.swing.JTree}. An instance of this
* class is created with a root tree node ({@link MutableTreeNode}) and
* registered as a {@link POIFSReaderListener} with a {@link
* org.apache.poi.poifs.eventfilesystem.POIFSReader}. While the latter processes
* a POI filesystem it calls this class' {@link #processPOIFSReaderEvent} for
* each document it has been registered for. This method appends the document it
* processes at the appropriate position into the tree rooted at the
* above mentioned root tree node.
*
*
The root tree node should be the root tree node of a {@link
* javax.swing.tree.TreeModel}.
*
*
A top-level element in the tree model, i.e. an immediate child
* node of the root node, describes a POI filesystem as such. It is
* suggested to use the file's name (as seen by the operating system)
* but it could be any other string.
*
*
The value of a tree node is a {@link DocumentDescriptor}. Unlike
* a {@link org.apache.poi.poifs.filesystem.OPOIFSDocument} which may be as heavy
* as many megabytes, an instance of {@link DocumentDescriptor} is a
* light-weight object and contains only some meta-information about a
* document.
*/
public class TreeReaderListener implements POIFSReaderListener
{
/**
*
The tree's root node. POI filesystems get attached to this
* node as children.
*/
protected MutableTreeNode rootNode;
/**
*
Maps filenames and POI document paths to their associated
* tree nodes.