Browse Source

Merge branch 'master' of https://github.com/DMDirc/Util into dev2

pull/49/head
Greg Holmes 9 years ago
parent
commit
d90ff693b4

+ 0
- 16
src/com/dmdirc/util/io/ConfigFile.java View File

@@ -265,22 +265,6 @@ public class ConfigFile extends TextFile {
265 265
         return flatdomains.containsKey(domain);
266 266
     }
267 267
 
268
-    /**
269
-     * Adds a new flat domain to this config file.
270
-     *
271
-     * @param name The name of the domain to be added
272
-     * @param data The content of the domain
273
-     */
274
-    public void addDomain(final String name, final Collection<String> data) {
275
-        domains.add(name);
276
-
277
-        if (flatdomains.containsKey(name)) {
278
-            flatdomains.get(name).addAll(data);
279
-        } else {
280
-            flatdomains.put(name, new ArrayList<>(data));
281
-        }
282
-    }
283
-
284 268
     /**
285 269
      * Adds a new key domain to this config file.
286 270
      *

+ 4
- 2
src/com/dmdirc/util/io/StreamIgnorer.java View File

@@ -27,6 +27,8 @@ import java.io.IOException;
27 27
 import java.io.InputStream;
28 28
 import java.io.InputStreamReader;
29 29
 
30
+import javax.annotation.WillClose;
31
+
30 32
 /**
31 33
  * Stream reader to read, but ignore a stream.
32 34
  */
@@ -38,9 +40,9 @@ class StreamIgnorer extends Thread {
38 40
     /**
39 41
      * Create a new Stream Ignorer that discards output.
40 42
      *
41
-     * @param stream The stream to ignore
43
+     * @param stream The stream to ignore, closed once {@link #run} is called.
42 44
      */
43
-    StreamIgnorer(final InputStream stream) {
45
+    StreamIgnorer(@WillClose final InputStream stream) {
44 46
         super("StreamIgnorer");
45 47
 
46 48
         this.stream = stream;

+ 3
- 1
src/com/dmdirc/util/io/StreamUtils.java View File

@@ -26,6 +26,8 @@ import java.io.Closeable;
26 26
 import java.io.IOException;
27 27
 import java.io.InputStream;
28 28
 
29
+import javax.annotation.WillClose;
30
+
29 31
 /**
30 32
  * Utilities for dealing with streams.
31 33
  *
@@ -37,7 +39,7 @@ public final class StreamUtils {
37 39
     private StreamUtils() {
38 40
     }
39 41
 
40
-    public static void readStream(final InputStream inputStream) {
42
+    public static void readStream(@WillClose final InputStream inputStream) {
41 43
         new StreamIgnorer(inputStream).run();
42 44
     }
43 45
 

Loading…
Cancel
Save