@Test public void testGetNextLinkFromHeaders() throws Exception { Header header = new BasicHeader("Link", "</api/next>; rel=\"next\""); String result = SoftwareHeritageOriginsImporter.getNextLinkFromHeaders(new Header[] {header}); assertNotNull(result); assertEquals("/api/next", result); }
protected static String getNextLinkFromHeaders(Header[] headers) { if (headers != null) { for (int i = 0; i < headers.length; i++) { if (HEADER_LINK.equals(headers[i].getName())) { return getNextLinkFromHeader(headers[i].getValue()); } } } return null; }
SoftwareHeritageOriginsImporter implements eu.dnetlib.iis.common.java.Process { protected static String getNextLinkFromHeaders(Header[] headers) { if (headers != null) { for (int i = 0; i < headers.length; i++) { if (HEADER_LINK.equals(headers[i].getName())) { return getNextLinkFromHeader(headers[i].getValue()); } } } return null; } }
SoftwareHeritageOriginsImporter implements eu.dnetlib.iis.common.java.Process { protected static String getNextLinkFromHeaders(Header[] headers) { if (headers != null) { for (int i = 0; i < headers.length; i++) { if (HEADER_LINK.equals(headers[i].getName())) { return getNextLinkFromHeader(headers[i].getValue()); } } } return null; } SoftwareHeritageOriginsImporter(); }
SoftwareHeritageOriginsImporter implements eu.dnetlib.iis.common.java.Process { protected static String getNextLinkFromHeaders(Header[] headers) { if (headers != null) { for (int i = 0; i < headers.length; i++) { if (HEADER_LINK.equals(headers[i].getName())) { return getNextLinkFromHeader(headers[i].getValue()); } } } return null; } SoftwareHeritageOriginsImporter(); @Override Map<String, PortType> getInputPorts(); @Override Map<String, PortType> getOutputPorts(); @Override void run(PortBindings portBindings, Configuration conf, Map<String, String> parameters); }
SoftwareHeritageOriginsImporter implements eu.dnetlib.iis.common.java.Process { protected static String getNextLinkFromHeaders(Header[] headers) { if (headers != null) { for (int i = 0; i < headers.length; i++) { if (HEADER_LINK.equals(headers[i].getName())) { return getNextLinkFromHeader(headers[i].getValue()); } } } return null; } SoftwareHeritageOriginsImporter(); @Override Map<String, PortType> getInputPorts(); @Override Map<String, PortType> getOutputPorts(); @Override void run(PortBindings portBindings, Configuration conf, Map<String, String> parameters); static final String DEFAULT_METAFILE_NAME; }