clean up white space
@@ -55,11 +55,13 @@ public class ExternalParser extends AbstractParser {
/**
* Consumer contract
+ *
* @since Apache Tika 1.14
*/
public interface LineConsumer extends Serializable {
/**
* Consume a line
+ *
* @param line a line of string
*/
void consume(String line);
@@ -103,6 +105,7 @@ public class ExternalParser extends AbstractParser {
/**
* The external command to invoke.
+ *
* @see Runtime#exec(String[])
*/
private String[] command = new String[]{"cat"};
@@ -134,6 +137,7 @@ public class ExternalParser extends AbstractParser {
* Sets the command to be run. This can include either of
* {@link #INPUT_FILE_TOKEN} or {@link #OUTPUT_FILE_TOKEN}
* if the command needs filenames.
+ *
* @see Runtime#exec(String[])
*/
public void setCommand(String... command) {
@@ -142,6 +146,7 @@ public class ExternalParser extends AbstractParser {
/**
* Gets lines consumer
+ *
* @return consumer instance
*/
public LineConsumer getIgnoredLineConsumer() {
@@ -150,6 +155,7 @@ public class ExternalParser extends AbstractParser {
/**
* Set a consumer for the lines ignored by the parse functions
+ *
* @param ignoredLineConsumer consumer instance
*/
public void setIgnoredLineConsumer(LineConsumer ignoredLineConsumer) {
@@ -231,8 +237,7 @@ public class ExternalParser extends AbstractParser {
} else {
process = Runtime.getRuntime().exec(cmd);
}
- }
- catch(Exception e){
+ } catch (Exception e) {
e.printStackTrace();
}
@@ -323,8 +328,8 @@ public class ExternalParser extends AbstractParser {
t.start();
try {
t.join();
+ } catch (InterruptedException ignore) {
}
- catch(InterruptedException ignore){}
}
@@ -333,6 +338,7 @@ public class ExternalParser extends AbstractParser {
* standard stream of the given process. Potential exceptions
* are ignored, and the stream is closed once fully processed.
* Note: calling this starts a new thread and blocks the current(caller) thread until the new thread dies
+ *
* @param stream stream to be ignored
*/
private static void ignoreStream(final InputStream stream) {
@@ -343,6 +349,7 @@ public class ExternalParser extends AbstractParser {
* Starts a thread that reads and discards the contents of the
* standard stream of the given process. Potential exceptions
* are ignored, and the stream is closed once fully processed.
+ *
* @param stream stream to sent to black hole (a k a null)
* @param waitForDeath when {@code true} the caller thread will be blocked till the death of new thread.
* @return The thread that is created and started
@@ -362,7 +369,8 @@ public class ExternalParser extends AbstractParser {
if (waitForDeath) {
try {
t.join();
- } catch (InterruptedException ignore) {}
+ } catch (InterruptedException ignore) {
+ }
}
return t;
}
@@ -383,8 +391,7 @@ public class ExternalParser extends AbstractParser {
if (metadataPatterns.get(p) != null &&
!metadataPatterns.get(p).equals("")) {
metadata.add(metadataPatterns.get(p), m.group(1));
- }
- else{
+ } else {
metadata.add(m.group(1), m.group(2));
}
}
@@ -404,8 +411,8 @@ public class ExternalParser extends AbstractParser {
t.start();
try {
t.join();
+ } catch (InterruptedException ignore) {
}
- catch(InterruptedException ignore){}
}
/**
