diff --git a/src/com/owncloud/android/lib/common/OwnCloudAccount.java b/src/com/owncloud/android/lib/common/OwnCloudAccount.java index 533247dfc..5b20f3777 100644 --- a/src/com/owncloud/android/lib/common/OwnCloudAccount.java +++ b/src/com/owncloud/android/lib/common/OwnCloudAccount.java @@ -117,7 +117,7 @@ public OwnCloudAccount(Uri baseUri, OwnCloudCredentials credentials) { * @throws OperationCanceledException */ public void loadCredentials(Context context) - throws AccountNotFoundException, AuthenticatorException, + throws AuthenticatorException, IOException, OperationCanceledException { if (context == null) { diff --git a/src/com/owncloud/android/lib/common/OwnCloudClientManager.java b/src/com/owncloud/android/lib/common/OwnCloudClientManager.java index 856a11ba2..e7fe77afb 100644 --- a/src/com/owncloud/android/lib/common/OwnCloudClientManager.java +++ b/src/com/owncloud/android/lib/common/OwnCloudClientManager.java @@ -42,13 +42,13 @@ public interface OwnCloudClientManager { - public OwnCloudClient getClientFor(OwnCloudAccount account, Context context) + OwnCloudClient getClientFor(OwnCloudAccount account, Context context) throws AccountNotFoundException, OperationCanceledException, AuthenticatorException, IOException; - public OwnCloudClient removeClientFor(OwnCloudAccount account); + OwnCloudClient removeClientFor(OwnCloudAccount account); - public void saveAllClients(Context context, String accountType) + void saveAllClients(Context context, String accountType) throws AccountNotFoundException, AuthenticatorException, IOException, OperationCanceledException; diff --git a/src/com/owncloud/android/lib/common/OwnCloudClientManagerFactory.java b/src/com/owncloud/android/lib/common/OwnCloudClientManagerFactory.java index fc6754117..99c465527 100644 --- a/src/com/owncloud/android/lib/common/OwnCloudClientManagerFactory.java +++ b/src/com/owncloud/android/lib/common/OwnCloudClientManagerFactory.java @@ -25,7 +25,7 @@ public class OwnCloudClientManagerFactory { - public static enum Policy { + public enum Policy { ALWAYS_NEW_CLIENT, SINGLE_SESSION_PER_ACCOUNT, SINGLE_SESSION_PER_ACCOUNT_IF_SERVER_SUPPORTS_SERVER_MONITORING @@ -94,11 +94,8 @@ private static boolean defaultSingletonMustBeUpdated(Policy policy) { !(sDefaultSingleton instanceof SimpleFactoryManager)) { return true; } - if (policy == Policy.SINGLE_SESSION_PER_ACCOUNT && - !(sDefaultSingleton instanceof SingleSessionManager)) { - return true; - } - return false; + return policy == Policy.SINGLE_SESSION_PER_ACCOUNT && + !(sDefaultSingleton instanceof SingleSessionManager); } } diff --git a/src/com/owncloud/android/lib/common/SingleSessionManager.java b/src/com/owncloud/android/lib/common/SingleSessionManager.java index 05396480f..5cb782a9c 100644 --- a/src/com/owncloud/android/lib/common/SingleSessionManager.java +++ b/src/com/owncloud/android/lib/common/SingleSessionManager.java @@ -190,9 +190,7 @@ public OwnCloudClient removeClientFor(OwnCloudAccount account) { @Override - public void saveAllClients(Context context, String accountType) - throws AccountNotFoundException, AuthenticatorException, IOException, - OperationCanceledException { + public void saveAllClients(Context context, String accountType) { if (Log.isLoggable(TAG, Log.DEBUG)) { Log_OC.d(TAG, "Saving sessions... "); diff --git a/src/com/owncloud/android/lib/common/authentication/oauth/BearerCredentials.java b/src/com/owncloud/android/lib/common/authentication/oauth/BearerCredentials.java index c815bc4cd..989b9f55f 100644 --- a/src/com/owncloud/android/lib/common/authentication/oauth/BearerCredentials.java +++ b/src/com/owncloud/android/lib/common/authentication/oauth/BearerCredentials.java @@ -93,9 +93,7 @@ public boolean equals(Object o) { if (this == o) return true; if (this.getClass().equals(o.getClass())) { BearerCredentials that = (BearerCredentials) o; - if (LangUtils.equals(mAccessToken, that.mAccessToken)) { - return true; - } + return LangUtils.equals(mAccessToken, that.mAccessToken); } return false; } diff --git a/src/com/owncloud/android/lib/common/network/AdvancedSslSocketFactory.java b/src/com/owncloud/android/lib/common/network/AdvancedSslSocketFactory.java index 873ec6569..7d41bb4da 100644 --- a/src/com/owncloud/android/lib/common/network/AdvancedSslSocketFactory.java +++ b/src/com/owncloud/android/lib/common/network/AdvancedSslSocketFactory.java @@ -93,7 +93,7 @@ public AdvancedSslSocketFactory( */ @Override public Socket createSocket(String host, int port, InetAddress clientHost, int clientPort) - throws IOException, UnknownHostException { + throws IOException { Socket socket = mSslContext.getSocketFactory().createSocket(host, port, clientHost, clientPort); enableSecureProtocols(socket); @@ -158,8 +158,7 @@ private void logSslParameters(SSLParameters params) { @Override public Socket createSocket(final String host, final int port, final InetAddress localAddress, final int localPort, - final HttpConnectionParams params) throws IOException, - UnknownHostException, ConnectTimeoutException { + final HttpConnectionParams params) throws IOException { Log_OC.d(TAG, "Creating SSL Socket with remote " + host + ":" + port + ", local " + localAddress + ":" + localPort + ", params: " + params); if (params == null) { @@ -188,8 +187,7 @@ public Socket createSocket(final String host, final int port, * @see ProtocolSocketFactory#createSocket(java.lang.String, int) */ @Override - public Socket createSocket(String host, int port) throws IOException, - UnknownHostException { + public Socket createSocket(String host, int port) throws IOException { Log_OC.d(TAG, "Creating SSL Socket with remote " + host + ":" + port); Socket socket = mSslContext.getSocketFactory().createSocket(host, port); enableSecureProtocols(socket); @@ -199,8 +197,7 @@ public Socket createSocket(String host, int port) throws IOException, @Override - public Socket createSocket(Socket socket, String host, int port, boolean autoClose) throws IOException, - UnknownHostException { + public Socket createSocket(Socket socket, String host, int port, boolean autoClose) throws IOException { Socket sslSocket = mSslContext.getSocketFactory().createSocket(socket, host, port, autoClose); enableSecureProtocols(sslSocket); verifyPeerIdentity(host, port, sslSocket); diff --git a/src/com/owncloud/android/lib/common/network/AdvancedX509TrustManager.java b/src/com/owncloud/android/lib/common/network/AdvancedX509TrustManager.java index 8495a370a..c759d9f8a 100644 --- a/src/com/owncloud/android/lib/common/network/AdvancedX509TrustManager.java +++ b/src/com/owncloud/android/lib/common/network/AdvancedX509TrustManager.java @@ -76,7 +76,7 @@ public AdvancedX509TrustManager(KeyStore knownServersKeyStore) * @return The first X509TrustManager found in factory. * @throws CertStoreException When no X509TrustManager instance was found in factory */ - private X509TrustManager findX509TrustManager(TrustManagerFactory factory) throws CertStoreException { + private X509TrustManager findX509TrustManager(TrustManagerFactory factory) { TrustManager tms[] = factory.getTrustManagers(); for (int i = 0; i < tms.length; i++) { if (tms[i] instanceof X509TrustManager) { @@ -100,7 +100,7 @@ public void checkClientTrusted(X509Certificate[] certificates, String authType) * @see javax.net.ssl.X509TrustManager#checkServerTrusted(X509Certificate[], * String authType) */ - public void checkServerTrusted(X509Certificate[] certificates, String authType) throws CertificateException { + public void checkServerTrusted(X509Certificate[] certificates, String authType) { if (!isKnownServer(certificates[0])) { CertificateCombinedException result = new CertificateCombinedException(certificates[0]); try { diff --git a/src/com/owncloud/android/lib/common/network/OnDatatransferProgressListener.java b/src/com/owncloud/android/lib/common/network/OnDatatransferProgressListener.java index a36694cf7..355ef17f1 100644 --- a/src/com/owncloud/android/lib/common/network/OnDatatransferProgressListener.java +++ b/src/com/owncloud/android/lib/common/network/OnDatatransferProgressListener.java @@ -26,5 +26,5 @@ package com.owncloud.android.lib.common.network; public interface OnDatatransferProgressListener { - public void onTransferProgress(long progressRate, long totalTransferredSoFar, long totalToTransfer, String fileAbsoluteName); + void onTransferProgress(long progressRate, long totalTransferredSoFar, long totalToTransfer, String fileAbsoluteName); } diff --git a/src/com/owncloud/android/lib/common/network/ProgressiveDataTransferer.java b/src/com/owncloud/android/lib/common/network/ProgressiveDataTransferer.java index 2868ac8c1..24cc1b0aa 100644 --- a/src/com/owncloud/android/lib/common/network/ProgressiveDataTransferer.java +++ b/src/com/owncloud/android/lib/common/network/ProgressiveDataTransferer.java @@ -30,10 +30,10 @@ public interface ProgressiveDataTransferer { - public void addDatatransferProgressListener (OnDatatransferProgressListener listener); + void addDatatransferProgressListener(OnDatatransferProgressListener listener); - public void addDatatransferProgressListeners(Collection listeners); + void addDatatransferProgressListeners(Collection listeners); - public void removeDatatransferProgressListener(OnDatatransferProgressListener listener); + void removeDatatransferProgressListener(OnDatatransferProgressListener listener); } diff --git a/src/com/owncloud/android/lib/common/network/WebdavEntry.java b/src/com/owncloud/android/lib/common/network/WebdavEntry.java index d93286b3f..2539d7e66 100644 --- a/src/com/owncloud/android/lib/common/network/WebdavEntry.java +++ b/src/com/owncloud/android/lib/common/network/WebdavEntry.java @@ -71,7 +71,7 @@ public WebdavEntry(MultiStatusResponse ms, String splitElement) { @SuppressWarnings("rawtypes") DavProperty prop = propSet.get(DavPropertyName.DISPLAYNAME); if (prop != null) { - mName = (String) prop.getName().toString(); + mName = prop.getName().toString(); mName = mName.substring(1, mName.length() - 1); } else { String[] tmp = mPath.split("/"); diff --git a/src/com/owncloud/android/lib/resources/shares/ShareType.java b/src/com/owncloud/android/lib/resources/shares/ShareType.java index a2d3c1015..ca1501653 100644 --- a/src/com/owncloud/android/lib/resources/shares/ShareType.java +++ b/src/com/owncloud/android/lib/resources/shares/ShareType.java @@ -48,7 +48,7 @@ public enum ShareType { private int value; - private ShareType(int value) + ShareType(int value) { this.value = value; } @@ -78,4 +78,4 @@ public static ShareType fromValue(int value) } return null; } -}; \ No newline at end of file +} \ No newline at end of file diff --git a/src/com/owncloud/android/lib/resources/status/CapabilityBooleanType.java b/src/com/owncloud/android/lib/resources/status/CapabilityBooleanType.java index a2eeae84c..0fe1aa4e5 100644 --- a/src/com/owncloud/android/lib/resources/status/CapabilityBooleanType.java +++ b/src/com/owncloud/android/lib/resources/status/CapabilityBooleanType.java @@ -80,4 +80,4 @@ public boolean isTrue(){ return getValue() == 1; } -}; \ No newline at end of file +} \ No newline at end of file diff --git a/src/com/owncloud/android/lib/resources/users/GetRemoteUserAvatarOperation.java b/src/com/owncloud/android/lib/resources/users/GetRemoteUserAvatarOperation.java index 2c1ea9ce3..8a146a04e 100644 --- a/src/com/owncloud/android/lib/resources/users/GetRemoteUserAvatarOperation.java +++ b/src/com/owncloud/android/lib/resources/users/GetRemoteUserAvatarOperation.java @@ -81,7 +81,6 @@ protected RemoteOperationResult run(OwnCloudClient client) { String uri = client.getBaseUri() + NON_OFFICIAL_AVATAR_PATH + client.getCredentials().getUsername() + "/" + mDimension; - ; Log_OC.d(TAG, "avatar URI: " + uri); get = new GetMethod(uri); /* Conditioned call is corrupting the input stream of the connection.