Skip to content
This repository has been archived by the owner on Mar 19, 2024. It is now read-only.

run code cleanup #186

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/com/owncloud/android/lib/common/OwnCloudAccount.java
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -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... ");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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) {
Expand Down Expand Up @@ -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);
Expand All @@ -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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,10 @@

public interface ProgressiveDataTransferer {

public void addDatatransferProgressListener (OnDatatransferProgressListener listener);
void addDatatransferProgressListener(OnDatatransferProgressListener listener);

public void addDatatransferProgressListeners(Collection<OnDatatransferProgressListener> listeners);
void addDatatransferProgressListeners(Collection<OnDatatransferProgressListener> listeners);

public void removeDatatransferProgressListener(OnDatatransferProgressListener listener);
void removeDatatransferProgressListener(OnDatatransferProgressListener listener);

}
Original file line number Diff line number Diff line change
Expand Up @@ -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("/");
Expand Down
4 changes: 2 additions & 2 deletions src/com/owncloud/android/lib/resources/shares/ShareType.java
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public enum ShareType {

private int value;

private ShareType(int value)
ShareType(int value)
{
this.value = value;
}
Expand Down Expand Up @@ -78,4 +78,4 @@ public static ShareType fromValue(int value)
}
return null;
}
};
}
Original file line number Diff line number Diff line change
Expand Up @@ -80,4 +80,4 @@ public boolean isTrue(){
return getValue() == 1;
}

};
}
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down