2 Copyright (C) 2000-2005 SKYRIX Software AG
4 This file is part of SOPE.
6 SOPE is free software; you can redistribute it and/or modify it under
7 the terms of the GNU Lesser General Public License as published by the
8 Free Software Foundation; either version 2, or (at your option) any
11 SOPE is distributed in the hope that it will be useful, but WITHOUT ANY
12 WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
14 License for more details.
16 You should have received a copy of the GNU Lesser General Public
17 License along with SOPE; see the file COPYING. If not, write to the
18 Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
22 #ifndef __NGLdapFileManager_H__
23 #define __NGLdapFileManager_H__
25 #import <Foundation/NSObject.h>
26 #import <NGExtensions/NGFileManager.h>
27 #import <NGExtensions/NSFileManager+Extensions.h>
29 @class NSString, NSDictionary, NSData, NSArray, NSURL;
30 @class NGLdapConnection;
32 @interface NGLdapFileManager : NGFileManager
34 NGLdapConnection *connection;
37 NSString *currentPath;
40 - (id)initWithURLString:(NSString *)_url;
41 - (id)initWithURL:(id)_url;
43 - (id)initWithHostName:(NSString *)_host port:(int)_port
44 bindDN:(NSString *)_login credentials:(NSString *)_pwd
45 rootDN:(NSString *)_rootDN;
49 - (BOOL)changeCurrentDirectoryPath:(NSString *)_path;
50 - (NSString *)currentDirectoryPath;
52 - (NSArray *)directoryContentsAtPath:(NSString *)_path;
53 - (NSArray *)subpathsAtPath:(NSString *)_path;
55 - (NSDictionary *)fileAttributesAtPath:(NSString *)_path traverseLink:(BOOL)_fl;
57 /* determine access */
59 - (BOOL)fileExistsAtPath:(NSString *)_path isDirectory:(BOOL *)_isDir;
60 - (BOOL)fileExistsAtPath:(NSString *)_path;
61 - (BOOL)isReadableFileAtPath:(NSString *)_path;
62 - (BOOL)isWritableFileAtPath:(NSString *)_path;
63 - (BOOL)isExecutableFileAtPath:(NSString *)_path;
64 - (BOOL)isDeletableFileAtPath:(NSString *)_path;
66 /* reading contents */
68 - (BOOL)contentsEqualAtPath:(NSString *)_path1 andPath:(NSString *)_path2;
69 - (NSData *)contentsAtPath:(NSString *)_path;
73 - (BOOL)removeFileAtPath:(NSString *)_path handler:(id)handler;
75 - (BOOL)copyPath:(NSString *)_source toPath:(NSString *)_destination
77 - (BOOL)movePath:(NSString *)_source toPath:(NSString *)_destination
79 - (BOOL)linkPath:(NSString *)_source toPath:(NSString *)_destination
82 - (BOOL)createFileAtPath:(NSString *)path
83 contents:(NSData *)contents
84 attributes:(NSDictionary *)attributes;
88 - (NGLdapConnection *)ldapConnection;
89 - (NSString *)dnForPath:(NSString *)_path;
90 - (NSString *)pathForDN:(NSString *)_dn;
96 @interface NGLdapFileManager(ExtendedFileManager) < NGFileManagerDataSources >
100 - (BOOL)supportsVersioningAtPath:(NSString *)_path;
101 - (BOOL)supportsLockingAtPath:(NSString *)_path;
102 - (BOOL)supportsFolderDataSourceAtPath:(NSString *)_path;
106 - (BOOL)writeContents:(NSData *)_content atPath:(NSString *)_path;
110 #endif /* __NGLdapFileManager_H__ */