Package com.google.common.io

Examples of com.google.common.io.LineReader.readLine()


                                 discoverable.getSocketAddress().getPort());
      try {
        PrintWriter writer = new PrintWriter(new OutputStreamWriter(socket.getOutputStream(), Charsets.UTF_8), true);
        LineReader reader = new LineReader(new InputStreamReader(socket.getInputStream(), Charsets.UTF_8));
        writer.println(expected.getKey());
        Assert.assertEquals(expected.getValue(), reader.readLine());
      } finally {
        socket.close();
      }
    }
View Full Code Here


      PrintWriter writer = new PrintWriter(new OutputStreamWriter(socket.getOutputStream(), Charsets.UTF_8), true);
      LineReader reader = new LineReader(new InputStreamReader(socket.getInputStream(), Charsets.UTF_8));

      String msg = "Local file test";
      writer.println(msg);
      Assert.assertEquals(header, reader.readLine());
      Assert.assertEquals(msg, reader.readLine());
    } finally {
      socket.close();
    }
View Full Code Here

      LineReader reader = new LineReader(new InputStreamReader(socket.getInputStream(), Charsets.UTF_8));

      String msg = "Local file test";
      writer.println(msg);
      Assert.assertEquals(header, reader.readLine());
      Assert.assertEquals(msg, reader.readLine());
    } finally {
      socket.close();
    }

    controller.stopAndWait();
View Full Code Here

      try {
        PrintWriter writer = new PrintWriter(new OutputStreamWriter(socket.getOutputStream(), Charsets.UTF_8), true);
        LineReader reader = new LineReader(new InputStreamReader(socket.getInputStream(), Charsets.UTF_8));

        writer.println(msg);
        Assert.assertEquals(msg, reader.readLine());
      } finally {
        socket.close();
      }
    }
View Full Code Here

    int referenceStartIndex = 0;
    int lineIndex = 0;
   
    String PE = "For path: '{}', ";
   
    while ( (line = lr.readLine()) != null) {
      if (first) first = false;
      Matcher m = tokenPattern.matcher(line);
      String tag;
      if (m.matches() && (tag = m.group(1)) != null && ! (tag = tag.trim()).isEmpty()) {
        if (tag != null && tag.startsWith("#")) {
View Full Code Here

    int nameIndex = 0;
    int positionalIndex = 0;
    int position = 0;
    boolean first = true;
   
    while ( (line = lr.readLine()) != null) {
      if (first) first = false;
      else if (! config.isStripNewLines()) sb.append("\n");
      Matcher m = tokenPattern.matcher(line);
      if (m.matches()) {
        String leftHand = m.group(1);
View Full Code Here

    int nameIndex = 0;
    int positionalIndex = 0;
    int position = 0;
    boolean first = true;
   
    while ( (line = lr.readLine()) != null) {
      if (first) first = false;
      else sb.append("\n");
      Matcher m = tokenPattern.matcher(line);
      if (m.matches()) {
        String leftHand = m.group(1);
View Full Code Here

    private List<String> getManifestLinks(String manifestContents) throws IOException {
        List<String> links = Lists.newArrayList();

        LineReader reader = new LineReader(new StringReader(manifestContents));
        for (String line = reader.readLine(); line != null; line = reader.readLine()) {
            if (line.startsWith("/")) {
                links.add(line);
            }
        }
        return links;
View Full Code Here

    private List<String> getManifestLinks(String manifestContents) throws IOException {
        List<String> links = Lists.newArrayList();

        LineReader reader = new LineReader(new StringReader(manifestContents));
        for (String line = reader.readLine(); line != null; line = reader.readLine()) {
            if (line.startsWith("/")) {
                links.add(line);
            }
        }
        return links;
View Full Code Here

    int nameIndex = 0;
    int positionalIndex = 0;
    int position = 0;
    boolean first = true;
   
    while ( (line = lr.readLine()) != null) {
      if (first) first = false;
      else sb.append("\n");
      Matcher m = tokenPattern.matcher(line);
      if (m.matches()) {
        String leftHand = m.group(1);
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.