Remove tab characters from last 6 files
This commit is contained in:
parent
c21edc8b79
commit
6c0f9eec62
|
@ -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;
|
||||
|
|
|
@ -12,24 +12,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();
|
||||
|
@ -39,17 +36,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);
|
||||
|
@ -70,18 +70,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