chemistry-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Marco Spasiano (Resolved) (JIRA)" <j...@apache.org>
Subject [jira] [Resolved] (CMIS-474) HttpURLConnection do not close
Date Tue, 29 Nov 2011 07:13:39 GMT

     [ https://issues.apache.org/jira/browse/CMIS-474?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Marco Spasiano resolved CMIS-474.
---------------------------------

       Resolution: Fixed
    Fix Version/s: OpenCMIS 0.5.0

Create CustomAuthenticationProvider
public class CustomAuthenticationProvider extends
		StandardAuthenticationProvider {

	@Override
	public Map<String, List<String>> getHTTPHeaders(String url) {
		Map<String, List<String>> headers = super.getHTTPHeaders(url);
		headers.put("connection", Collections.singletonList("close"));
		return headers;
	}
}

                
> HttpURLConnection do not close
> ------------------------------
>
>                 Key: CMIS-474
>                 URL: https://issues.apache.org/jira/browse/CMIS-474
>             Project: Chemistry
>          Issue Type: Bug
>          Components: opencmis-client-bindings
>    Affects Versions: OpenCMIS 0.5.0
>            Reporter: Marco Spasiano
>            Priority: Critical
>              Labels: patch
>             Fix For: OpenCMIS 0.5.0
>
>
> If execute this code i got an error.
> 		Session session = getCMISSession();
> 		try{
> 			Folder folder = (Folder) session.getObjectByPath("/");			
> 			for (int i = 0; i < 100; i++) {
> 				System.out.println("before create folder");
> 				Folder newFolder = createNewFolder(folder, "TEST HTTPCONNECTION CLOSE");
> 				System.out.println("after create folder");
> 				newFolder.delete(true);
> 				System.out.println("after delete folder");				
> 			}
> 		}catch (CmisBaseException e) {
> 			e.printStackTrace();
> 			System.err.println(e.getErrorContent());
> 		}		
> Maybe because in org.apache.chemistry.opencmis.client.bindings.spi.atompub.HttpUtils
after open connection
> don't close the connection.
>             HttpURLConnection conn = (HttpURLConnection) (new URL(url.toString())).openConnection();
> if I add this code everythings work fine.
>             	conn.setRequestProperty("connection", "close");

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Mime
View raw message