Skip to content

Commit d6d3f9b

Browse files
committed
squash w/ 2870ae7. split exception handling logic in feature impls
1 parent 12beeda commit d6d3f9b

11 files changed

+55
-11
lines changed

irods/src/main/java/ch/cyberduck/core/irods/IRODSAttributesFinderFeature.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
* GNU General Public License for more details.
1616
*/
1717

18+
import ch.cyberduck.core.DefaultIOExceptionMappingService;
1819
import ch.cyberduck.core.ListProgressListener;
1920
import ch.cyberduck.core.Path;
2021
import ch.cyberduck.core.PathAttributes;
@@ -102,9 +103,12 @@ public PathAttributes find(final Path file, final ListProgressListener listener)
102103

103104
throw new NotfoundException(logicalPath);
104105
}
105-
catch(IOException | IRODSException e) {
106+
catch(IRODSException e) {
106107
throw new IRODSExceptionMappingService().map("Failure to read attributes of {0}", e, file);
107108
}
109+
catch(IOException e) {
110+
throw new DefaultIOExceptionMappingService().map("Failure to read attributes of {0}", e, file);
111+
}
108112
}
109113

110114
@Override

irods/src/main/java/ch/cyberduck/core/irods/IRODSCopyFeature.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
*/
1717

1818
import ch.cyberduck.core.ConnectionCallback;
19+
import ch.cyberduck.core.DefaultIOExceptionMappingService;
1920
import ch.cyberduck.core.Path;
2021
import ch.cyberduck.core.exception.BackgroundException;
2122
import ch.cyberduck.core.features.Copy;
@@ -55,9 +56,12 @@ public Path copy(final Path source, final Path target, final TransferStatus stat
5556

5657
return target;
5758
}
58-
catch(IOException | IRODSException e) {
59+
catch(IRODSException e) {
5960
throw new IRODSExceptionMappingService().map("Cannot copy {0}", e, source);
6061
}
62+
catch(IOException e) {
63+
throw new DefaultIOExceptionMappingService().map("Cannot copy {0}", e, source);
64+
}
6165
}
6266

6367
@Override

irods/src/main/java/ch/cyberduck/core/irods/IRODSDeleteFeature.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
* GNU General Public License for more details.
1616
*/
1717

18+
import ch.cyberduck.core.DefaultIOExceptionMappingService;
1819
import ch.cyberduck.core.PasswordCallback;
1920
import ch.cyberduck.core.Path;
2021
import ch.cyberduck.core.exception.BackgroundException;
@@ -89,9 +90,12 @@ else if(status.getType() == ObjectType.COLLECTION) {
8990
IRODSFilesystem.removeAll(conn.getRcComm(), logicalPath, removeOptions);
9091
}
9192
}
92-
catch(IOException | IRODSException e) {
93+
catch(IRODSException e) {
9394
throw new IRODSExceptionMappingService().map("Cannot delete {0}", e, file);
9495
}
96+
catch(IOException e) {
97+
throw new DefaultIOExceptionMappingService().map("Cannot delete {0}", e, file);
98+
}
9599
}
96100
}
97101

irods/src/main/java/ch/cyberduck/core/irods/IRODSDirectoryFeature.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
* GNU General Public License for more details.
1616
*/
1717

18+
import ch.cyberduck.core.DefaultIOExceptionMappingService;
1819
import ch.cyberduck.core.Path;
1920
import ch.cyberduck.core.exception.BackgroundException;
2021
import ch.cyberduck.core.features.Directory;
@@ -42,8 +43,11 @@ public Path mkdir(final Write<Void> writer, final Path folder, final TransferSta
4243
IRODSFilesystem.createCollection(conn.getRcComm(), folder.getAbsolute());
4344
return folder;
4445
}
45-
catch(IOException | IRODSFilesystemException e) {
46+
catch(IRODSFilesystemException e) {
4647
throw new IRODSExceptionMappingService().map("Cannot create folder {0}", e, folder);
4748
}
49+
catch(IOException e) {
50+
throw new DefaultIOExceptionMappingService().map("Cannot create folder {0}", e, folder);
51+
}
4852
}
4953
}

irods/src/main/java/ch/cyberduck/core/irods/IRODSFindFeature.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
* GNU General Public License for more details.
1616
*/
1717

18+
import ch.cyberduck.core.DefaultIOExceptionMappingService;
1819
import ch.cyberduck.core.ListProgressListener;
1920
import ch.cyberduck.core.Path;
2021
import ch.cyberduck.core.exception.BackgroundException;
@@ -44,8 +45,11 @@ public boolean find(final Path file, final ListProgressListener listener) throws
4445
final IRODSConnection conn = session.getClient();
4546
return IRODSFilesystem.exists(conn.getRcComm(), file.getAbsolute());
4647
}
47-
catch(IOException | IRODSException e) {
48+
catch(IRODSException e) {
4849
throw new IRODSExceptionMappingService().map("Failure to find {0}", e, file);
4950
}
51+
catch(IOException e) {
52+
throw new DefaultIOExceptionMappingService().map("Failure to find {0}", e, file);
53+
}
5054
}
5155
}

irods/src/main/java/ch/cyberduck/core/irods/IRODSListService.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
*/
1717

1818
import ch.cyberduck.core.AttributedList;
19+
import ch.cyberduck.core.DefaultIOExceptionMappingService;
1920
import ch.cyberduck.core.ListProgressListener;
2021
import ch.cyberduck.core.ListService;
2122
import ch.cyberduck.core.Path;
@@ -82,8 +83,11 @@ else if(entry.isDataObject()) {
8283

8384
return children;
8485
}
85-
catch(IRODSException | IOException e) {
86+
catch(IRODSException e) {
8687
throw new IRODSExceptionMappingService().map("Listing {0} failed", e, directory);
8788
}
89+
catch(IOException e) {
90+
throw new DefaultIOExceptionMappingService().map("Listing {0} failed", e, directory);
91+
}
8892
}
8993
}

irods/src/main/java/ch/cyberduck/core/irods/IRODSMoveFeature.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
*/
1717

1818
import ch.cyberduck.core.ConnectionCallback;
19+
import ch.cyberduck.core.DefaultIOExceptionMappingService;
1920
import ch.cyberduck.core.Path;
2021
import ch.cyberduck.core.exception.BackgroundException;
2122
import ch.cyberduck.core.exception.NotfoundException;
@@ -55,9 +56,12 @@ public Path move(final Path file, final Path renamed, final TransferStatus statu
5556
IRODSFilesystem.rename(conn.getRcComm(), file.getAbsolute(), renamed.getAbsolute());
5657
return renamed;
5758
}
58-
catch(IOException | IRODSException e) {
59+
catch(IRODSException e) {
5960
throw new IRODSExceptionMappingService().map("Cannot rename {0}", e, file);
6061
}
62+
catch(IOException e) {
63+
throw new DefaultIOExceptionMappingService().map("Cannot rename {0}", e, file);
64+
}
6165
}
6266

6367
@Override

irods/src/main/java/ch/cyberduck/core/irods/IRODSReadFeature.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
*/
1717

1818
import ch.cyberduck.core.ConnectionCallback;
19+
import ch.cyberduck.core.DefaultIOExceptionMappingService;
1920
import ch.cyberduck.core.Path;
2021
import ch.cyberduck.core.exception.BackgroundException;
2122
import ch.cyberduck.core.exception.NotfoundException;
@@ -56,9 +57,12 @@ public InputStream read(final Path file, final TransferStatus status, final Conn
5657

5758
return in;
5859
}
59-
catch(IOException | IRODSException e) {
60+
catch(IRODSException e) {
6061
throw new IRODSExceptionMappingService().map("Download of {0} failed", e, file);
6162
}
63+
catch(IOException e) {
64+
throw new DefaultIOExceptionMappingService().map("Download of {0} failed", e, file);
65+
}
6266
}
6367

6468
@Override

irods/src/main/java/ch/cyberduck/core/irods/IRODSTimestampFeature.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
* GNU General Public License for more details.
1616
*/
1717

18+
import ch.cyberduck.core.DefaultIOExceptionMappingService;
1819
import ch.cyberduck.core.Path;
1920
import ch.cyberduck.core.exception.BackgroundException;
2021
import ch.cyberduck.core.features.Timestamp;
@@ -74,9 +75,12 @@ else if(IRODSFilesystem.isCollection(objectStatus)) {
7475
log.debug("timestamp set to [{}] seconds (since epoch) on [{}] successfully.", seconds, logicalPath);
7576
}
7677
}
77-
catch(IOException | IRODSException e) {
78+
catch(IRODSException e) {
7879
throw new IRODSExceptionMappingService().map(e);
7980
}
81+
catch(IOException e) {
82+
throw new DefaultIOExceptionMappingService().map(e);
83+
}
8084
}
8185

8286
private long getReplicaNumberOfLatestGoodReplica(String logicalPath) throws IRODSException, IOException {

irods/src/main/java/ch/cyberduck/core/irods/IRODSTouchFeature.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
* GNU General Public License for more details.
1616
*/
1717

18+
import ch.cyberduck.core.DefaultIOExceptionMappingService;
1819
import ch.cyberduck.core.Path;
1920
import ch.cyberduck.core.exception.BackgroundException;
2021
import ch.cyberduck.core.features.Touch;
@@ -58,9 +59,12 @@ public Path touch(final Write writer, final Path file, final TransferStatus stat
5859

5960
return file;
6061
}
61-
catch(IOException | IRODSException e) {
62+
catch(IRODSException e) {
6263
throw new IRODSExceptionMappingService().map("Cannot create {0}", e, file);
6364
}
65+
catch(IOException e) {
66+
throw new DefaultIOExceptionMappingService().map("Cannot create {0}", e, file);
67+
}
6468
}
6569

6670
@Override

0 commit comments

Comments
 (0)