1
1
package com .joelchristophel .sourceradio ;
2
2
3
- import java .io .BufferedReader ;
4
3
import java .io .Closeable ;
5
4
import java .io .File ;
6
5
import java .io .FileNotFoundException ;
7
- import java .io .InputStreamReader ;
8
- import java .net .HttpURLConnection ;
9
- import java .net .URL ;
6
+ import java .io .IOException ;
10
7
import java .net .UnknownHostException ;
11
8
import java .sql .Types ;
12
9
import java .text .Normalizer ;
@@ -64,7 +61,7 @@ public static void main(String[] args) {
64
61
System .out .println ();
65
62
String version = Playlist .class .getPackage ().getImplementationVersion ();
66
63
version = version == null ? "" : version ;
67
- System .out .println ("**** SourceRadio" + (version .isEmpty () ? "" : " v" + version ) + " ****" );
64
+ System .out .println ("**** SourceRadio" + (version .isEmpty () ? "" : " v" + version ) + " ****" );
68
65
System .out .println ();
69
66
List <String > argsList = args == null ? new ArrayList <String >() : new ArrayList <String >(Arrays .asList (args ));
70
67
if (argsList .contains ("-d" )) { // Restore default properties
@@ -121,7 +118,7 @@ public static void main(String[] args) {
121
118
Song .downloadYoutubedl ("libraries" );
122
119
System .out .println ("Listening for commands..." );
123
120
playlist .start ();
124
- } catch (FileNotFoundException e ) { // If Steam or game directories don't exist
121
+ } catch (IOException e ) {
125
122
System .out .println (e .getMessage ());
126
123
}
127
124
}
@@ -131,9 +128,9 @@ public static void main(String[] args) {
131
128
* This method is to be used to obtain a {@link Playlist} instance.
132
129
*
133
130
* @return a <code>Playlist</code> instance
134
- * @throws FileNotFoundException
131
+ * @throws IOException
135
132
*/
136
- public synchronized static Playlist getInstance (Game game ) throws FileNotFoundException {
133
+ public synchronized static Playlist getInstance (Game game ) throws IOException {
137
134
Playlist playlist = null ;
138
135
if (instance == null ) {
139
136
playlist = (instance = new Playlist (game ));
@@ -148,11 +145,11 @@ public synchronized static Playlist getInstance(Game game) throws FileNotFoundEx
148
145
/**
149
146
* Constructs a {@link Playlist}.
150
147
*
151
- * @throws FileNotFoundException
148
+ * @throws IOException
152
149
*
153
150
* @see #getInstance
154
151
*/
155
- private Playlist (Game game ) throws FileNotFoundException {
152
+ private Playlist (Game game ) throws IOException {
156
153
super ();
157
154
this .game = game ;
158
155
initialize ();
@@ -161,9 +158,9 @@ private Playlist(Game game) throws FileNotFoundException {
161
158
/**
162
159
* Starts the database, initializes instance variables, and writes key binds.
163
160
*
164
- * @throws FileNotFoundException
161
+ * @throws IOException
165
162
*/
166
- private void initialize () throws FileNotFoundException {
163
+ private void initialize () throws IOException {
167
164
Game .setCurrentGame (game );
168
165
logReader = LogReader .getInstance ();
169
166
database = DatabaseManager .getInstance ();
@@ -619,11 +616,7 @@ public void close() {
619
616
*/
620
617
private void setCurrentSong (Song song ) {
621
618
currentSong = song ;
622
- try {
623
- scriptWriter .updateCurrentSongScript (song );
624
- } catch (FileNotFoundException e ) {
625
- System .err .println (e .getMessage ());
626
- }
619
+ scriptWriter .updateCurrentSongScript (song );
627
620
}
628
621
629
622
/**
@@ -787,7 +780,6 @@ private boolean removeAdmin(final Player adminToRemove, Player requester, boolea
787
780
success = admins .remove (adminToRemove );
788
781
if (toBeWritten ) {
789
782
Runnable removeAdmin = new Runnable () {
790
-
791
783
@ Override
792
784
public void run () {
793
785
properties .removeAdmin (adminToRemove );
0 commit comments