]> err.no Git - sope/blob - sope-ldap/NGLdap/NGLdapFileManager.h
fixed copyrights for 2005
[sope] / sope-ldap / NGLdap / NGLdapFileManager.h
1 /*
2   Copyright (C) 2000-2005 SKYRIX Software AG
3
4   This file is part of SOPE.
5
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
9   later version.
10
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.
15
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
19   02111-1307, USA.
20 */
21
22 #ifndef __NGLdapFileManager_H__
23 #define __NGLdapFileManager_H__
24
25 #import <Foundation/NSObject.h>
26 #import <NGExtensions/NGFileManager.h>
27 #import <NGExtensions/NSFileManager+Extensions.h>
28
29 @class NSString, NSDictionary, NSData, NSArray, NSURL;
30 @class NGLdapConnection;
31
32 @interface NGLdapFileManager : NGFileManager
33 {
34   NGLdapConnection *connection;
35   NSString *rootDN;
36   NSString *currentDN;
37   NSString *currentPath;
38 }
39
40 - (id)initWithURLString:(NSString *)_url;
41 - (id)initWithURL:(id)_url;
42
43 - (id)initWithHostName:(NSString *)_host port:(int)_port
44   bindDN:(NSString *)_login credentials:(NSString *)_pwd
45   rootDN:(NSString *)_rootDN;
46
47 /* operations */
48
49 - (BOOL)changeCurrentDirectoryPath:(NSString *)_path;
50 - (NSString *)currentDirectoryPath;
51
52 - (NSArray *)directoryContentsAtPath:(NSString *)_path;
53 - (NSArray *)subpathsAtPath:(NSString *)_path;
54
55 - (NSDictionary *)fileAttributesAtPath:(NSString *)_path traverseLink:(BOOL)_fl;
56
57 /* determine access */
58
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;
65
66 /* reading contents */
67
68 - (BOOL)contentsEqualAtPath:(NSString *)_path1 andPath:(NSString *)_path2;
69 - (NSData *)contentsAtPath:(NSString *)_path;
70
71 /* modifications */
72
73 - (BOOL)removeFileAtPath:(NSString *)_path handler:(id)handler;
74
75 - (BOOL)copyPath:(NSString *)_source toPath:(NSString *)_destination
76   handler:(id)_handler;
77 - (BOOL)movePath:(NSString *)_source toPath:(NSString *)_destination 
78   handler:(id)_handler;
79 - (BOOL)linkPath:(NSString *)_source toPath:(NSString *)_destination 
80   handler:(id)_handler;
81
82 - (BOOL)createFileAtPath:(NSString *)path
83   contents:(NSData *)contents
84   attributes:(NSDictionary *)attributes;
85
86 /* internals */
87
88 - (NGLdapConnection *)ldapConnection;
89 - (NSString *)dnForPath:(NSString *)_path;
90 - (NSString *)pathForDN:(NSString *)_dn;
91
92 @end
93
94 @class EODataSource;
95
96 @interface NGLdapFileManager(ExtendedFileManager) < NGFileManagerDataSources >
97
98 /* feature check */
99
100 - (BOOL)supportsVersioningAtPath:(NSString *)_path;
101 - (BOOL)supportsLockingAtPath:(NSString *)_path;
102 - (BOOL)supportsFolderDataSourceAtPath:(NSString *)_path;
103
104 /* writing */
105
106 - (BOOL)writeContents:(NSData *)_content atPath:(NSString *)_path;
107
108 @end
109
110 #endif /* __NGLdapFileManager_H__ */