Beispiel #1
0
 /**
  * Copies nodes from one POIFS to the other, minus the excepts.
  * This delegates the filtering work to {@link FilteringDirectoryNode},
  *  so excepts can be of the form "NodeToExclude" or
  *  "FilteringDirectory/ExcludedChildNode"
  *
  * @param source is the source POIFS to copy from
  * @param target is the target POIFS to copy to
  * @param excepts is a list of Entry Names to be excluded from the copy
  */
 public static void CopyNodes(OPOIFSFileSystem source,
                              OPOIFSFileSystem target, List <String> excepts)
 {
     CopyNodes(
         new FilteringDirectoryNode(source.Root, excepts),
         new FilteringDirectoryNode(target.Root, excepts)
         );
 }
Beispiel #2
0
        private DirectoryNode(DirectoryProperty property,
                              DirectoryNode parent,
                              OPOIFSFileSystem oFileSystem,
                              NPOIFSFileSystem nFileSystem)
            : base(property, parent)
        {
            this._oFilesSystem = oFileSystem;
            this._nFilesSystem = nFileSystem;

            if (parent == null)
            {
                _path = new POIFSDocumentPath();
            }
            else
            {
                _path = new POIFSDocumentPath(parent._path, new string[] { property.Name });
            }

            _byname  = new Dictionary <string, Entry>();
            _entries = new List <Entry>();
            IEnumerator <Property> iter = property.Children;

            while (iter.MoveNext())
            {
                Property child     = iter.Current;
                Entry    childNode = null;

                if (child.IsDirectory)
                {
                    DirectoryProperty childDir = (DirectoryProperty)child;
                    if (_oFilesSystem != null)
                    {
                        childNode = new DirectoryNode(childDir, _oFilesSystem, this);
                    }
                    else
                    {
                        childNode = new DirectoryNode(childDir, _nFilesSystem, this);
                    }
                }
                else
                {
                    childNode = new DocumentNode((DocumentProperty)child, this);
                }
                _entries.Add(childNode);
                _byname.Add(childNode.Name, childNode);
            }
        }
Beispiel #3
0
 /**
  * Copies all nodes from one POIFS to the other
  *
  * @param source
  *            is the source POIFS to copy from
  * @param target
  *            is the target POIFS to copy to
  */
 public static void CopyNodes(OPOIFSFileSystem source,
                              OPOIFSFileSystem target)
 {
     CopyNodes(source.Root, target.Root);
 }
Beispiel #4
0
 /// <summary>
 /// Create a DirectoryNode. This method Is not public by design; it
 /// Is intended strictly for the internal use of this package
 /// </summary>
 /// <param name="property">the DirectoryProperty for this DirectoryEntry</param>
 /// <param name="fileSystem">the OPOIFSFileSystem we belong to</param>
 /// <param name="parent">the parent of this entry</param>
 internal DirectoryNode(DirectoryProperty property,
                        OPOIFSFileSystem fileSystem,
                        DirectoryNode parent)
     : this(property, parent, fileSystem, (NPOIFSFileSystem)null)
 {
 }