Formatting

This commit is contained in:
Anthony Restaino 2014-07-27 21:41:48 -04:00
parent 25818dd8e9
commit 1e2908ccd6
4 changed files with 3293 additions and 3302 deletions

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -15,8 +15,7 @@ public class ReplacingInputStream extends FilterInputStream {
final byte[] search, replacement;
protected ReplacingInputStream(InputStream in, byte[] search,
byte[] replacement) {
protected ReplacingInputStream(InputStream in, byte[] search, byte[] replacement) {
super(in);
this.search = search;
this.replacement = replacement;
@ -43,7 +42,6 @@ public class ReplacingInputStream extends FilterInputStream {
}
}
@Override
public int read() throws IOException {
@ -69,7 +67,8 @@ public class ReplacingInputStream extends FilterInputStream {
}
/**
* Returns false. REFilterInputStream does not support mark() and reset() methods.
* Returns false. REFilterInputStream does not support mark() and reset()
* methods.
*/
@Override
public boolean markSupported() {

View File

@ -23,11 +23,11 @@ public final class Utils {
private Utils() {
}
public static void downloadFile(final Activity activity, final String url, final String userAgent,
final String contentDisposition, final boolean privateBrowsing) {
String fileName = URLUtil.guessFileName(url, null,
null);
DownloadHandler.onDownloadStart(activity, url, userAgent, contentDisposition, null, privateBrowsing);
public static void downloadFile(final Activity activity, final String url,
final String userAgent, final String contentDisposition, final boolean privateBrowsing) {
String fileName = URLUtil.guessFileName(url, null, null);
DownloadHandler.onDownloadStart(activity, url, userAgent, contentDisposition, null,
privateBrowsing);
Log.i(Constants.TAG, "Downloading" + fileName);
}
@ -38,8 +38,7 @@ public final class Utils {
return;
}
try {
BufferedReader readUrlRead = new BufferedReader(new FileReader(
bookUrl));
BufferedReader readUrlRead = new BufferedReader(new FileReader(bookUrl));
String u;
while ((u = readUrlRead.readLine()) != null) {
if (u.contentEquals(url)) {
@ -54,10 +53,8 @@ public final class Utils {
} catch (NullPointerException ignored) {
}
try {
BufferedWriter bookWriter = new BufferedWriter(new FileWriter(book,
true));
BufferedWriter urlWriter = new BufferedWriter(new FileWriter(
bookUrl, true));
BufferedWriter bookWriter = new BufferedWriter(new FileWriter(book, true));
BufferedWriter urlWriter = new BufferedWriter(new FileWriter(bookUrl, true));
bookWriter.write(title);
urlWriter.write(url);
bookWriter.newLine();
@ -70,10 +67,10 @@ public final class Utils {
}
}
public static Intent newEmailIntent(Context context, String address,
String subject, String body, String cc) {
public static Intent newEmailIntent(Context context, String address, String subject,
String body, String cc) {
Intent intent = new Intent(Intent.ACTION_SEND);
intent.putExtra(Intent.EXTRA_EMAIL, new String[]{address});
intent.putExtra(Intent.EXTRA_EMAIL, new String[] { address });
intent.putExtra(Intent.EXTRA_TEXT, body);
intent.putExtra(Intent.EXTRA_SUBJECT, subject);
intent.putExtra(Intent.EXTRA_CC, cc);
@ -81,11 +78,11 @@ public final class Utils {
return intent;
}
public static void createInformativeDialog(Context context, String title,
String message) {
public static void createInformativeDialog(Context context, String title, String message) {
AlertDialog.Builder builder = new AlertDialog.Builder(context);
builder.setTitle(title);
builder.setMessage(message).setCancelable(true)
builder.setMessage(message)
.setCancelable(true)
.setPositiveButton(context.getResources().getString(R.string.action_ok),
new DialogInterface.OnClickListener() {
@Override
@ -124,15 +121,13 @@ public final class Utils {
public static List<HistoryItem> getBookmarks(Context context) {
List<HistoryItem> bookmarks = new ArrayList<HistoryItem>();
File bookUrl = new File(context.getFilesDir(),
"bookurl");
File bookUrl = new File(context.getFilesDir(), "bookurl");
File book = new File(context.getFilesDir(), "bookmarks");
try {
BufferedReader readUrl = new BufferedReader(new FileReader(bookUrl));
BufferedReader readBook = new BufferedReader(new FileReader(book));
String u, t;
while ((u = readUrl.readLine()) != null
&& (t = readBook.readLine()) != null) {
while ((u = readUrl.readLine()) != null && (t = readBook.readLine()) != null) {
HistoryItem map = new HistoryItem(u, t, R.drawable.ic_bookmark);
bookmarks.add(map);
}