Backport: Remove tab characters from last 6 files
This commit is contained in:
parent
635e6c8267
commit
44e123105c
|
@ -11,6 +11,10 @@
|
|||
<property name="file" value="${config_loc}/suppressions.xml" />
|
||||
</module>
|
||||
|
||||
<module name="FileTabCharacter">
|
||||
<property name="eachLine" value="true"/>
|
||||
</module>
|
||||
|
||||
<module name="TreeWalker">
|
||||
<module name="OuterTypeFilename"/>
|
||||
<module name="IllegalTokenText">
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
package de.danoeh.antennapod.core.export.opml;
|
||||
|
||||
/** Represents a single feed in an OPML file. */
|
||||
/**
|
||||
* Represents a single feed in an OPML file.
|
||||
*/
|
||||
public class OpmlElement {
|
||||
private String text;
|
||||
private String xmlUrl;
|
||||
|
|
|
@ -13,24 +13,21 @@ import java.util.ArrayList;
|
|||
|
||||
import de.danoeh.antennapod.core.BuildConfig;
|
||||
|
||||
/** Reads OPML documents. */
|
||||
/**
|
||||
* Reads OPML documents.
|
||||
*/
|
||||
public class OpmlReader {
|
||||
private static final String TAG = "OpmlReader";
|
||||
|
||||
// ATTRIBUTES
|
||||
private boolean isInOpml = false;
|
||||
private ArrayList<OpmlElement> elementList;
|
||||
|
||||
/**
|
||||
* Reads an Opml document and returns a list of all OPML elements it can
|
||||
* find
|
||||
*
|
||||
* @throws IOException
|
||||
* @throws XmlPullParserException
|
||||
*/
|
||||
public ArrayList<OpmlElement> readDocument(Reader reader)
|
||||
throws XmlPullParserException, IOException {
|
||||
elementList = new ArrayList<>();
|
||||
ArrayList<OpmlElement> elementList = new ArrayList<>();
|
||||
XmlPullParserFactory factory = XmlPullParserFactory.newInstance();
|
||||
factory.setNamespaceAware(true);
|
||||
XmlPullParser xpp = factory.newPullParser();
|
||||
|
@ -40,17 +37,20 @@ public class OpmlReader {
|
|||
while (eventType != XmlPullParser.END_DOCUMENT) {
|
||||
switch (eventType) {
|
||||
case XmlPullParser.START_DOCUMENT:
|
||||
if (BuildConfig.DEBUG)
|
||||
if (BuildConfig.DEBUG) {
|
||||
Log.d(TAG, "Reached beginning of document");
|
||||
}
|
||||
break;
|
||||
case XmlPullParser.START_TAG:
|
||||
if (xpp.getName().equals(OpmlSymbols.OPML)) {
|
||||
isInOpml = true;
|
||||
if (BuildConfig.DEBUG)
|
||||
if (BuildConfig.DEBUG) {
|
||||
Log.d(TAG, "Reached beginning of OPML tree.");
|
||||
}
|
||||
} else if (isInOpml && xpp.getName().equals(OpmlSymbols.OUTLINE)) {
|
||||
if (BuildConfig.DEBUG)
|
||||
if (BuildConfig.DEBUG) {
|
||||
Log.d(TAG, "Found new Opml element");
|
||||
}
|
||||
OpmlElement element = new OpmlElement();
|
||||
|
||||
final String title = xpp.getAttributeValue(null, OpmlSymbols.TITLE);
|
||||
|
@ -71,18 +71,21 @@ public class OpmlReader {
|
|||
}
|
||||
elementList.add(element);
|
||||
} else {
|
||||
if (BuildConfig.DEBUG)
|
||||
Log.d(TAG,
|
||||
"Skipping element because of missing xml url");
|
||||
if (BuildConfig.DEBUG) {
|
||||
Log.d(TAG, "Skipping element because of missing xml url");
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
eventType = xpp.next();
|
||||
}
|
||||
|
||||
if (BuildConfig.DEBUG)
|
||||
if (BuildConfig.DEBUG) {
|
||||
Log.d(TAG, "Parsing finished.");
|
||||
}
|
||||
|
||||
return elementList;
|
||||
}
|
||||
|
|
|
@ -2,7 +2,9 @@ package de.danoeh.antennapod.core.export.opml;
|
|||
|
||||
import de.danoeh.antennapod.core.export.CommonSymbols;
|
||||
|
||||
/** Contains symbols for reading and writing OPML documents. */
|
||||
/**
|
||||
* Contains symbols for reading and writing OPML documents.
|
||||
*/
|
||||
final class OpmlSymbols extends CommonSymbols {
|
||||
|
||||
public static final String OPML = "opml";
|
||||
|
|
Loading…
Reference in New Issue