Exemplo n.º 1
0
  static {
    graphFactory = MemoryGraphFactory.getInstance();
    graphFactory.setSortmode(MemoryGraphFactory.SORTMODE_ORDER);

    sampleInputs = new ArrayList<String>();

    while (true) {

      InputStream inputStream =
          XDIGrapher.class.getResourceAsStream("graph" + (sampleInputs.size() + 1) + ".xdi");
      ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
      int i;

      try {

        while ((i = inputStream.read()) != -1) outputStream.write(i);
        sampleInputs.add(new String(outputStream.toByteArray()));
      } catch (Exception ex) {

        break;
      } finally {

        try {
          inputStream.close();
        } catch (Exception ex) {
        }
        try {
          outputStream.close();
        } catch (Exception ex) {
        }
      }
    }
  }
Exemplo n.º 2
0
  static {
    graphFactory = MemoryGraphFactory.getInstance();
    graphFactory.setSortmode(MemoryGraphFactory.SORTMODE_ORDER);

    sampleInputs = Collections.singletonList("=alice");

    sampleEndpoint = XDIDiscoveryClient.DEFAULT_XDI_CLIENT.getXdiEndpointUri().toString();

    sampleServices =
        XDIClientConstants.WEBSOCKET_ENDPOINT_URI_TYPE.toString()
            + " "
            + XDIClientConstants.CONNECT_ENDPOINT_URI_TYPE.toString();
  }