mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2025-10-06 12:00:04 +02:00
improvements from review
This commit is contained in:
parent
87c011f28c
commit
6ebda45c2f
1 changed files with 4 additions and 17 deletions
|
@ -15,7 +15,8 @@
|
||||||
*/
|
*/
|
||||||
package ghidra.app.plugin.core.totd;
|
package ghidra.app.plugin.core.totd;
|
||||||
|
|
||||||
import java.io.*;
|
import java.io.IOException;
|
||||||
|
import java.io.InputStream;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
@ -31,6 +32,7 @@ import ghidra.framework.plugintool.util.PluginStatus;
|
||||||
import ghidra.framework.preferences.Preferences;
|
import ghidra.framework.preferences.Preferences;
|
||||||
import ghidra.util.HelpLocation;
|
import ghidra.util.HelpLocation;
|
||||||
import ghidra.util.SystemUtilities;
|
import ghidra.util.SystemUtilities;
|
||||||
|
import utilities.util.FileUtilities;
|
||||||
|
|
||||||
//@formatter:off
|
//@formatter:off
|
||||||
@PluginInfo(
|
@PluginInfo(
|
||||||
|
@ -80,23 +82,8 @@ public class TipOfTheDayPlugin extends Plugin implements FrontEndOnly {
|
||||||
}
|
}
|
||||||
|
|
||||||
private List<String> loadTips() throws IOException {
|
private List<String> loadTips() throws IOException {
|
||||||
List<String> tips = new ArrayList<>();
|
|
||||||
try (InputStream in = getClass().getResourceAsStream("tips.txt")) {
|
try (InputStream in = getClass().getResourceAsStream("tips.txt")) {
|
||||||
if (in == null) {
|
return FileUtilities.getLines(in);
|
||||||
return tips;
|
|
||||||
}
|
|
||||||
BufferedReader reader = new BufferedReader(new InputStreamReader(in));
|
|
||||||
while (true) {
|
|
||||||
String tip = reader.readLine();
|
|
||||||
if (tip == null) {
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
if (tip.length() == 0) {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
tips.add(tip);
|
|
||||||
}
|
|
||||||
return tips;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue