KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > poi > contrib > poibrowser > PropertySetDescriptor


1
2 /* ====================================================================
3    Copyright 2002-2004 Apache Software Foundation
4
5    Licensed under the Apache License, Version 2.0 (the "License");
6    you may not use this file except in compliance with the License.
7    You may obtain a copy of the License at
8
9        http://www.apache.org/licenses/LICENSE-2.0
10
11    Unless required by applicable law or agreed to in writing, software
12    distributed under the License is distributed on an "AS IS" BASIS,
13    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14    See the License for the specific language governing permissions and
15    limitations under the License.
16 ==================================================================== */

17         
18
19 package org.apache.poi.contrib.poibrowser;
20
21 import java.io.IOException JavaDoc;
22 import java.io.UnsupportedEncodingException JavaDoc;
23
24 import org.apache.poi.hpsf.MarkUnsupportedException;
25 import org.apache.poi.hpsf.NoPropertySetStreamException;
26 import org.apache.poi.hpsf.PropertySet;
27 import org.apache.poi.hpsf.PropertySetFactory;
28 import org.apache.poi.hpsf.UnexpectedPropertySetTypeException;
29 import org.apache.poi.poifs.filesystem.DocumentInputStream;
30 import org.apache.poi.poifs.filesystem.POIFSDocumentPath;
31
32 /**
33  * <p>Describes the most important (whatever that is) features of a
34  * stream containing a {@link PropertySet}.</p>
35  *
36  * @author Rainer Klute (klute@rainer-klute.de)
37  * @version $Id: PropertySetDescriptor.java,v 1.4 2004/06/22 16:16:33 klute Exp $
38  * @since 2002-02-05
39  */

40 public class PropertySetDescriptor extends DocumentDescriptor
41 {
42
43     protected PropertySet propertySet;
44
45     /**
46      * <p>Returns this {@link PropertySetDescriptor}'s {@link
47      * PropertySet}.</p>
48      */

49     public PropertySet getPropertySet()
50     {
51         return propertySet;
52     }
53
54
55
56     /**
57      * <p>Creates a {@link PropertySetDescriptor} by reading a {@link
58      * PropertySet} from a {@link DocumentInputStream}.</p>
59      *
60      * @param name The stream's name.
61      *
62      * @param path The stream's path in the POI filesystem hierarchy.
63      *
64      * @param stream The stream.
65      *
66      * @param nrOfBytesToDump The maximum number of bytes to display in a
67      * dump starting at the beginning of the stream.
68      */

69     public PropertySetDescriptor(final String JavaDoc name,
70                                  final POIFSDocumentPath path,
71                                  final DocumentInputStream stream,
72                                  final int nrOfBytesToDump)
73         throws UnexpectedPropertySetTypeException, NoPropertySetStreamException,
74                MarkUnsupportedException, UnsupportedEncodingException JavaDoc,
75                IOException JavaDoc
76     {
77         super(name, path, stream, nrOfBytesToDump);
78         propertySet = PropertySetFactory.create(stream);
79     }
80
81 }
82
Popular Tags