am bba39b9b: [FileEncap8] Remove useless "success" variable
* commit 'bba39b9b678f4fb00511ba88c12eef9082ecc628': [FileEncap8] Remove useless "success" variablemain
commit
a515f3ef39
|
@ -116,23 +116,15 @@ public final class Uploader {
|
||||||
&& !pathname.canWrite();
|
&& !pathname.canWrite();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
// TODO: Remove local variable
|
|
||||||
boolean success = true;
|
|
||||||
if (files.length == 0) {
|
|
||||||
success = false;
|
|
||||||
}
|
|
||||||
for (final File file : files) {
|
for (final File file : files) {
|
||||||
if (!uploadFile(file)) {
|
uploadFile(file);
|
||||||
success = false;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean uploadFile(final File file) {
|
private void uploadFile(final File file) {
|
||||||
if (DEBUG) {
|
if (DEBUG) {
|
||||||
Log.d(TAG, "attempting upload of " + file.getAbsolutePath());
|
Log.d(TAG, "attempting upload of " + file.getAbsolutePath());
|
||||||
}
|
}
|
||||||
boolean success = false;
|
|
||||||
final int contentLength = (int) file.length();
|
final int contentLength = (int) file.length();
|
||||||
HttpURLConnection connection = null;
|
HttpURLConnection connection = null;
|
||||||
InputStream fileInputStream = null;
|
InputStream fileInputStream = null;
|
||||||
|
@ -154,10 +146,9 @@ public final class Uploader {
|
||||||
Log.d(TAG, "| " + reader.readLine());
|
Log.d(TAG, "| " + reader.readLine());
|
||||||
}
|
}
|
||||||
reader.close();
|
reader.close();
|
||||||
return success;
|
return;
|
||||||
}
|
}
|
||||||
file.delete();
|
file.delete();
|
||||||
success = true;
|
|
||||||
if (DEBUG) {
|
if (DEBUG) {
|
||||||
Log.d(TAG, "upload successful");
|
Log.d(TAG, "upload successful");
|
||||||
}
|
}
|
||||||
|
@ -175,7 +166,6 @@ public final class Uploader {
|
||||||
connection.disconnect();
|
connection.disconnect();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return success;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void uploadContents(final InputStream is, final OutputStream os)
|
private static void uploadContents(final InputStream is, final OutputStream os)
|
||||||
|
|
Loading…
Reference in New Issue