Version 5.2.6.1, tag libreoffice-5.2.6.1
[LibreOffice.git] / offapi / com / sun / star / ucb / XSimpleFileAccess.idl
blob2ed62e0007e1798e06cca7db61c93b14802c0bcb
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
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_ucb_XSimpleFileAccess_idl__
20 #define __com_sun_star_ucb_XSimpleFileAccess_idl__
22 #include <com/sun/star/uno/XInterface.idl>
23 #include <com/sun/star/uno/RuntimeException.idl>
24 #include <com/sun/star/uno/Exception.idl>
25 #include <com/sun/star/ucb/CommandAbortedException.idl>
26 #include <com/sun/star/task/XInteractionHandler.idl>
27 #include <com/sun/star/util/DateTime.idl>
28 #include <com/sun/star/io/XOutputStream.idl>
29 #include <com/sun/star/io/XInputStream.idl>
30 #include <com/sun/star/io/XStream.idl>
35 module com { module sun { module star { module ucb {
37 /** This is the basic interface to read data from a stream.
39 published interface XSimpleFileAccess: com::sun::star::uno::XInterface
42 /** Copies a file
44 @param SourceURL
45 URL of the file to be copied
46 @param DestURL
47 URL of the location the file should be copied to
49 @see move
51 void copy( [in] string SourceURL, [in] string DestURL )
52 raises( com::sun::star::ucb::CommandAbortedException, com::sun::star::uno::Exception );
54 /** Moves a file
56 @param SourceURL
57 URL of the file to be moved
58 @param DestURL
59 URL of the location the file should be moved to
61 @see move
63 void move( [in] string SourceURL, [in] string DestURL )
64 raises( com::sun::star::ucb::CommandAbortedException, com::sun::star::uno::Exception );
66 /** Removes a file. If the URL represents a folder, the folder will be
67 removed, even if it's not empty.
69 @param FileURL
70 File/folder to be removed
72 @see move
74 void kill( [in] string FileURL )
75 raises( com::sun::star::ucb::CommandAbortedException, com::sun::star::uno::Exception );
77 /** Checks if an URL represents a folder
79 @param FileURL
80 URL to be checked
82 @return
83 true, if the given URL represents a folder, otherwise false
85 boolean isFolder( [in] string FileURL )
86 raises( com::sun::star::ucb::CommandAbortedException, com::sun::star::uno::Exception );
88 /** Checks if a file is "read only"
90 @param FileURL
91 URL to be checked
93 @return
94 true, if the given File is "read only", false otherwise
96 boolean isReadOnly( [in] string FileURL )
97 raises( com::sun::star::ucb::CommandAbortedException, com::sun::star::uno::Exception );
99 /** Sets the "read only" of a file according to the boolean parameter,
100 if the actual process has the right to do so.
102 @param FileURL
103 URL of the file
105 @param bReadOnly
106 true; "read only" flag will be set, false; "read only" flag will be reset
108 void setReadOnly( [in] string FileURL, [in] boolean bReadOnly )
109 raises( com::sun::star::ucb::CommandAbortedException, com::sun::star::uno::Exception );
111 /** Creates a new Folder
113 @param NewFolderURL
114 URL describing the location of the new folder
116 void createFolder( [in] string NewFolderURL )
117 raises( com::sun::star::ucb::CommandAbortedException, com::sun::star::uno::Exception );
119 /** Returns the size of a file.
121 @param FileURL
122 URL of the file
124 @return Size of the file in bytes
126 long getSize( [in] string FileURL )
127 raises( com::sun::star::ucb::CommandAbortedException, com::sun::star::uno::Exception );
129 /** Returns the content type of a file.
131 @see XContent::getContentType
133 @param FileURL
134 URL of the file
136 @return Content type of the file
138 string getContentType( [in] string FileURL )
139 raises( com::sun::star::ucb::CommandAbortedException, com::sun::star::uno::Exception );
141 /** Returns the last modified date for the file
143 @param FileURL
144 URL of the file
146 @return Last modified date for the file
148 ::com::sun::star::util::DateTime getDateTimeModified( [in] string FileURL )
149 raises( com::sun::star::ucb::CommandAbortedException, com::sun::star::uno::Exception );
151 /** Returns the contents of a folder
153 @param FolderURL
154 URL of the folder
155 @param bIncludeFolders
156 true: Subfolders are included, false: No subfolders
158 @return The content of a folder, each file as one string
159 in a string sequence
161 sequence<string> getFolderContents( [in] string FolderURL, [in] boolean bIncludeFolders )
162 raises( com::sun::star::ucb::CommandAbortedException, com::sun::star::uno::Exception );
164 /** Checks if a file exists
166 @param FileURL
167 URL to be checked
169 @return
170 true, if the File exists, false otherwise
172 boolean exists( [in] string FileURL )
173 raises( com::sun::star::ucb::CommandAbortedException, com::sun::star::uno::Exception );
176 /** Opens file to read
178 @param FileURL
179 File to open
181 @return
182 An XInputStream, if the file can be opened for reading
184 com::sun::star::io::XInputStream openFileRead( [in] string FileURL )
185 raises( com::sun::star::ucb::CommandAbortedException, com::sun::star::uno::Exception );
187 /** Opens file to write.
189 @param FileURL
190 File to open
192 @return
193 An XOutputStream, if the file can be opened for writing
195 @throws
196 UnsupportedDataSinkException, if the file cannot be
197 opened for random write access. Some resources do not allow random
198 write access. To write data for those resources
199 XSimpleFileAccess2::writeFile() may be used.
201 com::sun::star::io::XOutputStream openFileWrite( [in] string FileURL )
202 raises( com::sun::star::ucb::CommandAbortedException, com::sun::star::uno::Exception );
204 /** Opens file to read and write
206 @param FileURL
207 File to open
209 @return
210 An XStream, if the file can be opened for reading and writing
212 @throws
213 UnsupportedDataSinkException, if the file cannot be
214 opened for random write access. Some resources do not allow random
215 write access. To write data for those resources
216 XSimpleFileAccess2::writeFile() may be used.
218 com::sun::star::io::XStream openFileReadWrite( [in] string FileURL )
219 raises( com::sun::star::ucb::CommandAbortedException, com::sun::star::uno::Exception );
221 /** Sets an interaction handler to be used for further operations.
224 A default interaction handler is available as service
225 com::sun::star::task::InteractionHandler.
226 The documentation of this service also contains further
227 information about the interaction handler concept.
228 </p>
230 @see com::sun::star::task::InteractionHandler
232 @param Handler
233 The interaction handler to be set
235 void setInteractionHandler( [in] com::sun::star::task::XInteractionHandler Handler );
240 }; }; }; };
242 #endif
244 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */