*
* @author niki
*/
-class BasicSupportHelper {
+public class BasicSupportHelper {
/**
* Get the default cover related to this subject (see <tt>.info</tt> files).
*
*
* @return the cover if any, or NULL
*/
- public static Image getDefaultCover(String subject) {
+ public Image getDefaultCover(String subject) {
if (subject != null && !subject.isEmpty()
&& Instance.getCoverDir() != null) {
try {
*
* @return the extensions
*/
- public static String[] getImageExt(boolean emptyAllowed) {
+ public String[] getImageExt(boolean emptyAllowed) {
if (emptyAllowed) {
return new String[] { "", ".png", ".jpg", ".jpeg", ".gif", ".bmp" };
}
* refresh the cache with it if it is.
*
* @param support
- * the linked {@link BasicSupport}
+ * the linked {@link BasicSupport} (can be NULL)
* @param source
* the story source
* @param line
* @return the image if found, or NULL
*
*/
- public static Image getImage(BasicSupport support, URL source, String line) {
+ public Image getImage(BasicSupport support, URL source, String line) {
URL url = getImageUrl(support, source, line);
if (url != null) {
if ("file".equals(url.getProtocol())) {
}
InputStream in = null;
try {
- in = Instance.getCache().open(url,
- BasicSupport.getSupport(url), true);
+ in = Instance.getCache().open(url, support, true);
return new Image(in);
} catch (IOException e) {
} finally {
* refresh the cache with it if it is.
*
* @param support
- * the linked {@link BasicSupport}
+ * the linked {@link BasicSupport} (can be NULL)
* @param source
* the story source
* @param line
* @return the image URL if found, or NULL
*
*/
- public static URL getImageUrl(BasicSupport support, URL source, String line) {
+ public URL getImageUrl(BasicSupport support, URL source, String line) {
URL url = null;
if (line != null) {
*
* @return the author without prefixes
*/
- public static String fixAuthor(String author) {
+ public String fixAuthor(String author) {
if (author != null) {
for (String suffix : new String[] { " ", ":" }) {
- for (String byString : Instance.getConfig()
- .getString(Config.BYS).split(",")) {
+ for (String byString : Instance.getConfig().getList(Config.CONF_BYS)) {
byString += suffix;
if (author.toUpperCase().startsWith(byString.toUpperCase())) {
author = author.substring(byString.length()).trim();