1212import org .cryptomator .cloudaccess .api .Quota ;
1313import org .cryptomator .cloudaccess .api .exceptions .AlreadyExistsException ;
1414import org .cryptomator .cloudaccess .api .exceptions .CloudProviderException ;
15+ import org .cryptomator .cloudaccess .api .exceptions .CloudTimeoutException ;
1516import org .cryptomator .cloudaccess .api .exceptions .InsufficientStorageException ;
1617import org .cryptomator .cloudaccess .api .exceptions .NotFoundException ;
1718import org .cryptomator .cloudaccess .api .exceptions .ParentFolderDoesNotExistException ;
2324import java .io .ByteArrayInputStream ;
2425import java .io .IOException ;
2526import java .io .InputStream ;
27+ import java .io .InterruptedIOException ;
2628import java .net .HttpURLConnection ;
2729import java .net .MalformedURLException ;
2830import java .net .URL ;
@@ -53,6 +55,8 @@ CloudItemMetadata itemMetadata(final CloudPath path) throws CloudProviderExcepti
5355 checkPropfindExecutionSucceeded (response .code ());
5456
5557 return processGet (getEntriesFromResponse (response ), path );
58+ } catch (InterruptedIOException e ) {
59+ throw new CloudTimeoutException (e );
5660 } catch (IOException | SAXException e ) {
5761 throw new CloudProviderException (e );
5862 }
@@ -80,6 +84,8 @@ Quota quota(final CloudPath folder) throws CloudProviderException {
8084 try (final var responseBody = response .body ()) {
8185 return new PropfindResponseParser ().parseQuta (responseBody .byteStream ());
8286 }
87+ } catch (InterruptedIOException e ) {
88+ throw new CloudTimeoutException (e );
8389 } catch (IOException | SAXException e ) {
8490 throw new CloudProviderException (e );
8591 }
@@ -93,6 +99,8 @@ CloudItemList list(final CloudPath folder) throws CloudProviderException {
9399 final var nodes = getEntriesFromResponse (response );
94100
95101 return processDirList (nodes , folder );
102+ } catch (InterruptedIOException e ) {
103+ throw new CloudTimeoutException (e );
96104 } catch (IOException | SAXException e ) {
97105 throw new CloudProviderException (e );
98106 }
@@ -202,6 +210,8 @@ CloudPath move(final CloudPath from, final CloudPath to, boolean replace) throws
202210 throw new CloudProviderException ("Response code isn't between 200 and 300: " + response .code ());
203211 }
204212 }
213+ } catch (InterruptedIOException e ) {
214+ throw new CloudTimeoutException (e );
205215 } catch (IOException e ) {
206216 throw new CloudProviderException (e );
207217 }
@@ -247,6 +257,8 @@ private InputStream read(final Request.Builder getRequest, final ProgressListene
247257 throw new CloudProviderException ("Response code isn't between 200 and 300: " + response .code ());
248258 }
249259 }
260+ } catch (InterruptedIOException e ) {
261+ throw new CloudTimeoutException (e );
250262 } catch (IOException e ) {
251263 throw new CloudProviderException (e );
252264 } finally {
@@ -286,6 +298,8 @@ void write(final CloudPath file, final boolean replace, final InputStream data,
286298 throw new CloudProviderException ("Response code isn't between 200 and 300: " + response .code ());
287299 }
288300 }
301+ } catch (InterruptedIOException e ) {
302+ throw new CloudTimeoutException (e );
289303 } catch (IOException e ) {
290304 throw new CloudProviderException (e );
291305 }
@@ -324,6 +338,8 @@ CloudPath createFolder(final CloudPath path) throws CloudProviderException {
324338 throw new CloudProviderException ("Response code isn't between 200 and 300: " + response .code ());
325339 }
326340 }
341+ } catch (InterruptedIOException e ) {
342+ throw new CloudTimeoutException (e );
327343 } catch (IOException e ) {
328344 throw new CloudProviderException (e );
329345 }
@@ -348,6 +364,8 @@ void delete(final CloudPath path) throws CloudProviderException {
348364 throw new CloudProviderException ("Response code isn't between 200 and 300: " + response .code ());
349365 }
350366 }
367+ } catch (InterruptedIOException e ) {
368+ throw new CloudTimeoutException (e );
351369 } catch (IOException e ) {
352370 throw new CloudProviderException (e );
353371 }
0 commit comments