1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
19 #ifndef __com_sun_star_embed_XHierarchicalStorageAccess_idl__
20 #define __com_sun_star_embed_XHierarchicalStorageAccess_idl__
22 #include
<com
/sun
/star
/uno
/XInterface.idl
>
23 #include
<com
/sun
/star
/io
/XStream.idl
>
24 #include
<com
/sun
/star
/embed
/XExtendedStorageStream.idl
>
25 #include
<com
/sun
/star
/io
/IOException.idl
>
26 #include
<com
/sun
/star
/lang
/IllegalArgumentException.idl
>
27 #include
<com
/sun
/star
/embed
/StorageWrappedTargetException.idl
>
28 #include
<com
/sun
/star
/embed
/InvalidStorageException.idl
>
29 #include
<com
/sun
/star
/packages
/WrongPasswordException.idl
>
30 #include
<com
/sun
/star
/container
/XNameAccess.idl
>
31 #include
<com
/sun
/star
/container
/NoSuchElementException.idl
>
32 #include
<com
/sun
/star
/container
/ElementExistException.idl
>
33 #include
<com
/sun
/star
/packages
/NoEncryptionException.idl
>
37 module com
{ module sun
{ module star
{ module embed
{
39 /** This interface allows hierarchical access to storage tree.
42 Currently only streams can be opened using this interface.
46 The hierarchical access can not be mixed with a normal access. Thus when
47 in a storage a stream with a path "a/b/c" is accessed using hierarchical
48 access, another stream "a/b/d" can also be opened with hierarchical
49 access ( if it is still not opened ), but the substorage "a" can not be
50 opened ( it is locked by hierarchical access ).
53 published
interface XHierarchicalStorageAccess
56 /** allows to get access to a child stream of the storage, using
60 In case the stream is open in readonly mode the
61 com::sun::star::io::XStream::getOutputStream()
62 method will return an empty reference.
66 the path to the substream that should be open
69 a mode the stream should be open in,
70 can be a combination of ElementModes values
72 @throws ::com::sun::star::embed::InvalidStorageException
73 this storage is in invalid state for any reason
75 @throws ::com::sun::star::lang::IllegalArgumentException
76 one of provided arguments is illegal
78 @throws ::com::sun::star::packages::WrongPasswordException
79 the provided password is wrong
81 @throws ::com::sun::star::io::IOException
82 in case of io errors during stream opening
84 @throws ::com::sun::star::embed::StorageWrappedTargetException
85 wraps other exceptions
87 XExtendedStorageStream openStreamElementByHierarchicalName
(
88 [in] string sStreamPath
,
90 raises
( ::com
::sun
::star
::embed
::InvalidStorageException
,
91 ::com
::sun
::star
::lang
::IllegalArgumentException
,
92 ::com
::sun
::star
::packages
::WrongPasswordException
,
93 ::com
::sun
::star
::io
::IOException
,
94 ::com
::sun
::star
::embed
::StorageWrappedTargetException
);
96 /** allows to get access to a child encrypted stream with password using
100 If storage does not allow any encryption this method will always throw
101 com::sun::star::packages::NoEncryptionException.
105 In case the stream is open in readonly mode the
106 com::sun::star::io::XStream::getOutputStream()
107 method will return an empty reference.
111 the path to the substream that should be open
114 a mode the stream should be open in,
115 can be a combination of ElementModes values
118 this parameter allows to specify a reading password for the
119 stream, the password must be a correct one, otherwise an
120 exception will be thrown
122 @throws ::com::sun::star::embed::InvalidStorageException
123 this storage is in invalid state for any reason
125 @throws ::com::sun::star::lang::IllegalArgumentException
126 one of provided arguments is illegal
128 @throws ::com::sun::star::packages::NoEncryptionException
129 the stream is not encrypted
131 @throws ::com::sun::star::packages::WrongPasswordException
132 the provided password is wrong
134 @throws ::com::sun::star::io::IOException
135 in case of io errors during stream opening
137 @throws ::com::sun::star::embed::StorageWrappedTargetException
138 wraps other exceptions
140 XExtendedStorageStream openEncryptedStreamElementByHierarchicalName
(
141 [in] string sStreamName
,
143 [in] string sPassword
)
144 raises
( ::com
::sun
::star
::embed
::InvalidStorageException
,
145 ::com
::sun
::star
::lang
::IllegalArgumentException
,
146 ::com
::sun
::star
::packages
::NoEncryptionException
,
147 ::com
::sun
::star
::packages
::WrongPasswordException
,
148 ::com
::sun
::star
::io
::IOException
,
149 ::com
::sun
::star
::embed
::StorageWrappedTargetException
);
151 /** removes a stream specified by hierarchical name from a storage.
154 the path to the element to remove
156 @throws ::com::sun::star::embed::InvalidStorageException
157 this storage is in invalid state for any reason
159 @throws ::com::sun::star::lang::IllegalArgumentException
160 an illegal argument is provided
162 @throws ::com::sun::star::container::NoSuchElementException
163 there is no element with such name
165 @throws ::com::sun::star::io::IOException
166 in case of io errors during removing
168 @throws ::com::sun::star::embed::StorageWrappedTargetException
169 wraps other exceptions
172 void removeStreamElementByHierarchicalName
( [in] string sElementPath
)
173 raises
( ::com
::sun
::star
::embed
::InvalidStorageException
,
174 ::com
::sun
::star
::lang
::IllegalArgumentException
,
175 ::com
::sun
::star
::container
::NoSuchElementException
,
176 ::com
::sun
::star
::io
::IOException
,
177 ::com
::sun
::star
::embed
::StorageWrappedTargetException
);
186 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */