MetsLSResolver implements LSResourceResolver { @Override public LSInput resolveResource(String type, String namespaceURI, String publicId, String systemId, String baseURI) { String location = URL_MAP.get(systemId); if (location == null) { throw new IllegalStateException("Unable to find mapping for:" + systemId); } InputStream is = this.getClass().getResourceAsStream(location); LSInput input = dls.createLSInput(); input.setByteStream(is); input.setPublicId(publicId); input.setSystemId(systemId); return input; } private  MetsLSResolver(); static MetsLSResolver getInstance(); @Override LSInput resolveResource(String type, String namespaceURI, String publicId, String systemId, String baseURI);  }
@Test public void testResolveResource() throws Exception { MetsLSResolver resolver = MetsLSResolver.getInstance(); LSInput input = resolver.resolveResource(null, null, null, "http: assertNotNull(input); InputStream stream = input.getByteStream(); assertNotNull(stream); stream.close(); }