@Override public T getResult() throws OperationCanceledException, IOException, AuthenticatorException { start(); if (exception instanceof OperationCanceledException) { throw new OperationCanceledException(exception); } else if (exception instanceof IOException) { throw new IOException(exception); } else if (exception instanceof AuthenticatorException) { throw new AuthenticatorException(exception); } return result; }
/** * Constructs full url to host and webdav resource basing on host version * * @param context Valid Android {@link Context}, needed to access the {@link AccountManager} * @param account A stored ownCloud {@link Account} * @return Full URL to WebDAV endpoint in the server corresponding to 'account'. * @throws AccountNotFoundException When 'account' is unknown for the AccountManager */ public static String getWebDavUrlForAccount(Context context, Account account) throws AccountNotFoundException { String webDavUrlForAccount = ""; try { OwnCloudCredentials ownCloudCredentials = getCredentialsForAccount(context, account); webDavUrlForAccount = getBaseUrlForAccount(context, account) + OwnCloudClient.WEBDAV_FILES_PATH_4_0 + ownCloudCredentials.getUsername(); } catch (OperationCanceledException e) { e.printStackTrace(); } catch (AuthenticatorException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } return webDavUrlForAccount; }
@Override public GeneratedMessageLite respond(Wire.Envelope envelope) throws InvalidProtocolBufferException { Wire.DoAddAccountMenuRequest request = Wire.DoAddAccountMenuRequest.parseFrom(envelope.getMessage()); try { showAddAccountMenu(); } catch (AuthenticatorException e) { e.printStackTrace(); } catch (OperationCanceledException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } return Wire.Envelope.newBuilder() .setId(envelope.getId()) .setType(Wire.MessageType.DO_ADD_ACCOUNT_MENU) .setMessage(Wire.DoAddAccountMenuResponse.newBuilder() .setSuccess(true) .build() .toByteString()) .build(); }
throw new OperationCanceledException(); } catch (TimeoutException e) { cancel(true /* interrupt if running */); throw new OperationCanceledException();
successResult = success.getResult(); } catch (OperationCanceledException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace();
@Override public T getResult() throws OperationCanceledException, IOException, AuthenticatorException { start(); if (exception instanceof OperationCanceledException) { throw new OperationCanceledException(exception); } else if (exception instanceof IOException) { throw new IOException(exception); } else if (exception instanceof AuthenticatorException) { throw new AuthenticatorException(exception); } return result; }
@Override public T getResult() throws OperationCanceledException, IOException, AuthenticatorException { start(); if (exception instanceof OperationCanceledException) { throw new OperationCanceledException(exception); } else if (exception instanceof IOException) { throw new IOException(exception); } else if (exception instanceof AuthenticatorException) { throw new AuthenticatorException(exception); } return result; }
@Override public T getResult() throws OperationCanceledException, IOException, AuthenticatorException { start(); if (exception instanceof OperationCanceledException) { throw new OperationCanceledException(exception); } else if (exception instanceof IOException) { throw new IOException(exception); } else if (exception instanceof AuthenticatorException) { throw new AuthenticatorException(exception); } return result; }
throw new OperationCanceledException(); } catch (TimeoutException e) { cancel(true /* interrupt if running */); throw new OperationCanceledException();
throw new OperationCanceledException(); } catch (TimeoutException e) { cancel(true /* interrupt if running */); throw new OperationCanceledException();