1010import org .sela .exception .FileException ;
1111
1212public final class App {
13- public static void main (String [] args ) {
13+ public static void main (final String [] args ) {
1414 System .out .println ("\u001B [1mSimplE Lossless Audio. Released under MIT license\u001B [0m" );
1515 if (args .length < 2 ) {
1616 printUsage ();
1717 } else {
1818 try {
1919 parseCommandLineArgs (args );
20- } catch (Exception e ) {
20+ } catch (final Exception e ) {
2121 System .err .println ("\u001B [1m" + e .getMessage () + ". Aborting...\u001B [0m" );
2222 e .printStackTrace ();
2323 }
2424 }
2525 }
2626
27- private static void parseCommandLineArgs (String [] args ) throws IOException , FileException , LineUnavailableException {
27+ private static void parseCommandLineArgs (final String [] args )
28+ throws IOException , FileException , LineUnavailableException {
2829 if (args [0 ].equals ("-e" ) && args .length == 3 ) {
29- File inputFile = new File (args [1 ]);
30- File outputFile = new File (args [2 ]);
30+ final File inputFile = new File (args [1 ]);
31+ final File outputFile = new File (args [2 ]);
3132 System .out .println ("\u001B [1mEncoding: \u001B [0m" + inputFile .getAbsolutePath ());
3233 encodeFile (inputFile , outputFile );
3334 } else if (args [0 ].equals ("-d" ) && args .length == 3 ) {
34- File inputFile = new File (args [1 ]);
35- File outputFile = new File (args [2 ]);
35+ final File inputFile = new File (args [1 ]);
36+ final File outputFile = new File (args [2 ]);
3637 System .out .println ("\u001B [1mDecoding: \u001B [0m" + inputFile .getAbsolutePath ());
3738 decodeFile (inputFile , outputFile );
3839 } else if (args [0 ].equals ("-p" ) && args .length == 2 ) {
39- File inputFile = new File (args [1 ]);
40+ final File inputFile = new File (args [1 ]);
4041 System .out .println ("\u001B [1mPlaying: \u001B [0m" + inputFile .getAbsolutePath ());
4142 playFile (inputFile );
4243 System .out .println ("" );
@@ -48,20 +49,20 @@ private static void parseCommandLineArgs(String[] args) throws IOException, File
4849 System .out .println ("\u001B [1mDone\u001B [0m" );
4950 }
5051
51- private static void encodeFile (File inputFile , File outputFile ) throws IOException , FileException {
52- Encoder selaEncoder = new Encoder (inputFile , outputFile );
53- SelaFile selaFile = selaEncoder .process ();
52+ private static void encodeFile (final File inputFile , final File outputFile ) throws IOException , FileException {
53+ final Encoder selaEncoder = new Encoder (inputFile , outputFile );
54+ final SelaFile selaFile = selaEncoder .process ();
5455 selaFile .writeToStream ();
5556 }
5657
57- private static void decodeFile (File inputFile , File outputFile ) throws IOException , FileException {
58- Decoder selaDecoder = new Decoder (inputFile , outputFile );
59- WavFile wavFile = selaDecoder .process ();
58+ private static void decodeFile (final File inputFile , final File outputFile ) throws IOException , FileException {
59+ final Decoder selaDecoder = new Decoder (inputFile , outputFile );
60+ final WavFile wavFile = selaDecoder .process ();
6061 wavFile .writeToStream ();
6162 }
6263
63- private static void playFile (File inputFile ) throws IOException , FileException , LineUnavailableException {
64- Player selaPlayer = new Player (inputFile );
64+ private static void playFile (final File inputFile ) throws IOException , FileException , LineUnavailableException {
65+ final Player selaPlayer = new Player (inputFile );
6566 selaPlayer .play ();
6667 }
6768
0 commit comments