1 package fr.in2p3.jsaga.adaptor.data;
2
3 import org.globus.ftp.exception.UnexpectedReplyCodeException;
4 import org.ogf.saga.error.*;
5
6
7
8
9
10
11
12
13
14
15
16
17
18 public class GsiftpDCacheDataAdaptor extends Gsiftp2DataAdaptor {
19 public String getType() {
20 return "gsiftp-dcache";
21 }
22
23 protected void rethrowParsedException(UnexpectedReplyCodeException e) throws DoesNotExistException, AlreadyExistsException, PermissionDeniedException, NoSuccessException {
24 String message = e.getReply().getMessage();
25 if (message.indexOf("not a plain file") > -1 || message.indexOf("Local error") > -1 || message.indexOf("File not found") > -1) {
26 throw new DoesNotExistException(e);
27 } else if (message.indexOf("exists") > -1) {
28 throw new AlreadyExistsException(e);
29 } else if (message.indexOf("Permission denied") > -1) {
30 throw new PermissionDeniedException(e);
31 } else {
32 throw new NoSuccessException(e);
33 }
34 }
35 }