@Test public void open_missing() throws Exception { try { openAndClose("testing"); fail(); } catch (SessionException e) { assertThat(e.getSessionId(), is("testing")); assertThat(e.getReason(), is(Reason.NOT_EXIST)); List<String> all = new ArrayList<>(provider.getCreatedIds()); assertThat(all.isEmpty(), is(true)); } }
@Override public List<String> getCreatedIds() throws IOException { LOG.debug("Collecting sessions: {}", directory); return list(directory, pathname -> { if (pathname.isFile() == false) { return false; } if (pathname.getName().startsWith(".")) { return false; } return true; }).stream().map(f -> fileToId(f)).collect(Collectors.toList()); }
FileSessionProvider extends SessionProvider { @Override public List<String> getCreatedIds() throws IOException { LOG.debug("Collecting sessions: {}", directory); return list(directory, pathname -> { if (pathname.isFile() == false) { return false; } if (pathname.getName().startsWith(".")) { return false; } return true; }).stream().map(f -> fileToId(f)).collect(Collectors.toList()); } }
FileSessionProvider extends SessionProvider { @Override public List<String> getCreatedIds() throws IOException { LOG.debug("Collecting sessions: {}", directory); return list(directory, pathname -> { if (pathname.isFile() == false) { return false; } if (pathname.getName().startsWith(".")) { return false; } return true; }).stream().map(f -> fileToId(f)).collect(Collectors.toList()); }  }
FileSessionProvider extends SessionProvider { @Override public List<String> getCreatedIds() throws IOException { LOG.debug("Collecting sessions: {}", directory); return list(directory, pathname -> { if (pathname.isFile() == false) { return false; } if (pathname.getName().startsWith(".")) { return false; } return true; }).stream().map(f -> fileToId(f)).collect(Collectors.toList()); }  @Override List<String> getCreatedIds(); @Override SessionMirror create(String id); @Override SessionMirror open(String id); @Override void delete(String id); }
FileSessionProvider extends SessionProvider { @Override public List<String> getCreatedIds() throws IOException { LOG.debug("Collecting sessions: {}", directory); return list(directory, pathname -> { if (pathname.isFile() == false) { return false; } if (pathname.getName().startsWith(".")) { return false; } return true; }).stream().map(f -> fileToId(f)).collect(Collectors.toList()); }  @Override List<String> getCreatedIds(); @Override SessionMirror create(String id); @Override SessionMirror open(String id); @Override void delete(String id); static final String KEY_DIRECTORY; }