Bläddra i källkod

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

pull/49/head
Greg Holmes 9 år sedan
förälder
incheckning
d90ff693b4

+ 0
- 16
src/com/dmdirc/util/io/ConfigFile.java Visa fil

265
         return flatdomains.containsKey(domain);
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
      * Adds a new key domain to this config file.
269
      * Adds a new key domain to this config file.
286
      *
270
      *

+ 4
- 2
src/com/dmdirc/util/io/StreamIgnorer.java Visa fil

27
 import java.io.InputStream;
27
 import java.io.InputStream;
28
 import java.io.InputStreamReader;
28
 import java.io.InputStreamReader;
29
 
29
 
30
+import javax.annotation.WillClose;
31
+
30
 /**
32
 /**
31
  * Stream reader to read, but ignore a stream.
33
  * Stream reader to read, but ignore a stream.
32
  */
34
  */
38
     /**
40
     /**
39
      * Create a new Stream Ignorer that discards output.
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
         super("StreamIgnorer");
46
         super("StreamIgnorer");
45
 
47
 
46
         this.stream = stream;
48
         this.stream = stream;

+ 3
- 1
src/com/dmdirc/util/io/StreamUtils.java Visa fil

26
 import java.io.IOException;
26
 import java.io.IOException;
27
 import java.io.InputStream;
27
 import java.io.InputStream;
28
 
28
 
29
+import javax.annotation.WillClose;
30
+
29
 /**
31
 /**
30
  * Utilities for dealing with streams.
32
  * Utilities for dealing with streams.
31
  *
33
  *
37
     private StreamUtils() {
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
         new StreamIgnorer(inputStream).run();
43
         new StreamIgnorer(inputStream).run();
42
     }
44
     }
43
 
45
 

Laddar…
Avbryt
Spara