Changeset 3362
- Timestamp:
- 08/12/13 12:34:36 (11 years ago)
- Location:
- vlo/trunk/vlo_web_app/src
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
vlo/trunk/vlo_web_app/src/main/java/eu/clarin/cmdi/vlo/pages/LinkPanel.java
r2829 r3362 95 95 try{ 96 96 u = new URL(resourceLink); 97 System.out.println(resourceLink);98 97 URLConnection c = u.openConnection(); 99 98 if(c instanceof HttpURLConnection){ 100 99 con = (HttpURLConnection) c; 100 con.setInstanceFollowRedirects(false); 101 101 } 102 102 if(con != null){ 103 103 if(con.getResponseCode() == HttpURLConnection.HTTP_MOVED_PERM || 104 104 con.getResponseCode() == HttpURLConnection.HTTP_MOVED_TEMP || 105 con.getResponseCode() == HttpURLConnection.HTTP_SEE_OTHER){ 106 result = con.getURL().toString(); 107 /* for (Map.Entry<String, List<String>> header : con.getHeaderFields().entrySet()) { 108 if(header != null && header.getKey() != null){ 109 System.out.println("XXX:" + header.getKey()); 110 System.out.println(header.getValue().get(0)); 111 if(header.getKey().equals("Location")){ 112 result = header.getValue().get(0); 113 } 114 } 115 }*/ 105 con.getResponseCode() == HttpURLConnection.HTTP_SEE_OTHER) { 106 String location = con.getHeaderField("location"); 107 if(location != null) 108 result = location; 116 109 } 117 110 } -
vlo/trunk/vlo_web_app/src/test/java/eu/clarin/cmdi/vlo/pages/ResourceLinkPanelTest.java
r2988 r3362 36 36 37 37 uit = totest.getNameFromLink(_RESOLVE_STRING); 38 // from at least 29.05.2013 this was not working 39 // Assert.assertTrue("Returns the resolved url of the handle pid", uit.equals(_RESOLVE_OUT)); 38 Assert.assertTrue("Returns the resolved url of the handle pid", uit.equals(_RESOLVE_OUT)); 40 39 } 41 40 }
Note: See TracChangeset
for help on using the changeset viewer.