Esempio n. 1
0
        /**
         * <p>Creates the most specific {@link PropertySet} from an entry
         *  in the specified POIFS Directory. This is preferrably a {@link
         * DocumentSummaryInformation} or a {@link SummaryInformation}. If
         * the specified entry does not contain a property Set stream, an
         * exception is thrown. If no entry is found with the given name,
         * an exception is thrown.</p>
         *
         * @param dir The directory to find the PropertySet in
         * @param name The name of the entry Containing the PropertySet
         * @return The Created {@link PropertySet}.
         * @if there is no entry with that name
         * @if the stream does not
         * contain a property Set.
         * @if some I/O problem occurs.
         * @exception EncoderFallbackException if the specified codepage is not
         * supported.
         */

        public static PropertySet Create(DirectoryEntry dir, string name)
        {
            Stream inp = null;

            try {
                DocumentEntry entry = (DocumentEntry)dir.GetEntry(name);
                inp = new DocumentInputStream(entry);
                try {
                    return(Create(inp));
                }
                catch (MarkUnsupportedException) { return(null); }
            }
            finally {
                if (inp != null)
                {
                    inp.Dispose();
                }
            }
        }
Esempio n. 2
0
 protected override void Dispose(bool disposing)
 {
     _stream.Dispose();
 }