public class WcAction
extends org.apache.karaf.shell.console.AbstractAction
| Modifier and Type | Class and Description |
|---|---|
protected static class |
WcAction.WordCounts
Represent a basic object which stores the relevant counts information.
|
| Constructor and Description |
|---|
WcAction() |
| Modifier and Type | Method and Description |
|---|---|
protected Object |
doExecute() |
protected String |
formatWordCounts(WcAction.WordCounts wordCounts,
String reportName)
Create a human readable String of the given count information.
|
protected String |
getFilesWordCount(List<File> files)
Create a combined word count for the given files.
|
protected WcAction.WordCounts |
getWordCounts(InputStream inputStream)
Perform the main logic of counting the relevant data within a given input stream.
|
protected void |
setDefaultOptions() |
protected Object doExecute() throws Exception
doExecute in class org.apache.karaf.shell.console.AbstractActionExceptionprotected void setDefaultOptions()
protected String getFilesWordCount(List<File> files) throws IOException
files - the files to word count.IOException - in case of counting failure.protected WcAction.WordCounts getWordCounts(InputStream inputStream) throws IOException
inputStream - the input stream where to count.IOException - in case of counting failure.protected String formatWordCounts(WcAction.WordCounts wordCounts, String reportName)
wordCounts - the word counts containing the different counts data.reportName - the name associated with the word counts, ie a file name.Copyright © 2007–2015 The Apache Software Foundation. All rights reserved.