1*cdf0e10cSrcweir/************************************************************************* 2*cdf0e10cSrcweir * 3*cdf0e10cSrcweir * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4*cdf0e10cSrcweir * 5*cdf0e10cSrcweir * Copyright 2000, 2010 Oracle and/or its affiliates. 6*cdf0e10cSrcweir * 7*cdf0e10cSrcweir * OpenOffice.org - a multi-platform office productivity suite 8*cdf0e10cSrcweir * 9*cdf0e10cSrcweir * This file is part of OpenOffice.org. 10*cdf0e10cSrcweir * 11*cdf0e10cSrcweir * OpenOffice.org is free software: you can redistribute it and/or modify 12*cdf0e10cSrcweir * it under the terms of the GNU Lesser General Public License version 3 13*cdf0e10cSrcweir * only, as published by the Free Software Foundation. 14*cdf0e10cSrcweir * 15*cdf0e10cSrcweir * OpenOffice.org is distributed in the hope that it will be useful, 16*cdf0e10cSrcweir * but WITHOUT ANY WARRANTY; without even the implied warranty of 17*cdf0e10cSrcweir * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18*cdf0e10cSrcweir * GNU Lesser General Public License version 3 for more details 19*cdf0e10cSrcweir * (a copy is included in the LICENSE file that accompanied this code). 20*cdf0e10cSrcweir * 21*cdf0e10cSrcweir * You should have received a copy of the GNU Lesser General Public License 22*cdf0e10cSrcweir * version 3 along with OpenOffice.org. If not, see 23*cdf0e10cSrcweir * <http://www.openoffice.org/license.html> 24*cdf0e10cSrcweir * for a copy of the LGPLv3 License. 25*cdf0e10cSrcweir * 26*cdf0e10cSrcweir ************************************************************************/ 27*cdf0e10cSrcweir#ifndef __com_sun_star_ucb_XSimpleFileAccess_idl__ 28*cdf0e10cSrcweir#define __com_sun_star_ucb_XSimpleFileAccess_idl__ 29*cdf0e10cSrcweir 30*cdf0e10cSrcweir#ifndef __com_sun_star_uno_XInterface_idl__ 31*cdf0e10cSrcweir#include <com/sun/star/uno/XInterface.idl> 32*cdf0e10cSrcweir#endif 33*cdf0e10cSrcweir 34*cdf0e10cSrcweir#ifndef __com_sun_star_uno_RuntimeException_idl__ 35*cdf0e10cSrcweir#include <com/sun/star/uno/RuntimeException.idl> 36*cdf0e10cSrcweir#endif 37*cdf0e10cSrcweir 38*cdf0e10cSrcweir#ifndef __com_sun_star_uno_Exception_idl__ 39*cdf0e10cSrcweir#include <com/sun/star/uno/Exception.idl> 40*cdf0e10cSrcweir#endif 41*cdf0e10cSrcweir 42*cdf0e10cSrcweir#ifndef __com_sun_star_ucb_CommandAbortedException_idl__ 43*cdf0e10cSrcweir#include <com/sun/star/ucb/CommandAbortedException.idl> 44*cdf0e10cSrcweir#endif 45*cdf0e10cSrcweir 46*cdf0e10cSrcweir#ifndef __com_sun_star_task_XInteractionHandler_idl__ 47*cdf0e10cSrcweir#include <com/sun/star/task/XInteractionHandler.idl> 48*cdf0e10cSrcweir#endif 49*cdf0e10cSrcweir 50*cdf0e10cSrcweir#ifndef __com_sun_star_util_DateTime_idl__ 51*cdf0e10cSrcweir#include <com/sun/star/util/DateTime.idl> 52*cdf0e10cSrcweir#endif 53*cdf0e10cSrcweir 54*cdf0e10cSrcweir#ifndef __com_sun_star_io_XOutputStream_idl__ 55*cdf0e10cSrcweir#include <com/sun/star/io/XOutputStream.idl> 56*cdf0e10cSrcweir#endif 57*cdf0e10cSrcweir 58*cdf0e10cSrcweir#ifndef __com_sun_star_io_XInputStream_idl__ 59*cdf0e10cSrcweir#include <com/sun/star/io/XInputStream.idl> 60*cdf0e10cSrcweir#endif 61*cdf0e10cSrcweir 62*cdf0e10cSrcweir#ifndef __com_sun_star_io_XStream_idl__ 63*cdf0e10cSrcweir#include <com/sun/star/io/XStream.idl> 64*cdf0e10cSrcweir#endif 65*cdf0e10cSrcweir 66*cdf0e10cSrcweir 67*cdf0e10cSrcweir 68*cdf0e10cSrcweir//============================================================================= 69*cdf0e10cSrcweir 70*cdf0e10cSrcweirmodule com { module sun { module star { module ucb { 71*cdf0e10cSrcweir 72*cdf0e10cSrcweir//============================================================================= 73*cdf0e10cSrcweir/** This is the basic interface to read data from a stream. 74*cdf0e10cSrcweir*/ 75*cdf0e10cSrcweirpublished interface XSimpleFileAccess: com::sun::star::uno::XInterface 76*cdf0e10cSrcweir{ 77*cdf0e10cSrcweir 78*cdf0e10cSrcweir //------------------------------------------------------------------------- 79*cdf0e10cSrcweir /** Copies a file 80*cdf0e10cSrcweir 81*cdf0e10cSrcweir @param SourceURL 82*cdf0e10cSrcweir URL of the file to be copied 83*cdf0e10cSrcweir @param DestURL 84*cdf0e10cSrcweir URL of the location the file should be copied to 85*cdf0e10cSrcweir 86*cdf0e10cSrcweir @see move 87*cdf0e10cSrcweir */ 88*cdf0e10cSrcweir void copy( [in] string SourceURL, [in] string DestURL ) 89*cdf0e10cSrcweir raises( com::sun::star::ucb::CommandAbortedException, com::sun::star::uno::Exception ); 90*cdf0e10cSrcweir 91*cdf0e10cSrcweir //------------------------------------------------------------------------- 92*cdf0e10cSrcweir /** Moves a file 93*cdf0e10cSrcweir 94*cdf0e10cSrcweir @param SourceURL 95*cdf0e10cSrcweir URL of the file to be moved 96*cdf0e10cSrcweir @param DestURL 97*cdf0e10cSrcweir URL of the location the file should be moved to 98*cdf0e10cSrcweir 99*cdf0e10cSrcweir @see move 100*cdf0e10cSrcweir */ 101*cdf0e10cSrcweir void move( [in] string SourceURL, [in] string DestURL ) 102*cdf0e10cSrcweir raises( com::sun::star::ucb::CommandAbortedException, com::sun::star::uno::Exception ); 103*cdf0e10cSrcweir 104*cdf0e10cSrcweir //------------------------------------------------------------------------- 105*cdf0e10cSrcweir /** Removes a file. If the URL represents a folder, the folder will be 106*cdf0e10cSrcweir removed, even if it's not empty. 107*cdf0e10cSrcweir 108*cdf0e10cSrcweir @param FileURL 109*cdf0e10cSrcweir File/folder to be removed 110*cdf0e10cSrcweir 111*cdf0e10cSrcweir @see move 112*cdf0e10cSrcweir */ 113*cdf0e10cSrcweir void kill( [in] string FileURL ) 114*cdf0e10cSrcweir raises( com::sun::star::ucb::CommandAbortedException, com::sun::star::uno::Exception ); 115*cdf0e10cSrcweir 116*cdf0e10cSrcweir //------------------------------------------------------------------------- 117*cdf0e10cSrcweir /** Checks if an URL represents a folder 118*cdf0e10cSrcweir 119*cdf0e10cSrcweir @param FileURL 120*cdf0e10cSrcweir URL to be checked 121*cdf0e10cSrcweir 122*cdf0e10cSrcweir @return 123*cdf0e10cSrcweir true, if the given URL represents a folder, otherwise false 124*cdf0e10cSrcweir */ 125*cdf0e10cSrcweir boolean isFolder( [in] string FileURL ) 126*cdf0e10cSrcweir raises( com::sun::star::ucb::CommandAbortedException, com::sun::star::uno::Exception ); 127*cdf0e10cSrcweir 128*cdf0e10cSrcweir //------------------------------------------------------------------------- 129*cdf0e10cSrcweir /** Checks if a file is "read only" 130*cdf0e10cSrcweir 131*cdf0e10cSrcweir @param FileURL 132*cdf0e10cSrcweir URL to be checked 133*cdf0e10cSrcweir 134*cdf0e10cSrcweir @return 135*cdf0e10cSrcweir true, if the given File is "read only", false otherwise 136*cdf0e10cSrcweir */ 137*cdf0e10cSrcweir boolean isReadOnly( [in] string FileURL ) 138*cdf0e10cSrcweir raises( com::sun::star::ucb::CommandAbortedException, com::sun::star::uno::Exception ); 139*cdf0e10cSrcweir 140*cdf0e10cSrcweir //------------------------------------------------------------------------- 141*cdf0e10cSrcweir /** Sets the "read only" of a file according to the boolean parameter, 142*cdf0e10cSrcweir if the actual process has the right to do so. 143*cdf0e10cSrcweir 144*cdf0e10cSrcweir @param bReadOnly 145*cdf0e10cSrcweir true; "read only" flag will be set, false; "read only" flag will be reset 146*cdf0e10cSrcweir */ 147*cdf0e10cSrcweir void setReadOnly( [in] string FileURL, [in] boolean bReadOnly ) 148*cdf0e10cSrcweir raises( com::sun::star::ucb::CommandAbortedException, com::sun::star::uno::Exception ); 149*cdf0e10cSrcweir 150*cdf0e10cSrcweir //------------------------------------------------------------------------- 151*cdf0e10cSrcweir /** Creates a new Folder 152*cdf0e10cSrcweir 153*cdf0e10cSrcweir @param NewFolderURL 154*cdf0e10cSrcweir URL describing the location of the new folder 155*cdf0e10cSrcweir */ 156*cdf0e10cSrcweir void createFolder( [in] string NewFolderURL ) 157*cdf0e10cSrcweir raises( com::sun::star::ucb::CommandAbortedException, com::sun::star::uno::Exception ); 158*cdf0e10cSrcweir 159*cdf0e10cSrcweir //------------------------------------------------------------------------- 160*cdf0e10cSrcweir /** Returns the size of a file. 161*cdf0e10cSrcweir 162*cdf0e10cSrcweir @param FileURL 163*cdf0e10cSrcweir URL of the file 164*cdf0e10cSrcweir 165*cdf0e10cSrcweir @return Size of the file in bytes 166*cdf0e10cSrcweir */ 167*cdf0e10cSrcweir long getSize( [in] string FileURL ) 168*cdf0e10cSrcweir raises( com::sun::star::ucb::CommandAbortedException, com::sun::star::uno::Exception ); 169*cdf0e10cSrcweir 170*cdf0e10cSrcweir //------------------------------------------------------------------------- 171*cdf0e10cSrcweir /** Returns the content type of a file. 172*cdf0e10cSrcweir 173*cdf0e10cSrcweir @see XContent::getContentType 174*cdf0e10cSrcweir 175*cdf0e10cSrcweir @param FileURL 176*cdf0e10cSrcweir URL of the file 177*cdf0e10cSrcweir 178*cdf0e10cSrcweir @return Content type of the file 179*cdf0e10cSrcweir */ 180*cdf0e10cSrcweir string getContentType( [in] string FileURL ) 181*cdf0e10cSrcweir raises( com::sun::star::ucb::CommandAbortedException, com::sun::star::uno::Exception ); 182*cdf0e10cSrcweir 183*cdf0e10cSrcweir //------------------------------------------------------------------------- 184*cdf0e10cSrcweir /** Returns the last modified date for the file 185*cdf0e10cSrcweir 186*cdf0e10cSrcweir @param FileURL 187*cdf0e10cSrcweir URL of the file 188*cdf0e10cSrcweir 189*cdf0e10cSrcweir @return Last modified date for the file 190*cdf0e10cSrcweir */ 191*cdf0e10cSrcweir ::com::sun::star::util::DateTime getDateTimeModified( [in] string FileURL ) 192*cdf0e10cSrcweir raises( com::sun::star::ucb::CommandAbortedException, com::sun::star::uno::Exception ); 193*cdf0e10cSrcweir 194*cdf0e10cSrcweir //------------------------------------------------------------------------- 195*cdf0e10cSrcweir /** Returns the contents of a folder 196*cdf0e10cSrcweir 197*cdf0e10cSrcweir @param FolderURL 198*cdf0e10cSrcweir URL of the folder 199*cdf0e10cSrcweir @param bIncludeFolders 200*cdf0e10cSrcweir true: Subfolders are included, false: No subfolders 201*cdf0e10cSrcweir 202*cdf0e10cSrcweir @return The content of a folder, each file as one string 203*cdf0e10cSrcweir in a string sequence 204*cdf0e10cSrcweir */ 205*cdf0e10cSrcweir sequence<string> getFolderContents( [in] string FolderURL, [in] boolean bIncludeFolders ) 206*cdf0e10cSrcweir raises( com::sun::star::ucb::CommandAbortedException, com::sun::star::uno::Exception ); 207*cdf0e10cSrcweir 208*cdf0e10cSrcweir //------------------------------------------------------------------------- 209*cdf0e10cSrcweir /** Checks if a file exists 210*cdf0e10cSrcweir 211*cdf0e10cSrcweir @param FileURL 212*cdf0e10cSrcweir URL to be checked 213*cdf0e10cSrcweir 214*cdf0e10cSrcweir @return 215*cdf0e10cSrcweir true, if the File exists, false otherwise 216*cdf0e10cSrcweir */ 217*cdf0e10cSrcweir boolean exists( [in] string FileURL ) 218*cdf0e10cSrcweir raises( com::sun::star::ucb::CommandAbortedException, com::sun::star::uno::Exception ); 219*cdf0e10cSrcweir 220*cdf0e10cSrcweir 221*cdf0e10cSrcweir //------------------------------------------------------------------------- 222*cdf0e10cSrcweir /** Opens file to read 223*cdf0e10cSrcweir 224*cdf0e10cSrcweir @param FileURL 225*cdf0e10cSrcweir File to open 226*cdf0e10cSrcweir 227*cdf0e10cSrcweir @return 228*cdf0e10cSrcweir An XInputStream, if the file can be opened for reading 229*cdf0e10cSrcweir */ 230*cdf0e10cSrcweir com::sun::star::io::XInputStream openFileRead( [in] string FileURL ) 231*cdf0e10cSrcweir raises( com::sun::star::ucb::CommandAbortedException, com::sun::star::uno::Exception ); 232*cdf0e10cSrcweir 233*cdf0e10cSrcweir //------------------------------------------------------------------------- 234*cdf0e10cSrcweir /** Opens file to write. 235*cdf0e10cSrcweir 236*cdf0e10cSrcweir @param FileURL 237*cdf0e10cSrcweir File to open 238*cdf0e10cSrcweir 239*cdf0e10cSrcweir @return 240*cdf0e10cSrcweir An XOutputStream, if the file can be opened for writing 241*cdf0e10cSrcweir 242*cdf0e10cSrcweir @throws 243*cdf0e10cSrcweir <type>UnsupportedDataSinkException</type>, if the file cannot be 244*cdf0e10cSrcweir opened for random write access. Some resources do not allow random 245*cdf0e10cSrcweir write access. To write data for those resources 246*cdf0e10cSrcweir <member>XSimpleFileAccess2::writeFile</member> may be used. 247*cdf0e10cSrcweir */ 248*cdf0e10cSrcweir com::sun::star::io::XOutputStream openFileWrite( [in] string FileURL ) 249*cdf0e10cSrcweir raises( com::sun::star::ucb::CommandAbortedException, com::sun::star::uno::Exception ); 250*cdf0e10cSrcweir 251*cdf0e10cSrcweir //------------------------------------------------------------------------- 252*cdf0e10cSrcweir /** Opens file to read and write 253*cdf0e10cSrcweir 254*cdf0e10cSrcweir @param FileURL 255*cdf0e10cSrcweir File to open 256*cdf0e10cSrcweir 257*cdf0e10cSrcweir @return 258*cdf0e10cSrcweir An XStream, if the file can be opened for reading and writing 259*cdf0e10cSrcweir 260*cdf0e10cSrcweir @throws 261*cdf0e10cSrcweir <type>UnsupportedDataSinkException</type>, if the file cannot be 262*cdf0e10cSrcweir opened for random write access. Some resources do not allow random 263*cdf0e10cSrcweir write access. To write data for those resources 264*cdf0e10cSrcweir <member>XSimpleFileAccess2::writeFile</member> may be used. 265*cdf0e10cSrcweir */ 266*cdf0e10cSrcweir com::sun::star::io::XStream openFileReadWrite( [in] string FileURL ) 267*cdf0e10cSrcweir raises( com::sun::star::ucb::CommandAbortedException, com::sun::star::uno::Exception ); 268*cdf0e10cSrcweir 269*cdf0e10cSrcweir //------------------------------------------------------------------------- 270*cdf0e10cSrcweir /** Sets an interaction handler to be used for further operations. 271*cdf0e10cSrcweir 272*cdf0e10cSrcweir <p> 273*cdf0e10cSrcweir A default interaction handler is available as service 274*cdf0e10cSrcweir <type scope="com::sun::star::task">InteractionHandler</type>. 275*cdf0e10cSrcweir The documentation of this service also contains further 276*cdf0e10cSrcweir information about the interaction handler concept. 277*cdf0e10cSrcweir </p> 278*cdf0e10cSrcweir 279*cdf0e10cSrcweir @see com::sun::star::task::InteractionHandler 280*cdf0e10cSrcweir 281*cdf0e10cSrcweir @param Handler 282*cdf0e10cSrcweir The interaction handler to be set 283*cdf0e10cSrcweir */ 284*cdf0e10cSrcweir void setInteractionHandler( [in] com::sun::star::task::XInteractionHandler Handler ); 285*cdf0e10cSrcweir 286*cdf0e10cSrcweir}; 287*cdf0e10cSrcweir 288*cdf0e10cSrcweir//============================================================================= 289*cdf0e10cSrcweir 290*cdf0e10cSrcweir}; }; }; }; 291*cdf0e10cSrcweir 292*cdf0e10cSrcweir#endif 293