1 package fr.in2p3.jsaga.impl.namespace;
2
3 import fr.in2p3.jsaga.adaptor.data.DataAdaptor;
4 import fr.in2p3.jsaga.impl.file.AbstractSyncDirectoryImpl;
5 import fr.in2p3.jsaga.impl.file.copy.AbstractCopyTask;
6 import fr.in2p3.jsaga.impl.task.AbstractThreadedTask;
7 import org.ogf.saga.error.*;
8 import org.ogf.saga.namespace.Flags;
9 import org.ogf.saga.namespace.NSDirectory;
10 import org.ogf.saga.namespace.NSEntry;
11 import org.ogf.saga.session.Session;
12 import org.ogf.saga.task.Task;
13 import org.ogf.saga.task.TaskMode;
14 import org.ogf.saga.url.URL;
15
16 import java.util.List;
17
18
19
20
21
22
23
24
25
26
27
28
29
30 public abstract class AbstractAsyncNSDirectoryImpl extends AbstractSyncNSDirectoryImpl implements NSDirectory {
31
32 protected AbstractAsyncNSDirectoryImpl(Session session, URL url, DataAdaptor adaptor, int flags) throws NotImplementedException, IncorrectURLException, AuthenticationFailedException, AuthorizationFailedException, PermissionDeniedException, BadParameterException, AlreadyExistsException, DoesNotExistException, TimeoutException, NoSuccessException {
33 super(session, url, adaptor, flags);
34 }
35
36
37 protected AbstractAsyncNSDirectoryImpl(AbstractNSDirectoryImpl dir, URL relativeUrl, int flags) throws NotImplementedException, IncorrectURLException, AuthenticationFailedException, AuthorizationFailedException, PermissionDeniedException, BadParameterException, AlreadyExistsException, DoesNotExistException, TimeoutException, NoSuccessException {
38 super(dir, relativeUrl, flags);
39 }
40
41
42 protected AbstractAsyncNSDirectoryImpl(AbstractNSEntryImpl entry, String absolutePath, int flags) throws NotImplementedException, IncorrectURLException, AuthenticationFailedException, AuthorizationFailedException, PermissionDeniedException, BadParameterException, AlreadyExistsException, DoesNotExistException, TimeoutException, NoSuccessException {
43 super(entry, absolutePath, flags);
44 }
45
46
47
48 public Task<NSDirectory, Void> changeDir(TaskMode mode, final URL dir) throws NotImplementedException {
49 return new AbstractThreadedTask<NSDirectory,Void>(mode) {
50 public Void invoke() throws NotImplementedException, IncorrectURLException, AuthenticationFailedException, AuthorizationFailedException, PermissionDeniedException, BadParameterException, IncorrectStateException, AlreadyExistsException, DoesNotExistException, TimeoutException, NoSuccessException {
51 AbstractAsyncNSDirectoryImpl.super.changeDirSync(dir);
52 return null;
53 }
54 };
55 }
56
57 public Task<NSDirectory, List<URL>> list(TaskMode mode, final String pattern, final int flags) throws NotImplementedException {
58 return new AbstractThreadedTask<NSDirectory,List<URL>>(mode) {
59 public List<URL> invoke() throws NotImplementedException, IncorrectURLException, AuthenticationFailedException, AuthorizationFailedException, PermissionDeniedException, BadParameterException, IncorrectStateException, AlreadyExistsException, DoesNotExistException, TimeoutException, NoSuccessException {
60 return AbstractAsyncNSDirectoryImpl.super.listSync(pattern, flags);
61 }
62 };
63 }
64 public Task<NSDirectory, List<URL>> list(TaskMode mode, final String pattern) throws NotImplementedException {
65 return new AbstractThreadedTask<NSDirectory,List<URL>>(mode) {
66 public List<URL> invoke() throws NotImplementedException, IncorrectURLException, AuthenticationFailedException, AuthorizationFailedException, PermissionDeniedException, BadParameterException, IncorrectStateException, AlreadyExistsException, DoesNotExistException, TimeoutException, NoSuccessException {
67 return AbstractAsyncNSDirectoryImpl.super.listSync(pattern);
68 }
69 };
70 }
71
72 public Task<NSDirectory, List<URL>> list(TaskMode mode, final int flags) throws NotImplementedException {
73 return new AbstractThreadedTask<NSDirectory,List<URL>>(mode) {
74 public List<URL> invoke() throws NotImplementedException, IncorrectURLException, AuthenticationFailedException, AuthorizationFailedException, PermissionDeniedException, BadParameterException, IncorrectStateException, AlreadyExistsException, DoesNotExistException, TimeoutException, NoSuccessException {
75 return AbstractAsyncNSDirectoryImpl.super.listSync(flags);
76 }
77 };
78 }
79 public Task<NSDirectory, List<URL>> list(TaskMode mode) throws NotImplementedException {
80 return new AbstractThreadedTask<NSDirectory,List<URL>>(mode) {
81 public List<URL> invoke() throws NotImplementedException, IncorrectURLException, AuthenticationFailedException, AuthorizationFailedException, PermissionDeniedException, BadParameterException, IncorrectStateException, AlreadyExistsException, DoesNotExistException, TimeoutException, NoSuccessException {
82 return AbstractAsyncNSDirectoryImpl.super.listSync();
83 }
84 };
85 }
86
87 public Task<NSDirectory, List<URL>> find(TaskMode mode, final String pattern, final int flags) throws NotImplementedException {
88 return new AbstractThreadedTask<NSDirectory,List<URL>>(mode) {
89 public List<URL> invoke() throws NotImplementedException, IncorrectURLException, AuthenticationFailedException, AuthorizationFailedException, PermissionDeniedException, BadParameterException, IncorrectStateException, AlreadyExistsException, DoesNotExistException, TimeoutException, NoSuccessException {
90 return AbstractAsyncNSDirectoryImpl.super.findSync(pattern, flags);
91 }
92 };
93 }
94 public Task<NSDirectory, List<URL>> find(TaskMode mode, final String pattern) throws NotImplementedException {
95 return new AbstractThreadedTask<NSDirectory,List<URL>>(mode) {
96 public List<URL> invoke() throws NotImplementedException, IncorrectURLException, AuthenticationFailedException, AuthorizationFailedException, PermissionDeniedException, BadParameterException, IncorrectStateException, AlreadyExistsException, DoesNotExistException, TimeoutException, NoSuccessException {
97 return AbstractAsyncNSDirectoryImpl.super.findSync(pattern);
98 }
99 };
100 }
101
102 public Task<NSDirectory, Boolean> exists(TaskMode mode, final URL name) throws NotImplementedException {
103 return new AbstractThreadedTask<NSDirectory,Boolean>(mode) {
104 public Boolean invoke() throws NotImplementedException, IncorrectURLException, AuthenticationFailedException, AuthorizationFailedException, PermissionDeniedException, BadParameterException, IncorrectStateException, AlreadyExistsException, DoesNotExistException, TimeoutException, NoSuccessException {
105 return AbstractAsyncNSDirectoryImpl.super.existsSync(name);
106 }
107 };
108 }
109
110 public Task<NSDirectory, Boolean> isDir(TaskMode mode, final URL name) throws NotImplementedException {
111 return new AbstractThreadedTask<NSDirectory,Boolean>(mode) {
112 public Boolean invoke() throws NotImplementedException, IncorrectURLException, AuthenticationFailedException, AuthorizationFailedException, PermissionDeniedException, BadParameterException, IncorrectStateException, AlreadyExistsException, DoesNotExistException, TimeoutException, NoSuccessException {
113 return AbstractAsyncNSDirectoryImpl.super.isDirSync(name);
114 }
115 };
116 }
117
118 public Task<NSDirectory, Boolean> isEntry(TaskMode mode, final URL name) throws NotImplementedException {
119 return new AbstractThreadedTask<NSDirectory,Boolean>(mode) {
120 public Boolean invoke() throws NotImplementedException, IncorrectURLException, AuthenticationFailedException, AuthorizationFailedException, PermissionDeniedException, BadParameterException, IncorrectStateException, AlreadyExistsException, DoesNotExistException, TimeoutException, NoSuccessException {
121 return AbstractAsyncNSDirectoryImpl.super.isEntrySync(name);
122 }
123 };
124 }
125
126 public Task<NSDirectory, Boolean> isLink(TaskMode mode, final URL name) throws NotImplementedException {
127 return new AbstractThreadedTask<NSDirectory,Boolean>(mode) {
128 public Boolean invoke() throws NotImplementedException, IncorrectURLException, AuthenticationFailedException, AuthorizationFailedException, PermissionDeniedException, BadParameterException, IncorrectStateException, AlreadyExistsException, DoesNotExistException, TimeoutException, NoSuccessException {
129 return AbstractAsyncNSDirectoryImpl.super.isLinkSync(name);
130 }
131 };
132 }
133
134 public Task<NSDirectory, Long> getMTime(TaskMode mode, final URL name) throws NotImplementedException {
135 return new AbstractThreadedTask<NSDirectory,Long>(mode) {
136 public Long invoke() throws NotImplementedException, IncorrectURLException, AuthenticationFailedException, AuthorizationFailedException, PermissionDeniedException, BadParameterException, IncorrectStateException, AlreadyExistsException, DoesNotExistException, TimeoutException, NoSuccessException {
137 return AbstractAsyncNSDirectoryImpl.super.getMTimeSync(name);
138 }
139 };
140 }
141
142 public Task<NSDirectory, URL> readLink(TaskMode mode, final URL name) throws NotImplementedException {
143 return new AbstractThreadedTask<NSDirectory,URL>(mode) {
144 public URL invoke() throws NotImplementedException, IncorrectURLException, AuthenticationFailedException, AuthorizationFailedException, PermissionDeniedException, BadParameterException, IncorrectStateException, AlreadyExistsException, DoesNotExistException, TimeoutException, NoSuccessException {
145 return AbstractAsyncNSDirectoryImpl.super.readLinkSync(name);
146 }
147 };
148 }
149
150 public Task<NSDirectory, Integer> getNumEntries(TaskMode mode) throws NotImplementedException {
151 return new AbstractThreadedTask<NSDirectory,Integer>(mode) {
152 public Integer invoke() throws NotImplementedException, IncorrectURLException, AuthenticationFailedException, AuthorizationFailedException, PermissionDeniedException, BadParameterException, IncorrectStateException, AlreadyExistsException, DoesNotExistException, TimeoutException, NoSuccessException {
153 return AbstractAsyncNSDirectoryImpl.super.getNumEntriesSync();
154 }
155 };
156 }
157
158 public Task<NSDirectory, URL> getEntry(TaskMode mode, final int entry) throws NotImplementedException {
159 return new AbstractThreadedTask<NSDirectory,URL>(mode) {
160 public URL invoke() throws NotImplementedException, IncorrectURLException, AuthenticationFailedException, AuthorizationFailedException, PermissionDeniedException, BadParameterException, IncorrectStateException, AlreadyExistsException, DoesNotExistException, TimeoutException, NoSuccessException {
161 return AbstractAsyncNSDirectoryImpl.super.getEntrySync(entry);
162 }
163 };
164 }
165
166 public Task<NSDirectory, Void> copy(TaskMode mode, final URL source, final URL target, final int flags) throws NotImplementedException {
167 return new AbstractThreadedTask<NSDirectory,Void>(mode) {
168 public Void invoke() throws NotImplementedException, IncorrectURLException, AuthenticationFailedException, AuthorizationFailedException, PermissionDeniedException, BadParameterException, IncorrectStateException, AlreadyExistsException, DoesNotExistException, TimeoutException, NoSuccessException {
169 AbstractAsyncNSDirectoryImpl.super.copySync(source, target, flags);
170 return null;
171 }
172 };
173 }
174 public Task<NSDirectory, Void> copy(TaskMode mode, final URL source, final URL target) throws NotImplementedException {
175 return new AbstractThreadedTask<NSDirectory,Void>(mode) {
176 public Void invoke() throws NotImplementedException, IncorrectURLException, AuthenticationFailedException, AuthorizationFailedException, PermissionDeniedException, BadParameterException, IncorrectStateException, AlreadyExistsException, DoesNotExistException, TimeoutException, NoSuccessException {
177 AbstractAsyncNSDirectoryImpl.super.copySync(source, target);
178 return null;
179 }
180 };
181 }
182
183 public Task<NSDirectory, Void> copy(TaskMode mode, final String sourcePattern, final URL target, final int flags) throws NotImplementedException {
184 return new AbstractThreadedTask<NSDirectory,Void>(mode) {
185 public Void invoke() throws NotImplementedException, IncorrectURLException, AuthenticationFailedException, AuthorizationFailedException, PermissionDeniedException, BadParameterException, IncorrectStateException, AlreadyExistsException, DoesNotExistException, TimeoutException, NoSuccessException {
186 AbstractAsyncNSDirectoryImpl.super.copySync(sourcePattern, target, flags);
187 return null;
188 }
189 };
190 }
191 public Task<NSDirectory, Void> copy(TaskMode mode, final String sourcePattern, final URL target) throws NotImplementedException {
192 return new AbstractThreadedTask<NSDirectory,Void>(mode) {
193 public Void invoke() throws NotImplementedException, IncorrectURLException, AuthenticationFailedException, AuthorizationFailedException, PermissionDeniedException, BadParameterException, IncorrectStateException, AlreadyExistsException, DoesNotExistException, TimeoutException, NoSuccessException {
194 AbstractAsyncNSDirectoryImpl.super.copySync(sourcePattern, target);
195 return null;
196 }
197 };
198 }
199
200 public Task<NSDirectory, Void> link(TaskMode mode, final URL source, final URL target, final int flags) throws NotImplementedException {
201 return new AbstractThreadedTask<NSDirectory,Void>(mode) {
202 public Void invoke() throws NotImplementedException, IncorrectURLException, AuthenticationFailedException, AuthorizationFailedException, PermissionDeniedException, BadParameterException, IncorrectStateException, AlreadyExistsException, DoesNotExistException, TimeoutException, NoSuccessException {
203 AbstractAsyncNSDirectoryImpl.super.linkSync(source, target, flags);
204 return null;
205 }
206 };
207 }
208 public Task<NSDirectory, Void> link(TaskMode mode, final URL source, final URL target) throws NotImplementedException {
209 return new AbstractThreadedTask<NSDirectory,Void>(mode) {
210 public Void invoke() throws NotImplementedException, IncorrectURLException, AuthenticationFailedException, AuthorizationFailedException, PermissionDeniedException, BadParameterException, IncorrectStateException, AlreadyExistsException, DoesNotExistException, TimeoutException, NoSuccessException {
211 AbstractAsyncNSDirectoryImpl.super.linkSync(source, target);
212 return null;
213 }
214 };
215 }
216
217 public Task<NSDirectory, Void> link(TaskMode mode, final String sourcePattern, final URL target, final int flags) throws NotImplementedException {
218 return new AbstractThreadedTask<NSDirectory,Void>(mode) {
219 public Void invoke() throws NotImplementedException, IncorrectURLException, AuthenticationFailedException, AuthorizationFailedException, PermissionDeniedException, BadParameterException, IncorrectStateException, AlreadyExistsException, DoesNotExistException, TimeoutException, NoSuccessException {
220 AbstractAsyncNSDirectoryImpl.super.linkSync(sourcePattern, target, flags);
221 return null;
222 }
223 };
224 }
225 public Task<NSDirectory, Void> link(TaskMode mode, final String sourcePattern, final URL target) throws NotImplementedException {
226 return new AbstractThreadedTask<NSDirectory,Void>(mode) {
227 public Void invoke() throws NotImplementedException, IncorrectURLException, AuthenticationFailedException, AuthorizationFailedException, PermissionDeniedException, BadParameterException, IncorrectStateException, AlreadyExistsException, DoesNotExistException, TimeoutException, NoSuccessException {
228 AbstractAsyncNSDirectoryImpl.super.linkSync(sourcePattern, target);
229 return null;
230 }
231 };
232 }
233
234 public Task<NSDirectory, Void> move(TaskMode mode, final URL source, final URL target, final int flags) throws NotImplementedException {
235 return new AbstractThreadedTask<NSDirectory,Void>(mode) {
236 public Void invoke() throws NotImplementedException, IncorrectURLException, AuthenticationFailedException, AuthorizationFailedException, PermissionDeniedException, BadParameterException, IncorrectStateException, AlreadyExistsException, DoesNotExistException, TimeoutException, NoSuccessException {
237 AbstractAsyncNSDirectoryImpl.super.moveSync(source, target, flags);
238 return null;
239 }
240 };
241 }
242 public Task<NSDirectory, Void> move(TaskMode mode, final URL source, final URL target) throws NotImplementedException {
243 return new AbstractThreadedTask<NSDirectory,Void>(mode) {
244 public Void invoke() throws NotImplementedException, IncorrectURLException, AuthenticationFailedException, AuthorizationFailedException, PermissionDeniedException, BadParameterException, IncorrectStateException, AlreadyExistsException, DoesNotExistException, TimeoutException, NoSuccessException {
245 AbstractAsyncNSDirectoryImpl.super.moveSync(source, target);
246 return null;
247 }
248 };
249 }
250
251 public Task<NSDirectory, Void> move(TaskMode mode, final String sourcePattern, final URL target, final int flags) throws NotImplementedException {
252 return new AbstractThreadedTask<NSDirectory,Void>(mode) {
253 public Void invoke() throws NotImplementedException, IncorrectURLException, AuthenticationFailedException, AuthorizationFailedException, PermissionDeniedException, BadParameterException, IncorrectStateException, AlreadyExistsException, DoesNotExistException, TimeoutException, NoSuccessException {
254 AbstractAsyncNSDirectoryImpl.super.moveSync(sourcePattern, target, flags);
255 return null;
256 }
257 };
258 }
259 public Task<NSDirectory, Void> move(TaskMode mode, final String sourcePattern, final URL target) throws NotImplementedException {
260 return new AbstractThreadedTask<NSDirectory,Void>(mode) {
261 public Void invoke() throws NotImplementedException, IncorrectURLException, AuthenticationFailedException, AuthorizationFailedException, PermissionDeniedException, BadParameterException, IncorrectStateException, AlreadyExistsException, DoesNotExistException, TimeoutException, NoSuccessException {
262 AbstractAsyncNSDirectoryImpl.super.moveSync(sourcePattern, target);
263 return null;
264 }
265 };
266 }
267
268 public Task<NSDirectory, Void> remove(TaskMode mode, final URL target, final int flags) throws NotImplementedException {
269 return new AbstractThreadedTask<NSDirectory,Void>(mode) {
270 public Void invoke() throws NotImplementedException, IncorrectURLException, AuthenticationFailedException, AuthorizationFailedException, PermissionDeniedException, BadParameterException, IncorrectStateException, AlreadyExistsException, DoesNotExistException, TimeoutException, NoSuccessException {
271 AbstractAsyncNSDirectoryImpl.super.removeSync(target, flags);
272 return null;
273 }
274 };
275 }
276 public Task<NSDirectory, Void> remove(TaskMode mode, final URL target) throws NotImplementedException {
277 return new AbstractThreadedTask<NSDirectory,Void>(mode) {
278 public Void invoke() throws NotImplementedException, IncorrectURLException, AuthenticationFailedException, AuthorizationFailedException, PermissionDeniedException, BadParameterException, IncorrectStateException, AlreadyExistsException, DoesNotExistException, TimeoutException, NoSuccessException {
279 AbstractAsyncNSDirectoryImpl.super.removeSync(target);
280 return null;
281 }
282 };
283 }
284
285 public Task<NSDirectory, Void> remove(TaskMode mode, final String targetPattern, final int flags) throws NotImplementedException {
286 return new AbstractThreadedTask<NSDirectory,Void>(mode) {
287 public Void invoke() throws NotImplementedException, IncorrectURLException, AuthenticationFailedException, AuthorizationFailedException, PermissionDeniedException, BadParameterException, IncorrectStateException, AlreadyExistsException, DoesNotExistException, TimeoutException, NoSuccessException {
288 AbstractAsyncNSDirectoryImpl.super.removeSync(targetPattern, flags);
289 return null;
290 }
291 };
292 }
293 public Task<NSDirectory, Void> remove(TaskMode mode, final String targetPattern) throws NotImplementedException {
294 return new AbstractThreadedTask<NSDirectory,Void>(mode) {
295 public Void invoke() throws NotImplementedException, IncorrectURLException, AuthenticationFailedException, AuthorizationFailedException, PermissionDeniedException, BadParameterException, IncorrectStateException, AlreadyExistsException, DoesNotExistException, TimeoutException, NoSuccessException {
296 AbstractAsyncNSDirectoryImpl.super.removeSync(targetPattern);
297 return null;
298 }
299 };
300 }
301
302 public Task<NSDirectory, Void> makeDir(TaskMode mode, final URL target, final int flags) throws NotImplementedException {
303 return new AbstractThreadedTask<NSDirectory,Void>(mode) {
304 public Void invoke() throws NotImplementedException, IncorrectURLException, AuthenticationFailedException, AuthorizationFailedException, PermissionDeniedException, BadParameterException, IncorrectStateException, AlreadyExistsException, DoesNotExistException, TimeoutException, NoSuccessException {
305 AbstractAsyncNSDirectoryImpl.super.makeDirSync(target, flags);
306 return null;
307 }
308 };
309 }
310 public Task<NSDirectory, Void> makeDir(TaskMode mode, final URL target) throws NotImplementedException {
311 return new AbstractThreadedTask<NSDirectory,Void>(mode) {
312 public Void invoke() throws NotImplementedException, IncorrectURLException, AuthenticationFailedException, AuthorizationFailedException, PermissionDeniedException, BadParameterException, IncorrectStateException, AlreadyExistsException, DoesNotExistException, TimeoutException, NoSuccessException {
313 AbstractAsyncNSDirectoryImpl.super.makeDirSync(target);
314 return null;
315 }
316 };
317 }
318
319 public Task<NSDirectory, NSDirectory> openDir(TaskMode mode, final URL name, final int flags) throws NotImplementedException {
320 return new AbstractThreadedTask<NSDirectory,NSDirectory>(mode) {
321 public NSDirectory invoke() throws NotImplementedException, IncorrectURLException, AuthenticationFailedException, AuthorizationFailedException, PermissionDeniedException, BadParameterException, IncorrectStateException, AlreadyExistsException, DoesNotExistException, TimeoutException, NoSuccessException {
322 return AbstractAsyncNSDirectoryImpl.this.openDir(name, flags);
323 }
324 };
325 }
326 public Task<NSDirectory, NSDirectory> openDir(TaskMode mode, final URL name) throws NotImplementedException {
327 return new AbstractThreadedTask<NSDirectory,NSDirectory>(mode) {
328 public NSDirectory invoke() throws NotImplementedException, IncorrectURLException, AuthenticationFailedException, AuthorizationFailedException, PermissionDeniedException, BadParameterException, IncorrectStateException, AlreadyExistsException, DoesNotExistException, TimeoutException, NoSuccessException {
329 return AbstractAsyncNSDirectoryImpl.this.openDir(name);
330 }
331 };
332 }
333
334 public Task<NSDirectory, NSEntry> open(TaskMode mode, final URL name, final int flags) throws NotImplementedException {
335 return new AbstractThreadedTask<NSDirectory,NSEntry>(mode) {
336 public NSEntry invoke() throws NotImplementedException, IncorrectURLException, AuthenticationFailedException, AuthorizationFailedException, PermissionDeniedException, BadParameterException, IncorrectStateException, AlreadyExistsException, DoesNotExistException, TimeoutException, NoSuccessException {
337 return AbstractAsyncNSDirectoryImpl.this.open(name, flags);
338 }
339 };
340 }
341 public Task<NSDirectory, NSEntry> open(TaskMode mode, final URL name) throws NotImplementedException {
342 return new AbstractThreadedTask<NSDirectory,NSEntry>(mode) {
343 public NSEntry invoke() throws NotImplementedException, IncorrectURLException, AuthenticationFailedException, AuthorizationFailedException, PermissionDeniedException, BadParameterException, IncorrectStateException, AlreadyExistsException, DoesNotExistException, TimeoutException, NoSuccessException {
344 return AbstractAsyncNSDirectoryImpl.this.open(name);
345 }
346 };
347 }
348
349 public Task<NSDirectory, Void> permissionsAllow(TaskMode mode, final URL target, final String id, final int permissions, final int flags) throws NotImplementedException {
350 return new AbstractThreadedTask<NSDirectory,Void>(mode) {
351 public Void invoke() throws NotImplementedException, IncorrectURLException, AuthenticationFailedException, AuthorizationFailedException, PermissionDeniedException, BadParameterException, IncorrectStateException, AlreadyExistsException, DoesNotExistException, TimeoutException, NoSuccessException {
352 AbstractAsyncNSDirectoryImpl.super.permissionsAllowSync(target, id, permissions, flags);
353 return null;
354 }
355 };
356 }
357 public Task<NSDirectory, Void> permissionsAllow(TaskMode mode, final URL target, final String id, final int permissions) throws NotImplementedException {
358 return new AbstractThreadedTask<NSDirectory,Void>(mode) {
359 public Void invoke() throws NotImplementedException, IncorrectURLException, AuthenticationFailedException, AuthorizationFailedException, PermissionDeniedException, BadParameterException, IncorrectStateException, AlreadyExistsException, DoesNotExistException, TimeoutException, NoSuccessException {
360 AbstractAsyncNSDirectoryImpl.super.permissionsAllowSync(target, id, permissions);
361 return null;
362 }
363 };
364 }
365
366 public Task<NSDirectory, Void> permissionsAllow(TaskMode mode, final String targetPattern, final String id, final int permissions, final int flags) throws NotImplementedException {
367 return new AbstractThreadedTask<NSDirectory,Void>(mode) {
368 public Void invoke() throws NotImplementedException, IncorrectURLException, AuthenticationFailedException, AuthorizationFailedException, PermissionDeniedException, BadParameterException, IncorrectStateException, AlreadyExistsException, DoesNotExistException, TimeoutException, NoSuccessException {
369 AbstractAsyncNSDirectoryImpl.super.permissionsAllowSync(targetPattern, id, permissions, flags);
370 return null;
371 }
372 };
373 }
374 public Task<NSDirectory, Void> permissionsAllow(TaskMode mode, final String targetPattern, final String id, final int permissions) throws NotImplementedException {
375 return new AbstractThreadedTask<NSDirectory,Void>(mode) {
376 public Void invoke() throws NotImplementedException, IncorrectURLException, AuthenticationFailedException, AuthorizationFailedException, PermissionDeniedException, BadParameterException, IncorrectStateException, AlreadyExistsException, DoesNotExistException, TimeoutException, NoSuccessException {
377 AbstractAsyncNSDirectoryImpl.super.permissionsAllowSync(targetPattern, id, permissions);
378 return null;
379 }
380 };
381 }
382
383 public Task<NSDirectory, Void> permissionsDeny(TaskMode mode, final URL target, final String id, final int permissions, final int flags) throws NotImplementedException {
384 return new AbstractThreadedTask<NSDirectory,Void>(mode) {
385 public Void invoke() throws NotImplementedException, IncorrectURLException, AuthenticationFailedException, AuthorizationFailedException, PermissionDeniedException, BadParameterException, IncorrectStateException, AlreadyExistsException, DoesNotExistException, TimeoutException, NoSuccessException {
386 AbstractAsyncNSDirectoryImpl.super.permissionsDenySync(target, id, permissions, flags);
387 return null;
388 }
389 };
390 }
391 public Task<NSDirectory, Void> permissionsDeny(TaskMode mode, final URL target, final String id, final int permissions) throws NotImplementedException {
392 return new AbstractThreadedTask<NSDirectory,Void>(mode) {
393 public Void invoke() throws NotImplementedException, IncorrectURLException, AuthenticationFailedException, AuthorizationFailedException, PermissionDeniedException, BadParameterException, IncorrectStateException, AlreadyExistsException, DoesNotExistException, TimeoutException, NoSuccessException {
394 AbstractAsyncNSDirectoryImpl.super.permissionsDenySync(target, id, permissions);
395 return null;
396 }
397 };
398 }
399
400 public Task<NSDirectory, Void> permissionsDeny(TaskMode mode, final String targetPattern, final String id, final int permissions, final int flags) throws NotImplementedException {
401 return new AbstractThreadedTask<NSDirectory,Void>(mode) {
402 public Void invoke() throws NotImplementedException, IncorrectURLException, AuthenticationFailedException, AuthorizationFailedException, PermissionDeniedException, BadParameterException, IncorrectStateException, AlreadyExistsException, DoesNotExistException, TimeoutException, NoSuccessException {
403 AbstractAsyncNSDirectoryImpl.super.permissionsDenySync(targetPattern, id, permissions, flags);
404 return null;
405 }
406 };
407 }
408 public Task<NSDirectory, Void> permissionsDeny(TaskMode mode, final String targetPattern, final String id, final int permissions) throws NotImplementedException {
409 return new AbstractThreadedTask<NSDirectory,Void>(mode) {
410 public Void invoke() throws NotImplementedException, IncorrectURLException, AuthenticationFailedException, AuthorizationFailedException, PermissionDeniedException, BadParameterException, IncorrectStateException, AlreadyExistsException, DoesNotExistException, TimeoutException, NoSuccessException {
411 AbstractAsyncNSDirectoryImpl.super.permissionsDenySync(targetPattern, id, permissions);
412 return null;
413 }
414 };
415 }
416
417
418
419
420 public Task<NSEntry, URL> getCWD(TaskMode mode) throws NotImplementedException {
421 return new AbstractThreadedTask<NSEntry,URL>(mode) {
422 public URL invoke() throws NotImplementedException, IncorrectURLException, AuthenticationFailedException, AuthorizationFailedException, PermissionDeniedException, BadParameterException, IncorrectStateException, AlreadyExistsException, DoesNotExistException, TimeoutException, NoSuccessException {
423 return AbstractAsyncNSDirectoryImpl.super.getCWDSync();
424 }
425 };
426 }
427
428
429 public Task<NSEntry, Void> copy(TaskMode mode, final URL target, final int flags) throws NotImplementedException {
430 if (this instanceof AbstractSyncDirectoryImpl) {
431 final AbstractSyncDirectoryImpl source = (AbstractSyncDirectoryImpl) this;
432 return new AbstractCopyTask<NSEntry,Void>(mode, m_session, target, flags) {
433 public void doCopy(URL target, int flags) throws NotImplementedException, AuthenticationFailedException, AuthorizationFailedException, PermissionDeniedException, BadParameterException, IncorrectStateException, DoesNotExistException, AlreadyExistsException, TimeoutException, NoSuccessException, IncorrectURLException {
434 source._copyAndMonitor(target, flags, this);
435 }
436 };
437 } else {
438 return new AbstractThreadedTask<NSEntry,Void>(mode) {
439 public Void invoke() throws NotImplementedException, IncorrectURLException, AuthenticationFailedException, AuthorizationFailedException, PermissionDeniedException, BadParameterException, IncorrectStateException, AlreadyExistsException, DoesNotExistException, TimeoutException, NoSuccessException {
440 AbstractAsyncNSDirectoryImpl.super.copySync(target, flags);
441 return null;
442 }
443 };
444 }
445 }
446
447
448 public Task<NSEntry, Void> move(TaskMode mode, final URL target, final int flags) throws NotImplementedException {
449 if (this instanceof AbstractSyncDirectoryImpl) {
450 final AbstractSyncDirectoryImpl source = (AbstractSyncDirectoryImpl) this;
451 return new AbstractCopyTask<NSEntry,Void>(mode, m_session, target, flags) {
452 public void doCopy(URL target, int flags) throws NotImplementedException, AuthenticationFailedException, AuthorizationFailedException, PermissionDeniedException, BadParameterException, IncorrectStateException, DoesNotExistException, AlreadyExistsException, TimeoutException, NoSuccessException, IncorrectURLException {
453 source._copyAndMonitor(target, flags, this);
454
455 int removeFlags = Flags.RECURSIVE.getValue();
456 if (Flags.DEREFERENCE.isSet(flags)) {
457 removeFlags += Flags.DEREFERENCE.getValue();
458 }
459 source.removeSync(removeFlags);
460 }
461 };
462 } else {
463 return new AbstractThreadedTask<NSEntry,Void>(mode) {
464 public Void invoke() throws NotImplementedException, IncorrectURLException, AuthenticationFailedException, AuthorizationFailedException, PermissionDeniedException, BadParameterException, IncorrectStateException, AlreadyExistsException, DoesNotExistException, TimeoutException, NoSuccessException {
465 AbstractAsyncNSDirectoryImpl.super.moveSync(target, flags);
466 return null;
467 }
468 };
469 }
470 }
471
472
473 public Task<NSEntry, Void> remove(TaskMode mode, final int flags) throws NotImplementedException {
474 return new AbstractThreadedTask<NSEntry,Void>(mode) {
475 public Void invoke() throws NotImplementedException, IncorrectURLException, AuthenticationFailedException, AuthorizationFailedException, PermissionDeniedException, BadParameterException, IncorrectStateException, AlreadyExistsException, DoesNotExistException, TimeoutException, NoSuccessException {
476 AbstractAsyncNSDirectoryImpl.super.removeSync(flags);
477 return null;
478 }
479 };
480 }
481 }